// JavaScript Document
/*==============================(^_^)==============================*\
@ ################################################################# @
@ # Handle Element v1.0 	                                      # @
@ # Coded by Harry Nguyen                                         # @
@ # Company: Megaleap (http://www.megaleap.com)                   # @
@ # Email: harrynguyenhung@gmail.com                              # @
@ ################################################################# @
\*==============================(^_^)==============================*/

//checking to see if user has NS or IE 
IE = (document.all)?1:0 
NS = (document.layers)?1:0 
if(navigator.appVersion.charAt(0)< 4){ 
	alert("sorry your browser isn't able to read this page") 
	history.go(-1) 
} 

function writeText(objname, stra){
	if(IE){ objname.innerHTML=(stra); } 
	else if(NS){ 
		document.objname.document.write(stra); 	
		document.objname.document.close() ;
	}
}

//				<div id="theone" style="display:none">		block
function displayObj(layername, property) {
	layer = window.document.getElementById(layername);
		layer.style.display = property;

}

function showHide(layername){
	obj =  window.document.getElementById(layername);
	if (obj.style.display == "block")
		obj.style.display = "none";
	else
		obj.style.display = "block";
}

function show(objname, status){
	obj = document.getElementById(objname);		
	if(obj!=null && obj!= "underfind"){
		if (status == 1) {
			// Show the obj
			obj.style.visibility = "visible";
			obj.style.position = "relative";
			obj.style.top = "0";
			obj.style.left = "0";	
		} else {
			// Hide the obj
			obj.style.visibility = "hidden";
			obj.style.position = "absolute";
			obj.style.top = "-10000";
			obj.style.left = "-10000";
		}
	}
}
//style="visibility:hidden;position:absolute;top:-10000;left:-10000;";
function Toggle(objname) {
	obj = document.getElementById(objname);		
	if (obj.style.visibility == "hidden") {
		// Show the obj
		obj.style.visibility = "visible";
		obj.style.position = "relative";
		obj.style.top = "0";
		obj.style.left = "0";	
	} else {
		// Hide the obj
		obj.style.visibility = "hidden";
		obj.style.position = "absolute";
		obj.style.top = "-10000";
		obj.style.left = "-10000";
	}	
 }
  


function errorFound(obj,msg){
     if(msg)alert(msg);
     obj.focus();	 
	 if (obj.type.toString().charAt(0) != "s"){
	     obj.style.backgroundColor="#ff6666";
	}
	if (obj.type=="text")
		obj.select();
     obj.onclick=mkwhite;
     obj.onkeydown=mkwhite;
//     obj.onblur=mkwhite;     
     return false;
}
function mkwhite(){this.style.backgroundColor="ffffff";}