<!--
var DHTML = (document.getElementById || document.all || document.layers);

function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

function mOvr(src) {
	if (!src.contains(event.fromElement)) {
		src.style.cursor 	= 'hand';
		//src.style.fontStyle = 'italic';
		src.style.color  = '#cc6666';
	}

}
function mOut(src) {
	if (!src.contains(event.toElement)) {
		src.style.cursor = 'default';
		//src.style.fontStyle = 'normal';
		src.style.color  = '#0b305c';
	}
}

function showItem(id_show)
{
	if (!DHTML) return;
	var x = document.getElementsByTagName('div');
	var sobject = new getObj(id_show);
	var temp	= sobject.style.display;
	for (var i=0;i<x.length;i++)
	{

		if (x[i].className == 'sub-menu')
			x[i].style.display = 'none';
	}
	sobject.style.display = temp;
	var OStatus = (sobject.style.display == 'none') ? 'block' : 'none';
	sobject.style.display = OStatus;
}


function search_all_modules(the_form){
	var module_url	= the_form.smodule.options[the_form.smodule.selectedIndex].value;
	if ( module_url != ""){
		the_form.action	= module_url;
		return true;
	}
	alert("Vui lòng chọn trang cần tìm !");
	return false;
}

function search_hospital_modules(){	
	var the_form = window.document.LIST_HOSPITAL;	
	var module_url	= the_form.smodule_hospital.options[the_form.smodule_hospital.selectedIndex].value;	
	if ( module_url != ""){		
		the_form.action	= module_url;
		the_form.submit();	
		return true;
	}
	alert("Vui lòng chọn bệnh viện phòng khám cần tìm !");
	return false;
}

function search_hospital_other_modules(){	
	var the_form = window.document.LIST_HOSPITAL_OTHER;	
	var module_url	= the_form.smodule_other.options[the_form.smodule_other.selectedIndex].value;	
	if ( module_url != ""){		
		the_form.action	= module_url;
		the_form.submit();	
		return true;
	}
	alert("Vui lòng chọn bệnh viện phòng khám cần tìm !");
	return false;
}


//Open normal popup
function showme(the_url, the_width, the_height, the_menu) {
	if ( the_width == 0 ){
		the_width	= screen.width;
	}
	if ( the_height == 0 ){
		the_height	= screen.height;
	}

	left_val	= (the_width > 0) ? (screen.width - the_width)/2 : 0;
	top_val		= (the_height > 0) ? (screen.height - the_height)/2 - 30 : 0;
	if (top_val < 0){ top_val	= 0; }
	if (the_menu == ""){ the_menu	= "no";	}

	window.open(the_url, "", "menubar="+ the_menu +", toolbar="+ the_menu +", scrollbars=yes, resizable=yes, width="+ the_width +", height="+ the_height +", top="+ top_val +", left="+ left_val);
}

//Open popup when users submit form
function open_popup_form(the_url, targetName, the_width, the_height){
	left_val	= (the_width > 0) ? (screen.width - the_width)/2 : 0;
	top_val		= (the_height > 0) ? (screen.height - the_height)/2 - 30 : 0;
	if (top_val < 0){ top_val	= 0; }

	window.open(the_url, targetName, "menubar=no, toolbar=no, scrollbars=yes, resizable=yes, width="+ the_width +", height="+ the_height +", top="+ top_val +", left="+ left_val);
}

//Check and open popup when use chose web links
function weblink_openURL(the_url){
	if ( the_url != "" ){
		window.open(the_url);
	}
}

function select_list(the_value, the_list){
	var option_count = the_list.options.length;	
	for (i=0; i<option_count; i++){
		if (the_value == the_list.options[i].value){
			the_list.options[i].selected	= true;
			break;
		}
	}
}

function radio_list(the_value,the_list){
	var name_count = the_list.length;	
	for (i=0; i<name_count; i++){
		if (the_value == the_list[i].value){
			the_list[i].checked	= true;
			break;
		}
	}
}


function cart_update(){
	window.document.CARTFORM.submit();
}
function cart_check_login_form(the_form) {
	if ( (the_form.email.value == "") || (the_form.password.value == "") ){
		alert("Xin quý khách vui lòng nhập email và mật khẩu.")
		return false;
	}
	return true;
}
function cart_check_reg_form(the_form) {
	if ( (the_form.fullname.value == "") || (the_form.address.value == "") || (the_form.phone.value == "") || (the_form.email.value == "") ){
		alert("Xin quý khách vui lòng nhập đầy đủ thông tin yêu cầu.\n\nChú ý: các thông tin có dấu \"*\" là bắt buột.")
		return false;
	}
	return true;
}
function cart_edit_order(the_url){
	var the_form	= window.document.VERIFYFORM;
	the_form.action	= the_url;
	the_form.submit();
}
function cart_copy_shipping_info(the_form){
	if ( the_form.shipping_copy.checked ){
		the_form.shipping_fullname.value	= the_form.fullname.value;
		the_form.shipping_company.value		= the_form.company.value;
		the_form.shipping_address.value		= the_form.address.value;
		the_form.shipping_phone.value		= the_form.phone.value;

		the_form.shipping_fullname.disabled	= true;
		the_form.shipping_company.disabled	= true;
		the_form.shipping_address.disabled	= true;
		the_form.shipping_phone.disabled	= true;
	}
	else{
		the_form.shipping_fullname.disabled	= false;
		the_form.shipping_company.disabled	= false;
		the_form.shipping_address.disabled	= false;
		the_form.shipping_phone.disabled	= false;
	}
}

 function alert_mess(){
 	alert('Sản phẩm này sẽ được giới thiệu trong thời gian sớm nhất.');
 }
 
function check_search(){
	var the_form	= window.document.SEARCHAV;	
	if(the_form.skeyword.value=="Quick search"){
		alert("Please, enter your key word !");		
		the_form.skeyword.focus();
		return false;
	}
	return true;
}

function checkSearchForm(the_form){	
	if(parseInt(the_form.sprice_from.value) >parseInt(the_form.sprice_to.value)){
	  alert('Ô giá từ không được lớn hơn ô giá đến');
	  return false;	
	}
	return true;	
}

function changeCurrency(value){
						var array1 = '|1~3 triệu|2~5 triệu|3~10 triệu|4~15 triệu|5~20 triệu|6~40 triệu|7~60 triệu|8~80 triệu|9~100 triệu|10~500 triệu|11~1,2 tỷ|12~2 tỷ|13~3 tỷ|14~5 tỷ|15~Trên 5 tỷ|';
						var array2 = '|1~200 USD|2~300 USD|3~400 USD|4~500 USD|5~600 USD|6~700 USD|7~800 USD|8~900 USD|9~1000 USD|10~3000 USD|11~5000 USD|12~7000 USD|13~9000 USD|14~10.000 USD|15~Trên 10.000 USD|';
						var array3 = '|1~200 Lượng|2~300 Lượng|3~400 Lượng|4~500 Lượng|5~600 Lượng|6~700 Lượng|7~800 Lượng|8~900 Lượng|9~1000 Lượng|10~Trên 1000 Lượng|';
											
						switch(value){
							case "VND" : arrchild = array1.split("|");
									   arrchild2 = array1.split("|");
									   break;
							case "USD" : arrchild = array2.split("|");
									   arrchild2 = array2.split("|");
									   break;
							case "SJC" : arrchild = array3.split("|");
									   arrchild2 = array3.split("|");
									   break;
							default  : arrchild = array1.split("|");
									   arrchild2 = array1.split("|");
									   break;
						}						
						
						
						// price from						
						var x = 0;
						theform.sprice_from.length=0;
						theform.sprice_from.options[x] = new Option("Giá từ", "0");
						x++;
	
						for (i = 0; i< arrchild.length; i++)
						{
							arrTemp = arrchild[i].split("~");
							if (arrTemp[0]) 
							{			
								theform.sprice_from.options[x] = new Option(arrTemp[1], arrTemp[0]);
								x++;
							}
						}
						
						// price to
						var x = 0;
						theform.sprice_to.length=0;
						theform.sprice_to.options[x] = new Option("- đến", "0");
						x++;
	
						for (i = 0; i< arrchild2.length; i++)
						{
							arrTemp = arrchild2[i].split("~");
							if (arrTemp[0]) 
							{			
								theform.sprice_to.options[x] = new Option(arrTemp[1], arrTemp[0]);
								x++;
							}
						}
					}
-->	
