/* show the hidden div
*@fatherID: the div append the sub div
*@childID: the sub div needs showing behind main div
*/
function ShowMenu(fatherID, childID) {

	var subID = document.getElementById(childID);
	var mainID = document.getElementById(fatherID);

	if(subID.style.visibility == "hidden"){
	
		subID.style.visibility="visible";
		subID.style.display="block";
		mainID.appendChild(subID);
		
	} else {
	
		subID.style.visibility="hidden";
		subID.style.display="none";
		
	}

}

/* select the single radio button
*@radioID: radio ID
*@formObj: form name
*/
function getCheckedValue(formObj, radioID, actionPage){

	var formObj = document.getElementById(formObj);	
		
	var radioObj = formObj.elements[radioID];

	for (var i=0; i < radioObj.length; i++)
   	{

   		if (radioObj[i].checked)
      	{
      	
      		var rad_val = radioObj[i].value;

      	}
   	}

	formObj.action = actionPage;
	//formObj.submit();
}

function email(address,department)
{
var ref
ref=("email.php?branch=" +address + "&department=" + department)
Email = window.open(ref,"Email","toolbar=no,status=no,menubar=no,location=no,scrollbars=no,resizable=no,height=390,width=416");Email.opener = top;
}

function popUpPage(address,title){

	var ref
	ref=(address);

	popup = window.open(ref,title,"toolbar=no,status=no,menubar=no,location=no,scrollbars=yes,resizable=no,height=650,width=820");
	
	popup.opener = top;
	
}

function signInEmail(ref){

	ref.target='Sign In Email';
	popup = window.open('',ref.target,"toolbar=no,status=no,menubar=no,location=no,scrollbars=yes,resizable=no,height=650,width=820");
	
	ref.submit();
	return false;
	
}

function emailUs_product(subject,branch,department)
{

	var ref
	ref= "email_products.php?Subject=" +subject+"&branch="+branch + "&department=" + department;
	Email = window.open(ref,"Email","toolbar=no,status=no,menubar=no,location=no,scrollbars=no,resizable=no,height=385px,left=150px,top=100px,width=495px");			    Email.opener = top;
}
