/*
function disableselect(e)
{
	return false
}

function reEnable()
{
	return true
}

var userAgent = navigator.userAgent;
var isFirefox = ( userAgent != null && userAgent.indexOf( "Firefox/" ) != -1 );

if( !isFirefox )
{ 
	document.onselectstart=new Function ("return false")
}
*/

function listBus(str) 
{
	document.form_list.ClassId.value = str;
	document.form_list.action = "YP_VSearchBus.asp" 
	document.form_list.submit();
}

function findSub(strMode) 
{
	document.form_list.Mode.value = strMode;
	document.form_list.action = "YP_VSearchBus.asp"
	document.form_list.submit();
}

////
function  Search(strFlag) {
	document.frmSearch.ClassId.value = ""
var temp = document.frmSearch.Keywords.value;    
var i = document.frmSearch.Keywords.value.length;
var j;
var flag=0;
for (j=0;j<i;j++)
{
	if(temp.charAt(j) == " ")
		flag=flag+1;
}
if(flag!=i){
 return true;
}
else{
	if (strFlag == "YP")
		alert("Vui long nhap noi dung can tim !");
		
	else
		alert("Vui long cung cap ten thue bao dien thoai !");
		
	document.frmSearch.Keywords.value = "";
	document.frmSearch.Keywords.focus();
	return false;
}	
}
////


////
function  Address() 
{
	var temp = document.frmDetail.Street.value;    
	var temp1 = document.frmDetail.District.value; 
	var temp3 = document.frmDetail.Home.value; 
	var temp4 = document.frmDetail.Quarter.value; 
	var temp5 = document.frmDetail.vitri.value; 
	var i = temp.length;
	var k = temp1.length;
	var dem = 0;
	

//	var l = document.frmDetail.Home.value.length;
//Phai cho 2 trong 4 dieu kien
	if (LaKhoangTrang(temp) == false )
	{
		dem = dem + 1;
	}



	if (LaKhoangTrang(temp3) == false )
	{
		dem = dem + 1;
	}

	if (LaKhoangTrang(temp4) == false )
	{
		dem = dem + 1;
	}

	if (LaKhoangTrang(temp5) == false )
	{
		dem = dem + 1;
	}


	if(temp1 + "" != "0")
	{
		dem = dem + 1;
	}

	if(dem < 2)
	{
		alert("Vui long nhap it nhat 2 dieu kien de tim kiem !");
		document.frmDetail.Home.focus();
		return false;
	}	

}


////

function  Address_1() 
{
	var temp = document.frmDetail_2.Street.value;    
	var temp1 = document.frmDetail_2.District.value; 
	var temp3 = document.frmDetail_2.Home.value; 
	var temp4 = document.frmDetail_2.Quarter.value; 
	var temp5 = document.frmDetail_2.vitri.value; 
	var i = temp.length;
	var k = temp1.length;
	var dem = 0;
	

//	var l = document.frmDetail_2.Home.value.length;
//Phai cho 2 trong 4 dieu kien
	if (LaKhoangTrang(temp) == false )
	{
		dem = dem + 1;
	}


	if (LaKhoangTrang(temp3) == false )
	{
		dem = dem + 1;
	}

	if (LaKhoangTrang(temp4) == false )
	{
		dem = dem + 1;
	}

	if (LaKhoangTrang(temp5) == false )
	{
		dem = dem + 1;
	}


	if(temp1 + "" != "0")
	{
		dem = dem + 1;
	}

	if(dem < 2)
	{
		alert("Vui long nhap it nhat 2 dieu kien de tim kiem !");
		document.frmDetail_2.Home.focus();
		return false;
	}	

}

function Detail() {
	if(document.frmDetail.Phone.value.length == 0)
	{
		alert("Vui long nhap so dien thoai");
		document.frmDetail.Phone.focus();
		return false;
	}

	if(isNaN(document.frmDetail.Phone.value))
	{
		alert("So dien thoai la mot so [0-9]");
		document.frmDetail.Phone.focus();
		return false;
	}
	
	var socode;
	
	socode = document.getElementById("code")

    
    if (socode) 
    {
        if (socode.value == "")
        {
            alert("Vui long nhap so an toan !");
            socode.focus();
            return false;
        }
    }
    
	return true;
}

///////
function searchGoogle(str)
{
	document.form_google.q.value = str;
	document.form_google.target="_blank";
	document.form_google.submit();
}

function result(i)
{
	document.form_list.pageNo.value = i;
	document.form_list.submit();
}

function StartNameClick(str) {
	document.form_list.first.value = str;
    document.form_list.pageNo.value = 0;
	document.form_list.submit();
}

function sortMode(i)
{
	document.form_list.Sorts.value = i;
	document.form_list.pageNo.value = 0;
	document.form_list.first.value = "";
	document.form_list.submit();
}

function FindMode(i)
{
	document.form_list.cbocachtim.value = i;
	document.form_list.Sorts.value = 0;
	document.form_list.pageNo.value = 0;
	document.form_list.first.value = "";
	document.form_list.submit();
}


function searchMode(str)
{
	document.form_list.Mode.value = str;
	document.form_list.pageNo.value = 0;
	document.form_list.first.value = "";	
	document.form_list.submit();
}

var popUpWin=0;


function popUpWindow1(URLStr, left, top, width, height, cSubcriberId,ClassId, iprovinceid)
{
  var bienthu
  bienthu = URLStr
  bienthu = bienthu.replace("yp_vbusinfo.asp","yp_vbussinfo.asp");

  if(popUpWin) 
  {
     if(!popUpWin.closed) popUpWin.close();
  }

//  popUpWin = open(bienthu, 'popUpWin', 'directories=no,toolbar=no,scrollbars=yes,dependent=yes, noresize=no,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');	
  	if (cSubcriberId.length > 0 && ClassId.length > 0 )
	{
		popUpWin = open('yp_vbusinfo.asp', 'popUpWin', 'directories=no,toolbar=no,scrollbars=yes,dependent=yes, noresize=no,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');	
		document.bussinfo.action = bienthu;
		document.bussinfo.ClassId.value = ClassId;
		document.bussinfo.cSubcriberId.value = cSubcriberId;
		document.bussinfo.mau.value = iprovinceid;
		document.bussinfo.submit();
	}
	else
	{
		popUpWin = open(URLStr, 'popUpWin', 'directories=no,toolbar=no,scrollbars=yes,dependent=yes, noresize=no,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');	
		
	}
}

function xemchitiet(cSubcriberId,ClassId, iprovinceid,iorder)
{
	document.bussinfo.ClassId.value = ClassId;
	document.bussinfo.cSubcriberId.value = cSubcriberId;
	document.bussinfo.mau.value = iprovinceid;
	document.bussinfo.submit();
}

function quayve()
{
	document.form_list.submit();
}

function popUpWindow(URLStr, left, top, width, height, cSubcriberId,ClassId)
{
  var bienthu
  bienthu = URLStr
  bienthu = bienthu.replace("yp_vbusinfo.asp","yp_vbussinfo.asp");

  if(popUpWin) 
  {
     if(!popUpWin.closed) popUpWin.close();
  }

//  popUpWin = open(bienthu, 'popUpWin', 'directories=no,toolbar=no,scrollbars=yes,dependent=yes, noresize=no,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');	
  	if (cSubcriberId.length > 0 && ClassId.length > 0 )
	{
		popUpWin = open('yp_vbusinfo.asp', 'popUpWin', 'directories=no,toolbar=no,scrollbars=yes,dependent=yes, noresize=no,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');	
		document.bussinfo.action = bienthu;
		document.bussinfo.ClassId.value = ClassId;
		document.bussinfo.cSubcriberId.value = cSubcriberId;
		document.bussinfo.submit();
	}
	else
	{
		popUpWin = open(URLStr, 'popUpWin', 'directories=no,toolbar=no,scrollbars=yes,dependent=yes, noresize=no,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');	
		
	}
}

function OpenWindowSP(URLStr, left, top, width, height, cSubcriberId,ClassId)
{
  var bienthu
  bienthu = URLStr

  if(popUpWin) 
  {
     if(!popUpWin.closed) popUpWin.close();
  }

//  popUpWin = open(bienthu, 'popUpWin', 'directories=no,toolbar=no,scrollbars=yes,dependent=yes, noresize=no,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');	
//  	if (cSubcriberId.length > 0 && ClassId.length > 0 )
//	{
//		popUpWin = open('yp_vbusinfo.asp', 'popUpWin', 'width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');	
//		popUpWin = open(URLStr, 'popUpWin', '');	
//		document.bussinfo.action = bienthu;
//		document.bussinfo.target = "popUpWin";
//		document.bussinfo.ClassId.value = ClassId;
//		document.bussinfo.cSubcriberId.value = cSubcriberId;
//		document.bussinfo.submit();
// 	}
//	else
//	{
//		popUpWin = open(URLStr, 'popUpWin', 'width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');	
		popUpWin = open(URLStr, 'popUpWin', '');	
//	}
}


function OpenWindow(URLStr, left, top, width, height, cSubcriberId,ClassId)
{
  var bienthu
  bienthu = URLStr
  bienthu = bienthu.replace("yp_vbusinfo.asp","yp_vbussinfo.asp");

  if(popUpWin) 
  {
     if(!popUpWin.closed) popUpWin.close();
  }

//  popUpWin = open(bienthu, 'popUpWin', 'directories=no,toolbar=no,scrollbars=yes,dependent=yes, noresize=no,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');	
  	if (cSubcriberId.length > 0 && ClassId.length > 0 )
	{
//		popUpWin = open('yp_vbusinfo.asp', 'popUpWin', 'width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');	
		popUpWin = open(URLStr, 'popUpWin', '');	
		document.bussinfo.action = bienthu;
		document.bussinfo.target = "popUpWin";
		document.bussinfo.ClassId.value = ClassId;
		document.bussinfo.cSubcriberId.value = cSubcriberId;
		document.bussinfo.submit();
	}
	else
	{
//		popUpWin = open(URLStr, 'popUpWin', 'width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');	
		popUpWin = open(URLStr, 'popUpWin', '');	
	}
}

