function validate_ph(form){

	var false_string = "ừứựửữưểễềếệêĩìíịõỏòóọảàãạáũụúùỗồốộổôơớờỡởợýỳỹỷỵ!@#$%^&,' '*()+={[}]'?/.;";
	var the_char=" ";

	for(loop=0;loop<false_string.length;loop++){
	the_char=false_string.charAt(loop);
//-----------------------------------------------------------------
	if(form.ten.value.length == 0) { 
		alert("Chưa nhập Họ và tên !");
		form.ten.focus();
		return false;
	}
	}
//----------------------------------------------------------------
	if(form.email_ph.value.length==0) {
		alert("Chưa nhập địa chỉ Email");
		form.email_ph.focus();
		return false;
	}
	
	var the_char=form.email_ph.value.indexOf("@");

	if((the_char!=-1) && 
	(the_char!=0)
	){
    
    	} else{
 		alert("E-mail nhập sai quy cách!");
		form.email_ph.focus();
	 	return false;
	}
	if(form.tieude.value.length == 0) { 
		alert("Chưa nhập tiêu đề !");
		form.tieude.focus();
		return false;
	}
	if(form.noidung.value.length == 0) { 
		alert("Chưa nhập nội dung phản hồi !");
		form.noidung.focus();
		return false;
	}
	if(form.maso2.value.length == 0) { 
		alert("Hay nhap vao ma xac nhan !");
		form.maso2.focus();
		return false;
	}
	if (form.maso2.value != form.orderID.value) {
		window.alert("Ma so xac nhan chua dung !");
		form.maso2.focus();
		return false;
	}
	
} 
function validate_gm(form){

	var false_string = "ừứựửữưểễềếệêĩìíịõỏòóọảàãạáũụúùỗồốộổôơớờỡởợýỳỹỷỵ!@#$%^&,' '*()+={[}]'?/.;";
	var the_char=" ";

	for(loop=0;loop<false_string.length;loop++){
	the_char=false_string.charAt(loop);
//-----------------------------------------------------------------
	if(form.ten_ng.value.length == 0) { 
		alert("Chưa nhập Họ và tên !");
		form.ten_ng.focus();
		return false;
	}
	}
//----------------------------------------------------------------
	if(form.email_ng.value.length==0) {
		alert("Chưa nhập địa chỉ Email của bạn");
		form.email_ng.focus();
		return false;
	}
	
	var the_char=form.email_ng.value.indexOf("@");

	if((the_char!=-1) && 
	(the_char!=0)
	){
    
    	} else{
 		alert("E-mail của bạn nhập sai quy cách!");
		form.email_ng.focus();
	 	return false;
	}
	if(form.email_nn.value.length==0) {
		alert("Chưa nhập địa chỉ Email gởi đến");
		form.email_nn.focus();
		return false;
	}
	
	var the_char=form.email_nn.value.indexOf("@");

	if((the_char!=-1) && 
	(the_char!=0)
	){
    
    	} else{
 		alert("E-mail gởi đến nhập sai quy cách!");
		form.email_nn.focus();
	 	return false;
	}
	if(form.tieude.value.length == 0) { 
		alert("Chưa nhập tiêu đề !");
		form.tieude.focus();
		return false;
	}
	if(form.noidung.value.length == 0) { 
		alert("Chưa nhập nội dung phản hồi !");
		form.noidung.focus();
		return false;
	}
	if(form.maso2.value.length == 0) { 
		alert("Hay nhap vao ma xac nhan !");
		form.maso2.focus();
		return false;
	}
	if (form.maso2.value != form.orderID.value) {
		window.alert("Ma so xac nhan chua dung !");
		form.maso2.focus();
		return false;
	}
	
} 
function show_hide(obj,is_close,element) {
	var hideshow = document.getElementById(obj);
	if (is_close) {
		document.getElementById(obj).style.display = 'none';
	}
	else {
		if(hideshow.style.display != "none") {
			hideshow.style.display = "none";
			document.getElementById(element).innerHTML = '<img src="img/Maximize.gif" width="15" height="15" alt="Mở rộng" border="0" title="Mở rộng" />';
		}
		else {
			hideshow.style.display = "block";
			document.getElementById(element).innerHTML = '<img src="img/Minimize.gif" width="15" height="15" alt="Thu nhỏ" border="0" title="Thu nhỏ" />';
		}
	}
	return false;
}

function show_hide_ajax(obj,is_close,element,str1,str2,img,url,pars) {
	var str1, str2, img, url, divMain;
	var hideshow = document.getElementById(obj);
	if (is_close) {
		document.getElementById(obj).style.display = 'none';
	}
	else {
		if(hideshow.style.display != "none") {
			hideshow.style.display = "none";
			document.getElementById(element).innerHTML = '<img src="'+img+'/open.png" class="png" alt="'+str1+'" border="0" title="'+str1+'" align="absmiddle" /> ';
			//StatusClick('none','',obj,'');
		}
		else {
			hideshow.style.display = "block";
			document.getElementById(element).innerHTML = '<img src="'+img+'/close.png" class="png" alt="'+str2+'" border="0" title="'+str2+'" align="absmiddle" /> ';
			StatusClick(url,pars,obj,'');
			if (url == 'tygia') {refreshquotes();}
		}
	}
	return false;
}

function openurl(url,w,h,title){
	
	var url, title, w, h;
	var xwidth = w;	
	var xheight = h;
	var left = (screen.availWidth - xwidth) / 2 ;
	var top = ((screen.availHeight - xheight)-50) / 2 ;
	var windowOptions = 'history=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=no,width='+w+',height='+h+',left='+left+',top='+top;
	window.open(url, title, windowOptions);
	
	
	
}