// JavaScript Document
function open_close_div(divid)
{
	if(document.getElementById(divid).style.display=='block')
	{
		document.getElementById(divid).style.display='none';
	}
	else
	{
		document.getElementById(divid).style.display='block';
	}
}

//OnmouseOver Menu  Fucntions
var lastAId='';
var lastDivid='';
function dev_js_menu_mouseover(aid,divid,selectedclass)
{

	if(lastAId=='')
	{
		document.getElementById(aid).className=selectedclass;
		document.getElementById(divid).style.display='block';
		lastAId=aid;
		lastDivid=divid;
	}
	else if(lastAId==aid)
	{
		lastAId=aid;
		lastDivid=divid;
	}
	else if(lastAId!=aid)
	{
		document.getElementById(lastAId).className='';
		document.getElementById(lastDivid).style.display='none';
		document.getElementById(aid).className=selectedclass;
		document.getElementById(divid).style.display='block';
		lastAId=aid;
		lastDivid=divid;
	}
}

function dev_js_menu_mouseout(aid,divid,selectedclass)
{
		if(divid!='')
		{
			document.getElementById(aid).className='';
			document.getElementById(divid).style.display='none';
		}

}



/*VALIDATE EMAIL*/
function validateEmailv2(email)
{
// a very simple email validation checking. 
// you can add more complex email checking if it helps 
    if(email.length <= 0)
	{
	  return true;
	}
    var splitted = email.match("^(.+)@(.+)$");
    if(splitted == null) return false;
    if(splitted[1] != null )
    {
      var regexp_user=/^\"?[\w-_\.]*\"?$/;
      if(splitted[1].match(regexp_user) == null) return false;
    }
    if(splitted[2] != null)
    {
      var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
      if(splitted[2].match(regexp_domain) == null) 
      {
	    var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
	    if(splitted[2].match(regexp_ip) == null) return false;
      }// if
      return true;
    }
return false;
}


