// Top menu Created 17/09/2002 by KAK : EBO Company  :

function showlayer (id) {
  var id,obj;
  obj = document.getElementById(id);
  obj=obj.style;
  obj.visibility="visible";
  
}
function hidelayer (id) {
  var id,obj;
  obj = document.getElementById(id);
  obj=obj.style;
  obj.visibility="hidden";
}
function hl_on_menu (id) {
   var id,obj;
  obj = document.getElementById(id);
  obj=obj.style;
  obj.backgroundColor = "#FF0000";
  obj.color = "#FFFFFF";
  obj.cursor = "hand";
}

function hl_off_menu (id) {
   var id,obj;
   obj = document.getElementById(id);
   obj=obj.style;
   obj.backgroundColor = "#FFFFFF";
   obj.color = "#000000";
}
function gotourl(url) {document.location = url;}

 function new_win_def_prot(mypage, myname, w, h, scroll,fullscreen) { //Show center screen,focus page in use
				var winl = (screen.width - w) / 2;
				var wint = (screen.height - h) / 2;
				winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',fullscreen='+fullscreen+',resizable,toolbar=no,location=no,status=yes,menubar=no'
				win = window.open(mypage, myname, winprops)
				if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
 function new_win_def_prot1(mypage, myname, w, h, scroll,fullscreen) { //Show center screen,focus page in use
				var winl = (screen.width - w) / 2;
				var wint = (screen.height - h) / 2;
				winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',fullscreen='+fullscreen+',resizable,toolbar=yes,location=yes,status=yes,menubar=yes'
				win = window.open(mypage, myname, winprops)
				if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

 function new_win_def_prot2(mypage, myname, w, h, scroll,fullscreen) { //Show center screen,focus page in use
				var winl = (screen.width - w) / 2;
				var wint = (screen.height - h) / 2;
				winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',fullscreen='+fullscreen+',resizable,toolbar=no,location=no,status=no,menubar=no'
				win = window.open(mypage, myname, winprops)
				if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
function chkEmail (str) 
	{
	    var num_as = str.lastIndexOf("@");
		var num_poin = str.lastIndexOf(".");
	    if (num_as == -1 || num_poin ==-1) 
		{
		     return false; 
	    }else
		{
		   return true;
		}
   }
function isBlank(val) {
if (val=="") {
		return true;		
	}
	return false;
}

 function isNum (charCode) 
   {
       if (charCode >= 48 && charCode <= 57 )
	       return true;
      else
	     return false;
   }
   function isAtoZ (charCode) 
   {
       if (charCode >= 65 && charCode <= 90 )
	       return true;
      else
	     return false;
   }
   function isaToz (charCode)
   {
      if (charCode >= 97 && charCode <= 122 )
	       return true;
      else
	     return false;
   }
   
 function chkFormatNaA (str) {//0-9,a-z,A-Z
  strlen = str.length;
  for (i=0;i<strlen;i++)
  {
      var charCode = str.charCodeAt(i);
	  if (!isNum(charCode) && !isAtoZ(charCode) && !isaToz(charCode)) {
		  return false;
	  }
   }
   return true;
}

function chkLen (str,numLen)
{
        var  strLen = str.length;
      	if (strLen < numLen) {
		    return false;
		}
     return true;
}

function new_win_def_point(mypage, myname, l, t, w, h, scroll,fullscreen) { //Show center screen,focus page in use
				winprops = 'height='+h+',width='+w+',top='+t+',left='+l+',scrollbars='+scroll+',fullscreen='+fullscreen+',resizable,toolbar=no,location=no,status=yes,menubar=no'
				win = window.open(mypage, myname, winprops)
				if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
function new_win_def_point2(mypage, myname, w, h, scroll,fullscreen) { //Show center screen,focus page in use
                var winl = (screen.width - w) / 2;
				var wint = (screen.height - h) / 8;
				winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',fullscreen='+fullscreen+',resizable,toolbar=yes,addressbar=yes,location=yes,status=yes,menubar=yes'
				win = window.open(mypage, myname, winprops)
			//	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function hl_on_menu (id) {
   var id,obj;
  obj = document.getElementById(id);
  obj=obj.style;
  obj.backgroundColor = "#FFEEDD";
  obj.color = "#FF9933";
  obj.cursor = "hand";
}

function hl_off_menu (id) {
   var id,obj;
   obj = document.getElementById(id);
   obj=obj.style;
   obj.backgroundColor = "#FFDCB9";
   obj.color = "#000000";
}
function auto_close () {
	 setTimeout("closeWin()",3000);
 }
 function closeWin() {
                self.close();
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
/* Checkbox*/
      function ToggleAll(e,f,elementName)
    {
	if (e.checked) {
	    CheckAll(f,elementName);
	}
	else {
	    ClearAll(f,elementName);
	}
    }

    function Check(e)
    {
	e.checked = true;
    }

    function Clear(e)
    {
	e.checked = false;
    }

    function CheckAll(ml,elementName)
    {
	var len = ml.elements.length;
	for (var i = 0; i < len; i++) {
	    var e = ml.elements[i];
	    if (e.name == elementName) {
		Check(e);
	    }
	}
	ml.toggleAll.checked = true;
    }

    function ClearAll(ml,elementName)
    {
	var len = ml.elements.length;
	for (var i = 0; i < len; i++) {
	    var e = ml.elements[i];
	    if (e.name == elementName) {
		Clear(e);
	    }
	}
	ml.toggleAll.checked = false;
    }
function openFrameless(windowW,windowH,urlPop, title){

//Set center  screen
//   var windowX = (screen.width - windowW) / 2;
//   var windowY = (screen.height - windowH) / 2;
var windowY = windowX = 0;
// var debug = ",status=yes";// Debug error

   windowH=windowH+37;
   windowW=windowW+10;
   
   
   s = "width="+windowW+",height="+windowH+",scrollbars=no";
   var beIE = document.all?true:false
   
// set this to true if the popup should close
// upon leaving the launching page; else, false

var autoclose = true
   
  if (beIE){
    //NFW = window.open("","popFrameless","fullscreen,"+s)     
	NFW = window.open("","popFrameless",s)
    NFW.blur()
    window.focus()       
    NFW.resizeTo(windowW,windowH)
    NFW.moveTo(windowX,windowY)
    var frameString=""+
"<html>"+
"<head>"+
"<title>"+title+"</title>"+
"</head>"+
"<frameset rows='*,0' framespacing=0 border=0 frameborder=0>"+
"<frame name='top' src='"+urlPop+"' scrolling=auto>"+
"<frame name='bottom' src='about:blank' scrolling='no'>"+
"</frameset>"+
"</html>"
    NFW.document.open();
    NFW.document.write(frameString)
    NFW.document.close()
  } else {
    NFW=window.open(urlPop,"popFrameless","scrollbars,"+s)
    NFW.blur()
    window.focus() 
    NFW.resizeTo(windowW,windowH)
    NFW.moveTo(windowX,windowY)
  }   
  NFW.focus()   
  if (autoclose){
    window.onunload = function(){NFW.close()}
  }
}

function setErrorFocus (e) {
	   e.style.borderColor='#FF0000';
	   e.style.borderStyle='dashed';
	   e.focus ();
}
function maximizeWindow() {
 if (parseInt(navigator.appVersion)>3) {
  if (navigator.appName=="Netscape") {
   if (top.screenX>0 || top.screenY>0) top.moveTo(0,0);
   if (top.outerWidth < screen.availWidth)
      top.outerWidth=screen.availWidth;
   if (top.outerHeight < screen.availHeight) 
      top.outerHeight=screen.availHeight;
  }
  else {
   top.moveTo(-4,-4);
   top.resizeTo(screen.availWidth+8,screen.availHeight+8);
  }
 }
}
 function newWinDefProt(mypage, myname, winprops) { //Show center screen,focus page in use
				//winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',fullscreen='+fullscreen+',resizable,toolbar=no,location=no,status=1,menubar=no'
				win = window.open(mypage, myname, winprops)
				if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
	/* End checkbox*/
