﻿<script language="JavaScript"> 

                       
<!--
var xmlHttp;
function createXMLHttpRequest() {
	if (window.ActiveXObject) {
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	else if (window.XMLHttpRequest) {
		xmlHttp = new XMLHttpRequest();
	}
}

function startRequest(strUrl, strDivName, strObj) {
	createXMLHttpRequest();
	if (strObj!=null && strObj!="")
		strUrl = strUrl + document.getElementById(strObj).value;
	xmlHttp.onreadystatechange = function(){
		if(xmlHttp.readyState == 4) {
			if(xmlHttp.status == 200) {
				document.getElementById(strDivName).innerHTML = xmlHttp.responseText;
                                 window.status="[-] http://xuanmai.forever.as [-] KID 1412 [-] Y!ID : neuemhieu293 [-] Mobile : 0986.529.583 !";
                               		}
			endProcess();
		}
		else
{
				document.getElementById(strDivName).innerHTML ='<center><BR><BR><B>...Đang tải dữ liệu...<BR><BR><img src="images/load.gif"  border="0"><BR><BR>Ấn phím <font color=#FF0055>F5</font> nếu bạn đợi quá lâu...</b></center> ';
                               		}

			startProcess();
	};
	xmlHttp.open("GET",strUrl, true);
	xmlHttp.send(null);
	return false;
}

function startSearch(strDivName) {
	createXMLHttpRequest();
	window.scrollTo(0,250);
	var intFeatures = document.getElementById('cbFeatures').value;
	var strPriceFrom = document.getElementById('txtPriceFrom').value;
	var strPriceTo = document.getElementById('txtPriceTo').value;
	var blnSearchPro = document.getElementById('rSearchWhat').checked;
	var strSearchWhat;
	if (!blnSearchPro)
		strSearchWhat = "news";
	else
		strSearchWhat = "prod";

	var intCondition = document.getElementById('cbCondition').value;
	var intSearchIn;
	if (strSearchWhat=="news")
		intSearchIn = document.getElementById('cbSearchInNews').value;
	else
		intSearchIn = document.getElementById('cbSearchInPro').value;
	var strByDate = "";
	if (document.getElementById('cbMonth')!=null){	
		var intMonth = document.getElementById('cbMonth').value;
		var intDate = document.getElementById('cbDate').value;
		var intYear = document.getElementById('cbYear').value;
		strByDate = intMonth+"/"+intDate+"/"+intYear;
	}
	var intPerPage = document.getElementById('cbPerPage').value;
	var strKeyword = document.getElementById('txtKeyword').value;
	
	var strQuery = "search.asp?features="+intFeatures+"&pricefrom="+strPriceFrom+"&priceto="+strPriceTo;
		strQuery = strQuery+"&searchwhat="+strSearchWhat+"&intcondition="+intCondition+"&keyword="+strKeyword;
		strQuery = strQuery+"&searchin="+intSearchIn+"&bydate="+strByDate+"&perpage="+intPerPage;
	strUrl = strQuery;
	//alert(strUrl);
	
	xmlHttp.onreadystatechange = function(){
		if(xmlHttp.readyState == 4) {
			if(xmlHttp.status == 200) {
				document.getElementById(strDivName).innerHTML = xmlHttp.responseText;
			}
			endProcess();
		}
		else
			startProcess();
	};
	xmlHttp.open("GET",strUrl, true);
	xmlHttp.send(null);
}

function chkFrmRegMail(obj){
	if(obj.txtMailName.value=="")
	{
		alert("Bạn chưa nhập họ tên.");
		obj.txtMailName.focus();
		return false;
	}
	if(obj.txtMailAddress.value=="")
	{
		alert("Bạn chưa nhập địa chỉ email.");
		obj.txtMailAddress.focus();
		return false;
	}
	if (obj.txtMailAddress.value.indexOf('@',0)==-1 || obj.txtMailAddress.value.indexOf('.')==-1)
	{
		alert ("Địa chỉ email nhập sai quy cách.");
		obj.txtMailAddress.focus();
		return false;
	}
	return true;
}
function sconfirm(strMess,strURL){
	var yn;
	yn=window.confirm(strMess);
	if (yn==true){
		document.location.href=strURL;
		}
}
function askconf(strMess){
	var yn;
	yn=window.confirm(strMess);
	if (yn==true){
		return true;
		}
	return false;
}
function openWin(theURL,winName,features) {
  	window.open(theURL,winName,features);
}
function winopen(url){
	window.open(url);
}

function insertStr(strValue,anh){

	window.opener.document.form1[anh].value=strValue;
}

function CheckFrmContact() {
    //Initialise variables
    var errorMsg = "";
    //Check for a value
    var strHoten = document.frmContact.txtName.value;
    var strAdd = document.frmContact.txtAddress.value;
    var strTel = document.frmContact.txtTel.value;
    var strEmail = document.frmContact.txtEmail.value;
    var strSubject = document.frmContact.txtSubject.value;
    var strContent = document.frmContact.txtContent.value;
        
    if (strHoten == ''){
            errorMsg += "\n\t- Ban chua nhap Ho ten";
    }
    if (strEmail == ''){
            errorMsg += "\n\t- Ban chua nhap E-mail cua ban";
    }
    if (strSubject == ''){
            errorMsg += "\n\t- Ban chua nhap Chu de";
    }
    if (strContent == ''){
            errorMsg += "\n\t- Ban chua nhap Noi dung";
    }
    if (strContent.length > 3800){
            errorMsg += "\n\t- Noi dung khong duoc vuot qua 4000 chu.";
    }

    //If there is aproblem with the form then display an error
    if (errorMsg != ""){
            msg = "Co loi voi du lieu nhap vao cua ban.\n";
            msg += "__________________________________________________\n\n";
            msg += "Co loi o cac phan sau:\n";
            errorMsg += alert(msg + errorMsg);
//            return ("contact.asp");
    }
	else
	{
		var strQuery = "contactAct.asp?hoten="+strHoten+"&diachi="+strAdd+"&tel="+strTel+"&email="+strEmail+"&chude="+strSubject+"&noidung="+strContent;
    	startRequest(strQuery,'BodyContent','');
    }
}

function playMedia(fID,blnVideo)
{
	window.open('playMedia.asp?fID='+fID+'&blnVideo='+blnVideo,'win','height=221,width=200,scrollbars=no,menubar=no,toolbar=no')
}

function popupImage(src, note, title, css, border) {
var ppimgNW;
  if (border==null) border = 0;
  if (note==null) note = '';
  if (ppimgNW != null) ppimgNW.close();

  ppimgNW = window.open('','POPUPIMAGE','width=1,height=1');
  var doc = ppimgNW.document;
  doc.write('<html>');
  doc.write('<head>');

  if (title!=null) doc.write('<title>'+ title +'</title>');
  doc.write('<style> body {'+css+'} #ppImgText{'+ css +'} #ppImg{cursor:hand}</style></head>');
  doc.write('<body oncontextmenu="return false" leftmargin="0" topmargin="' + border + '">');
  doc.write('<div align="center">');
  doc.write('<img src="' + src + '" id="ppImg" onclick="self.close();" title="Close">');
  doc.write('</div>');
  doc.write('<div style="height:1; width:'+ border +'; font-size:4pt">');
  doc.write('</div>');
  doc.write('<div id="ppImgText" align="center">');
  doc.write('<Font face=Tahoma size=2>'+note+'</Font>');
  doc.write('</div>');
  doc.write('</body>');
  doc.write('</html>');

  doc.write('<' + 'script>');
  doc.write('var resized = false;');
  doc.write('function doResize() {');
  doc.write('  var imgW = ppImg.width, imgH = ppImg.height;');     
  if (note=='' || note==null) {addH=40} else {addH=60};
  doc.write('  window.resizeTo(imgW + 8 +' + border*2 +', imgH + ppImgText.offsetHeight + '+addH+' + '+ border*2 +');');
  doc.write('  setTimeout("doResize()",1000);');

  doc.write('}');
  doc.write('doResize(); ');
  doc.write('</' + 'script>');
}

isIE=document.all;
isNN=!document.all&&document.getElementById;
isN4=document.layers;
isHot=false;

document.onmousedown=ddInit;
document.onmouseup=Function("ddEnabled=false");

function ddInit(e){
  topDog=isIE ? "BODY" : "HTML";
  whichDog=isIE ? document.all.theLayer : document.getElementById("theLayer");  
  hotDog=isIE ? event.srcElement : e.target;  
  while (hotDog.id!="titleBar"&&hotDog.tagName!=topDog){
    hotDog=isIE ? hotDog.parentElement : hotDog.parentNode;
  }  
  if (hotDog.id=="titleBar"){
    offsetx=isIE ? event.clientX : e.clientX;
    offsety=isIE ? event.clientY : e.clientY;
    nowX=parseInt(whichDog.style.left);
    nowY=parseInt(whichDog.style.top);
    ddEnabled=true;
    document.onmousemove=dd;
  }
}

function dd(e){
  if (!ddEnabled) return;
  whichDog.style.left=isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx; 
  whichDog.style.top=isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety;
  return false;  
}

function ddN4(whatDog){
  if (!isN4) return;
  N4=eval(whatDog);
  N4.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
  N4.onmousedown=function(e){
    N4.captureEvents(Event.MOUSEMOVE);
    N4x=e.x;
    N4y=e.y;
  }
  N4.onmousemove=function(e){
    if (isHot){
      N4.moveBy(e.x-N4x,e.y-N4y);
      return false;
    }
  }
  N4.onmouseup=function(){
    N4.releaseEvents(Event.MOUSEMOVE);
  }
}

function moveCenter()
{
	obj = document.getElementById("theLayer");
	obj.style.left=(document.body.scrollLeft+parseInt((document.body.clientWidth-350)/2))+"px";
	obj.style.top=(document.body.scrollTop+parseInt((document.body.clientHeight-250)/2))+"px";

}
function show_hide()
{
	if (isIE||isNN)
	{
		if (whichDog.style.visibility=="hidden")
		{
			whichDog.style.visibility="visible";
			moveCenter();
		}
		else
		{
			whichDog.style.visibility="hidden";
		}
	}
	else if (isN4)
	{
		if (document.theLayer.visibility=="hide")
		{		
			document.theLayer.visibility="show";
			moveCenter();
		}
		else
		{
			document.theLayer.visibility="hide";
		}
	}
}

function zoomImg(obj,intType)
{
	var wObj = document.getElementById(obj);
	if(intType==0)
		objW = eval(wObj.width - 50);
	else
		objW = eval(wObj.width + 50);
	//alert(objW);
	wObj.width = objW;
}

function Menu_boi(){
	if(document.all.Menu_boi.style.display == "none"){
		document.all.Menu_boi.style.display = "block";
	}else{
		document.all.Menu_boi.style.display = "none";
	}
}
                      
function dangki(){
	if(document.all.dangki.style.display == "none"){
		document.all.dangki.style.display = "block";
	}else{
		document.all.dangki.style.display = "none";
	}
}
function Menu_HelpDownload_sk4(){
	if(document.all.Menu_HelpDownload_sk4.style.display == "none"){
		document.all.Menu_HelpDownload_sk4.style.display = "block";
	}else{
		document.all.Menu_HelpDownload_sk4.style.display = "none";
	}
}
function report(){
	if(document.all.report.style.display == "none"){
		document.all.report.style.display = "block";

	}else{
		document.all.report.style.display = "none";

	}
}
function lyrics(){
	if(document.all.lyrics.style.display == "none"){
		document.all.lyrics.style.display = "block";
	}else{
		document.all.lyrics.style.display = "none";
	}
}


		
		function checkChat()
{
     var	HOTEN=shoutbox.Chatname.value
	if (HOTEN=="")
	{
		alert("Bạn chưa nhập họ tên !")
		shoutbox.Chatname.focus()
		return false
	}
     
     var	EMAIL=shoutbox.Chatemail.value
     re=/\w+@\w+\.\w+/;
	if (EMAIL=="")
	{
		alert("Bạn chưa nhập e-mail !")
		shoutbox.Chatemail.focus()
		return false
	}
		else if(re.test(EMAIL)==false)
	{
			alert("Email sai định dạng!")						
		shoutbox.Chatemail.focus()
			return false
	}
	
     var NOIDUNG=shoutbox.noidung.value
	if (NOIDUNG=="")
	{
		alert("Bạn chưa nhập nội dung !")
		shoutbox.noidung.focus()
		return false
	}
    

	return true
}


function checkLienHe()
{
     var	HOTEN=lienhe.LHname.value
	if (HOTEN=="")
	{
		alert("Bạn chưa nhập họ tên !")
		lienhe.LHname.focus()
		return false
	}
     
     var	EMAIL=lienhe.LHemail.value
     re=/\w+@\w+\.\w+/;
	if (EMAIL=="")
	{
		alert("Bạn chưa nhập e-mail !")
		lienhe.LHemail.focus()
		return false
	}
		else if(re.test(EMAIL)==false)
	{
			alert("Email sai định dạng!")						
		lienhe.LHemail.focus()
			return false
	}
	
     var NOIDUNG=lienhe.LHnoidung.value
	if (NOIDUNG=="")
	{
		alert("Bạn chưa nhập nội dung !")
		lienhe.LHnoidung.focus()
		return false
	}
    

	return true
}
		
//-->




