var DD_NAV_MOUSEOVER = {};
function dd_nav_mouseover(dd) {
	var div = document.getElementById('dd_'+dd);

	div.style.left = "auto";

	DD_NAV_MOUSEOVER[dd] = true;
	if (navigator.platform.substring(0,3) == 'Mac') {
		if (jQuery.browser['mozilla']) {
			div.style.marginTop = '-35px';
		} else {
			div.style.marginTop = '-30px';
		}
	} else {
		if (jQuery.browser['mozilla']) {
			div.style.marginTop = '-34px';
		} else {
			div.style.marginTop = '-30px';
		}
	}
}

function email_validate(str) {

	var at="@";
	var dot=".";
	var lat=str.indexOf(at);
	var lstr=str.length;
	var ldot=str.indexOf(dot);
	if (str.indexOf(at)==-1){
	   return false;
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   return false;
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
	    return false;
	}

	 if (str.indexOf(at,(lat+1))!=-1){
	    return false;
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
	    return false;
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
	    return false;
	 }
	
	 if (str.indexOf(" ")!=-1){
	    return false;
	 }

	 return true;
}

function dd_nav_mouseout(dd) {
	var div = document.getElementById('dd_'+dd);
	var img = document.getElementById('image_'+dd);	

	DD_NAV_MOUSEOVER[dd] = false;
	setTimeout(function() {
		if (!DD_NAV_MOUSEOVER[dd]) {
			div.style.left = -999;
		}
	},150);
}

function showAlertLayer(id) {
    var isIE4 = (document.all && !document.getElementById) ? true : false;
    var isIE5 = (document.all && document.getElementById) ? true : false;
    var isIE = (isIE4||isIE5) ? true : false;

    var top = alertFindPosY(document.getElementById('alert_link_div'));
    var left = alertFindPosX(document.getElementById('alert_link_div'));

    if (isIE) {
      document.getElementById(id).style.top = (top - 330) + 'px';
      document.getElementById(id).style.left = (left + 10) + 'px';
    } else {
      document.getElementById(id).style.top = (top - 320) + 'px';
      document.getElementById(id).style.left = (left + 10) + 'px';
    }
    document.getElementById(id).style.display = "block";
}

function alertFindPosY(obj)
{
  var curtop = 0;
  if(obj.offsetParent)
      while(1)
      {
        curtop += obj.offsetTop;
        if(!obj.offsetParent)
          break;
        obj = obj.offsetParent;
      }
  else if(obj.y)
      curtop += obj.y;
  return curtop;
}
function alertFindPosX(obj)
{
  var curleft = 0;
  if(obj.offsetParent)
      while(1)
      {
    	  curleft += obj.offsetLeft;
        if(!obj.offsetParent)
          break;
        obj = obj.offsetParent;
      }
  else if(obj.y)
	  curleft += obj.x;
  return curleft;
}


