var tm;
var menus=new Array('drop_menu_news','drop_menu_products');

function init() {
    for(var i=0;i<menus.length;i++) {
        var id =  menus[i];
        document.getElementById(id).style.opacity=0.8;
        document.getElementById(id).style.filter='alpha(opacity=80)';
    }
}

function show(id) {
    if(tm) {
        clearTimeout(tm);
    }
    document.getElementById(id).style.display='block';
}

function hide(id) {
    tm = setTimeout('document.getElementById("'+id+'").style.display="none"',100);
}

function WindowOnload(f) {
    var prev=window.onload;
    window.onload=function(){ if(prev)prev(); f(); }
  }

WindowOnload(init);



function validate() {

if ( document.getElementById('your_name').value.length < 2 ) {
    alert("Please provide a real name");
    return false;
    }

if (document.forms[0].your_email.value.indexOf('@')==-1  || document.forms[0].your_email.value.indexOf('.')==-1  || document.forms[0].your_email.value.length <= 7 )
    {
    alert("Please provide your email");
    return false;
    }


if (document.getElementById("questions").value.length < 5 )	{
    alert("Please write a message ");
    return false;
    }
}

function validate_trade() {

if ( document.getElementById('your_name').value.length < 2 ) {
    alert("Please provide a real name");
    return false;
    }

if (document.forms[0].your_email.value.indexOf('@')==-1  || document.forms[0].your_email.value.indexOf('.')==-1  || document.forms[0].your_email.value.length <= 7 )
    {
    alert("Please provide your email");
    return false;
    }


if (document.getElementById("your_date").value.length < 5 )	{
    alert("Please write the date ");
    return false;
    }






if (!document.getElementById("agree").checked )
    {
    alert("Please read and accept the Terms and Conditions of Trading");
    return false;
    }

}


