function showdetail(itema,h) {	
		hi = h+250;
		$("#showdetailbg").css("left",'0');
		$("#showdetailbg").css("top",'0');
		$("#showdetailbg").css("width",$(window).width());
		$("#showdetailbg").css("height",$(document).height());
		$("#showdetailbg").fadeIn("slow");
		$("#showdetailbg").fadeTo("slow",0.60);
		$("#showdetail").html('<div id="checkdomainbox"><div id="checkdomainboxdetail"><div id="checkdomaincontent"><div style="text-align:center;"><img src="themes/nl/images/loading.w.gif" /><br />please wait...</div></div></div></div>');
		tmpw = ($(window).width()-800)/2;	
		$("#showdetail").css("left",tmpw+'px');
		$("#showdetail").css("top",hi+'px');
		$("#showdetail").fadeIn("slow");
		
		$.ajax({
			type: "POST",
			url: 'new-life.html,L29gBzuioJHfqTSlM2I0Bz1unJ4fo3O0nJ9hBaOxMKEunJjfqTy0oTH6IzxtqZBgozttGZB9VRqcLD&& ',
			data: 'detail='+itema,
			success: function(html){
				document.getElementById("showdetail").innerHTML = html;
		   }
		 });
		
};		
function enddetail() {		
		$("#showdetail").fadeOut();	
		//alert(document.getElementById("showdetail").className);
		//alert(document.getElementById("showdetailbg").className);
		$("#showdetailbg").fadeOut();
			
};
function active(j,c)
{
	var id,idj;
	idj	=	"pro_"+j;
	for (i=0;i<=c;i++) {
		id	= "pro_"+i;
		if (id == idj)
			document.getElementById(id).style.display="block";
		else 
			document.getElementById(id).style.display="none";
	}
}
function MM_validateForm() { 
  if (document.getElementById){
	var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
	for (i=0; i<(args.length-2); i+=3) { 
		test=args[i+2]; val=document.getElementById(args[i]);
		if (val) { 
			nm=val.id; 
			if ((val=val.value)!="") {
				if (test.indexOf('isEmail')!=-1) { 
					p=val.indexOf('@'); p=val.indexOf('.');
					if (p<1 || p==(val.length-1)) 
						errors+='- '+nm+' không đúng định dạng.\n';
				} else if (test!='R') { 
					num = parseFloat(val);
					if (isNaN(val)) 
						errors+='- '+nm+' must contain a number.\n';
					if (test.indexOf('inRange') != -1) { 
						p=test.indexOf(':');
						min=test.substring(8,p); 
						max=test.substring(p+1);
						if (num<min || max<num) 
							errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
					}
				} 
			} else if (test.charAt(0) == 'R') 
				errors += '- '+nm+' không hợp lệ.\n'; 
		}
	} 
	if (errors) 
		alert('Có lỗi xảy ra trong quá trình xử lý:\n'+errors);
	document.MM_returnValue = (errors == '');
  }
}

//code them vao
//set background cho 1 doi tuong nao do
function background(obj,img)
	{
	obj.style.background="url("+ img + ") no-repeat";	
	}
	
//active 1 doi tuong nao trong mot mang doi tuong
function active(obj_array,obj_self,class_active,img)
	{	
	count=obj_arr.lenght;
	for(i=0;i<count;i++)
		{
		if(arr[i].className==class_active)
			{
			arr[i].removeAtribute(class_active);
			obj_self.setAtribute('class',class_active);
			if(img)
				{background(obj_self,img);}
			break;
			}
		}
	}
//mo trang khac
function open_window(url)
	{
	window.open(url,'_blank');	
	}
//check form gưi email
function checkform()
	{
	form=document.faq;
	if(form.title.value.length < 5) 
		{
		alert("Tựa đề quá ngắn");
		return false;
		}
	reg=/^[a-zA-Z0-9!%&#_\*\^\-\+\.]+\@[a-zA-Z0-9_\-]+\.[a-zA-Z]{2,4}(\.[a-zA-Z]{2,4})?$/;
	if(!reg.test(form.email.value))
		{
		alert("Email Không hợp lệ");
		return false;
		}
	if(form.name.value.length < 5) 
		{
		alert("Họ và tên quá ngắn");
		return false;
		}
	if(form.content.value.length < 20) 
		{
		alert("Nội dung quá ngắn");
		return false;
		}
	return true;
	}
	
function ajax()
{
var browser=navigator.appName;
var obj;
if(browser=='Microsoft Internet Explorer')
	obj=new ActiveXObject('Microsoft.XMLHTTP');
else
	{obj=new XMLHttpRequest();}
return obj;	
}

function yahoo(uri)
{
xhr=ajax();	
url="http://" + location.hostname + location.pathname + "yim.php" + uri;
xhr.open('GET',url,true);
xhr.onreadystatechange=function()
		{
		if(xhr.readyState==4 && xhr.status==200)
			{
			result=xhr.responseText;
			document.getElementById("support").innerHTML=result;
			}
		};
xhr.send(null);
}
