//MOUSEOVER
function do_mover_mout(id,img_url){
 	eval('document.'+id+'.src="'+img_url+'";');
}

//PRE-LOAD IMAGE
function global_newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

//POP-UP WINDOW
function popup(filename, wide, tall){
    var mywin = window.open(filename,'special','top=20,screenx=20,left=20,screeny=20,width=' + wide + ',height=' + tall + ',buttons=no,scrollbars=no,location=no,menubar=no,resizable=no,status=no,directories=no,toolbar=no');
	mywin.focus();
	return false;
}

function popup2(filename, wide, tall){
    var mywin = window.open(filename,'special','top=20,screenx=20,left=20,screeny=20,width=' + wide + ',height=' + tall + ',buttons=no,scrollbars=no,location=no,menubar=no,resizable=no,status=no,directories=no,toolbar=no');
	mywin.focus();
}

function popup_scroll(filename, wide, tall){
    var mywin = window.open(filename,'special','top=20,screenx=20,left=20,screeny=20,width=' + wide + ',height=' + tall + ',buttons=no,scrollbars=yes,location=no,menubar=no,resizable=no,status=no,directories=no,toolbar=no');
	mywin.focus();
	return false;
}

 /* Validation */
function Trim(x) {
	var i;
	if (x.length == 0) {return "";};
	i = x.length - 1;
	while (x.substring(i,i+1) == " " && i > 0 )  {
		x = x.substring(0,i);
		i--;
	}
	if (x.length == 0) {return "";};
	while (x.substring(0,1) == " " && x != "" )  {
		x = x.substring(1,x.length);
		i++;
	}
	return x;
}// end Trim

function echeck(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					
}//echeck

// Dyn hidden Div Functions
 function switch_div_content(id,idToShow,numOfLoop) {
	var eById = isGetElementByIdDefined();
	var ie4 = (document.all)? true:false;
	var ns6 = (!document.all && document.getElementById) ? true : false;
	var loopCount = parseInt(numOfLoop);
  
  if(eById){
  	document.getElementById(id).style.display = 'none';
	for(var i=2; i<=loopCount; i++){
		document.getElementById(id+i).style.display = 'none';
	}
	if(idToShow!=""){	
  		document.getElementById(idToShow).style.display = 'block';
	}
  }else if (ns6) {
  	document.getElementsByTagName("*").namedItem(id).style.display = 'none';
	for(var i=2; i<=loopCount; i++){
		document.getElementsByTagName("*").namedItem(id+i).style.display = 'none';
	}
	if(idToShow!=""){
    	document.getElementsByTagName("*").namedItem(idToShow).style.display = 'block';
	}
  }else if (ie4) {
  	document.all[id].style.display = 'none';
	for(var i=2; i<=loopCount; i++){
		document.all[id+i].style.display = 'none';
	}
	if(idToShow!=""){
  		document.all[idToShow].style.display = 'block';
	}	
  }
 }// End switch_div_content

 function isGetElementByIdDefined(){
	 if(typeof document.getElementById != 'undefined')
		return true;
	 else
		return false;
 }