// JavaScript Document
//biencoder
function ajaxRequest(){
			 var activexmodes=["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
			 if (window.ActiveXObject){ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
			  for (var i=0; i<activexmodes.length; i++){
			   try{
				return new ActiveXObject(activexmodes[i])
			   }
			   catch(e){
				//suppress error
			   }
			  }
			 }
			 else if (window.XMLHttpRequest) // if Mozilla, Safari etc
			  return new XMLHttpRequest()
			 else
			  return false
	}
function thietbi_all_mouse(){
	document.getElementById('dtsp').onmousemove=function(){
		this.className ='dtsp_hover'
	} 
	document.getElementById('dtsp').onmouseout=function(){
		this.className ='dtsp'
	}
	document.getElementById('dtsp').onclick=function(){
		document.getElementById('tskt_hidden').style.display='none'
		document.getElementById('dtsp_hidden').style.display=''
	} 

	document.getElementById('tskt').onmousemove=function(){
		this.className ='tskt_hover'
	} 
	document.getElementById('tskt').onmouseout=function(){
		this.className ='tskt'
	}
	document.getElementById('tskt').onclick=function(){
		document.getElementById('tskt_hidden').style.display=''
		document.getElementById('dtsp_hidden').style.display='none'
	}
}	

function bookmark(url,title)
{
bookmarkurl=url
bookmarktitle=title
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
else if (window.sidebar) // firefox
window.sidebar.addPanel(bookmarktitle, bookmarkurl, "");
}

function demo()
{
//function demo: ham demo
   if(document.frmcontact.fullname.value==""){
	  alert('Hay nhap ho ten !');
	  document.frmcontact.fullname.focus();
	  return false;
   }
	if(!checkemail(document.frmcontact.email.value)) { alert('Email error !'); document.frmcontact.email.focus();return false;}
   if(document.frmcontact.comment.value==""){
	  alert('Hay nhap noi dung !');
	  document.frmcontact.comment.focus();
	  return false;
   }
}
function checkemail(which){
if (which.indexOf("@")!=-1&&which.indexOf(".")!=-1)
//alert("Good!")
return true
else
//alert("Quit fooling around and enter a valid email address!")
return false
}

function mypopup(url,w,h)
 {
		popUpWin = window.open(url,'','height='+w, 'width='+h,' location=no, scrollbars=yes, menubars=yes,toolbars=yes,resizable=yes', 'center=yes;');
		if (!popUpWin.opener)
		popUpWin.opener = self;
	 // mywindow1.moveTo(0,0);
 }
