window.history.go(1);
function SetMenu(actMnu){
	//hidden all layer ##################################
	$("lySearch").style.display="none";
	$("lyAdvanceSearch").style.display="none";
	//Show Active Layer #################################
	$("ly" + actMnu).style.display="";
	$("mnuSearch").bgColor="FFFFFF";
	$("mnuAdvanceSearch").bgColor="FFFFFF";
	//Show Active Layer #################################
	$("mnu" + actMnu).bgColor="FFFFFF";
}
function setSmartSearch(obj){
	if(obj.checked){
		$("lySmartSearch").style.display="none";
	}else{
		$("lySmartSearch").style.display="";
	}
}

function changeProperty(obj){
	var objForm = window.document.form1;
	objDate = new Date();
	openLoadCbo = "Func/DropContinue.php";
	switch(obj.name){
		case"txtFromDt":
			openLoadCbo = "Func/DropContinue.php?Mode=9&DateTime=" + objDate.getTime();
			openLoadCbo = openLoadCbo+"&Chk=FromDt&objValue="+obj.value+"&ToDt="+objForm.txtToDt.value;
			break;
		case"txtToDt":
			openLoadCbo = "Func/DropContinue.php?Mode=9&DateTime=" + objDate.getTime();
			openLoadCbo = openLoadCbo+"&Chk=ToDt&objValue="+obj.value+"&FromDt="+objForm.txtFromDt.value;
			break;
		case"txtFromTm":
			openLoadCbo = "Func/DropContinue.php?Mode=10";
			openLoadCbo = openLoadCbo+"&objValue="+obj.value+"&Chk=FromTm";
			break;
		case"txtToTm":
			openLoadCbo = "Func/DropContinue.php?Mode=10";
			openLoadCbo = openLoadCbo+"&objValue="+obj.value+"&Chk=ToTm";
			break;
	}
	window.parent.open(openLoadCbo,"wLoadCbo");
}
function SubmitForm(URL){
	SiteName=LoadObj("strSiteName").value;
	b2bEpaymentFlag=LoadObj("b2bEpaymentFlag").value;
	if(LoadObj("UseCredit").disabled==true && ((LoadObj("sEpayFlag").value=="N") ||(b2bEpaymentFlag!="Y"))){
		alert("Your credit is not available");
	}
	else
	if(document.form1.txtgroupname.value==""){
		alert("Please insert Guest & Group's Name");
	}
	else{
		$("Submit1").disabled=true;

		var objDate = new Date();
		Bconf=true;
		if($("UseAllotment").value=="Y" && $("strSiteName").value=="http://www.hotelclub88.com"){
			//Bconf=confirm('PLEASE NOTE THAT THIS BOOKING IS CONFIRMED AND GUARANTEED TO THE HOTEL. \nAFTER SELECTING "CONFIRM", IF CANCELLED, ONE NIGHT CHARGE WILL APPLY AUTOMATICALLY.\n\nIF CANCELLED AFTER THE GIVEN DEADLINE, THERE WILL BE 100% CANCELLATION CHARGE FOR ENTIRE STAY.');
		}
		if(Bconf){
			document.form1.action=URL;
			if($("txtEmail")){
				if($("txtEmail").value==""){ alert("Please insert Email"); $("txtEmail").focus(); document.form1.Submit1.disabled=false;}else
				if($("txtUserName").value==""){ alert("Please insert Username"); $("txtUserName").focus(); document.form1.Submit1.disabled=false;}else
				if($("txtPassword").value==""){ alert("Please insert Password"); $("txtPassword").focus(); document.form1.Submit1.disabled=false;}else{
				fPay.rLogin();
				}

			}else{
				//SaveFlightDetail();//CHKPRICEBASKET
				fPay.rChkPriceBasket();//CHKPRICEBASKET
			}
		}else{document.form1.Submit1.disabled=false;}
	}
}

function SetMainMenu(actMnu){
	if(actMnu=="Home"){
		window.parent.open("Home.php","wMain");
	}
	if(actMnu=="MyBooking"){
		window.parent.open("MyBooking.php","wMain");
	}
	if(actMnu=="UserProfile"){
		window.parent.open("UserProfile.php","wMain");
	}
	if(actMnu=="AgentProfile"){
		window.parent.open("AgentProfile.php","wMain");
	}
	if(actMnu=="smyReport"){
		window.parent.open("smyReport.php","wMain");
	}
}
function Logout(actMnu){
	if(actMnu=="Logout"){
		window.open("../index.php","_parent");
	}
}

function CancelWB(){
	cDel=confirm("Are you sure you want to delete?");
	(cDel)?window.open("DelBooking.php?SessionID="+SessionID,"_self"):"";
}

function BottonAccept(){
	if(document.form1.chkAccept.checked){
		document.form1.Submit1.disabled=false;
	}
	else{
		document.form1.Submit1.disabled=true;
	}
}

function pShowPrice(ilyPackage){
	//alert("lyShowPrice"+ilyPackage);

	if(	$("lyShowPrice"+ilyPackage).style.display == "none"){
		$("lyShowPrice"+ilyPackage).style.display="";
	}else{
		$("lyShowPrice"+ilyPackage).style.display="none";
	}
}

var fPay = new function (){
	this.rPayment = function (Refresh){//CHKPRICEBASKET
		var myurl = "Func/Payment/PaymentDetail.php", http = new getXMLHTTPRequest();
		http.onreadystatechange = function() {if (http.readyState != 4) { return; }
			if($("TpDetail")){
				//CHKPRICEBASKET
				mytxt=http.responseText;
				if(Refresh==1){
					alert("There are rates discrepancy due to rates update to the system, please click OK, if you are accept the new rates.");
					mytxt=$("WarningsPrice").innerHTML+mytxt;
				}else
				if(Refresh==2){
					alert("Room not available you could click modifly again.");
					mytxt=$("WarningsRoom").innerHTML+mytxt;
				}else
				if(sBookError && sBookFail){
					alert("Can't Book.");
					mytxt=$("WarningsBook").innerHTML+mytxt;
				}
				$("TpDetail").innerHTML=mytxt;
				//CHKPRICEBASKET
				Calendar.setup({inputField : "txtFromDt",ifFormat : "dd-mm-yy",button : "imgFromDate",singleClick : true });
				Calendar.setup({inputField : "txtToDt",ifFormat : "dd-mm-yy",button : "imgToDate",singleClick : true });
				sURL=$("txtsURL").value;
				GrandTotal=($("txtGrandTotal"))?$("txtGrandTotal").value:0;
				if(GrandTotal<=0){
					//alert("Sorry, You did not complete the booking within "+b2bBasketTime+" Mins, The system will return to Search page.");
					if (_SUPPLIERCODE != "CL011")
					{
						alert("Sorry, No product add to basket, please search again.");
					}
					window.open("Home.php","_self");
					return;
				}
				if($("txtsCredit")){
					sCredit=$("txtsCredit").value;
					if(sCredit==""){
						ModeFee=(sURL=="InsertReservation.php")?1:2;
						sBankFee(ModeFee,GrandTotal,sCurrencyName,OrderNumber);
					}
				}
				fPay.rTimeBasket();
				fPay.rCancel();
			}
		};
		http.open("POST", myurl, true); http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		http.send("Mode=1&"+rURL+"&"+new Date().getTime());
	};
	this.rTimeBasket = function (){
		var myurl = "Func/ShowTimeBasket.php", http = new getXMLHTTPRequest();
		http.onreadystatechange = function() {if (http.readyState != 4) { return; }
			if($("TimeBasket")){
				$("TimeBasket").innerHTML=http.responseText;
				if($("Min")){
					if(($("Min").value!="00")||($("Sec").value!="00")||($("Plus").value=="-")){
						sec = $("Sec").value;
						min = $("Min").value;
						countDown();
					}
				}
			}
		};
		http.open("POST", myurl, true); http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		http.send("Mode=1&"+new Date().getTime());
	};
	//CHKPRICEBASKET
	this.rChkPriceBasket = function (){
		SetLoadTP();
		SaveFlightDetail();
		/*
		$("TpDetail").style.cursor = "wait";
		$("ChkPriceProcess").style.display = "";
		$("Submit1").style.display = "none";
		var myurl = "Func/ChkPriceBasket/ChkPriceBasket.php", http = new getXMLHTTPRequest();
		http.onreadystatechange = function() {if (http.readyState != 4) { return; }
			$("TpDetail").style.cursor = "default";
			if($("TpFooter")){
				$("ChkPriceBasket").innerHTML=http.responseText;
				if($("Modifly")){
					if($("TpDetail")){ $("TpDetail").innerHTML=""; }
					if($("Modifly").value="CP"){
						window.clearTimeout(SD);
						fPay.rPayment (1);
					}else if($("Modifly").value="CR"){
						window.clearTimeout(SD);
						fPay.rPayment (2);
					}
				}else{
					SetLoadTP();
					SaveFlightDetail();
				}
			}
		};
		http.open("POST", myurl, true); http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		http.send("Mode=1&"+new Date().getTime());
		*/
	};
	//CHKPRICEBASKET

	this.jumpToEditPaxDetail = function (objName) {
		var obj = $(objName);
		var strFile = "PaxDetail.php";
		strFile += "?Mode="+obj.getAttribute("Mode");
		strFile += "&SessionID="+obj.getAttribute("SessionID");
		strFile += "&Code="+obj.getAttribute("HotelCode");
		strFile += "&SupplierCode="+obj.getAttribute("SupplierCode");
		strFile += "&FromDt="+obj.getAttribute("FromDt");
		strFile += "&ToDt="+obj.getAttribute("ToDt");
		strFile += "&Available="+obj.getAttribute("UseAllotment");
		strFile += "&FileRP="+obj.getAttribute("Idescription");
		strFile += "&"+new Date().getTime();
		window.open(strFile, "_self");
	};

	this.rLogin = function (){
		var LPart;
		LPart="&sEmail="+$("txtEmail").value;
		LPart+="&sUserName="+$("txtUserName").value;
		LPart+="&sPassword="+$("txtPassword").value;
		LPart+="&sName="+$("txtName").value;
		LPart+="&sSurname="+$("txtSurname").value;
		LPart+="&sPrefixCode="+$("txtPrefixCode").value;
		LPart+="&sMode="+$("txtMode").value;
		var myurl = "../Login/MemberLogin.php", http = new getXMLHTTPRequest();
		http.onreadystatechange = function() {if (http.readyState != 4) { return; }
			if($("DataLogin")){
				myText=parseFloat(http.responseText);
				$("DataLogin").innerHTML=myText;
				if(myText==1){
					$("txtEmail").disabled=true;
					$("txtUserName").disabled=true;
					$("txtPassword").disabled=true;
					fPay.rUpdateBasket();
				}else{
					alert("Invalid Username and Password.");
					document.form1.Submit1.disabled=false;
				}
			}
		};
		http.open("POST", myurl, true); http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		http.send("Mode=1"+LPart+"&"+new Date().getTime());
	};
	this.rRegister = function (){
		var LPart;
		if($("txtEmailMem").value==""){ alert("Please insert data"); $("txtEmailMem").focus();  }else
		if($("txtUserNameMem").value==""){ alert("Please insert data"); $("txtUserNameMem").focus(); }else
		if($("txtPasswordMem").value==""){ alert("Please insert data"); $("txtPasswordMem").focus(); }else
		if($("txtRePasswordMem").value==""){ alert("Please insert data"); $("txtRePasswordMem").focus(); }else
		if($("cboPrefixMem").value==""){ alert("Please insert data"); $("cboPrefixMem").focus(); }else
		if($("txtNameMem").value==""){ alert("Please insert data"); $("txtNameMem").focus(); }else
		if($("txtSurNameMem").value==""){ alert("Please insert data"); $("txtSurNameMem").focus(); }else
		if($("txtTelMem").value==""){ alert("Please insert data"); $("txtTelMem").focus(); }else
		if($("cboCountryMem").value==""){ alert("Please insert data"); $("cboCountryMem").focus(); }else
		if($("txtAddressMem").value==""){ alert("Please insert data"); $("txtAddressMem").focus(); }else
		if($("txtStateMem").value==""){ alert("Please insert data"); $("txtStateMem").focus(); }else
		if($("txtZipCodeMem").value==""){ alert("Please insert data"); $("txtZipCodeMem").focus(); }else
		if($("txtPasswordMem").value != $("txtRePasswordMem").value || $("txtRePasswordMem").value==""){
			alert("Insert password again !!");
		}else{
			LPart="&sEmail="+$("txtEmailMem").value;
			LPart+="&sUserName="+$("txtUserNameMem").value;
			LPart+="&sPassword="+$("txtPasswordMem").value;
			LPart+="&sPrefix="+$("cboPrefixMem").value;
			LPart+="&sName="+$("txtNameMem").value;
			LPart+="&sSurname="+$("txtSurNameMem").value;
			LPart+="&sTel="+$("txtTelMem").value;
			LPart+="&sCountry="+$("cboCountryMem").value;
			LPart+="&sAddress="+$("txtAddressMem").value;
			LPart+="&sAddress2="+$("txtAddressMem2").value;
			LPart+="&sAddress3="+$("txtAddressMem3").value;
			LPart+="&sState="+$("txtStateMem").value;
			LPart+="&sZipCode="+$("txtZipCodeMem").value;
			LPart+="&sFAX="+$("txtFAXMem").value;
			LPart+="&sMode="+$("txtMode").value;
			var myurl = "../Login/MemberRegister.php", http = new getXMLHTTPRequest();
			http.onreadystatechange = function() {if (http.readyState != 4) { return; }
				if($("DataLogin")){
					myText=parseFloat(http.responseText);
					$("DataLogin").innerHTML=myText;
					if(myText==1){
						fPay.rUpdateBasketNewMem();
					}else{
						alert("This email is already registered, please go to Forget Password options.");
						//document.form1.Submit1.disabled=false;
					}
				}
			};
			http.open("POST", myurl, true); http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			http.send("Mode=1"+LPart+"&"+new Date().getTime());
		}
	};
	this.rUpdateBasketNewMem = function (){
		var LPart;
		var myurl = "Func/Payment/UpdateBasket.php", http = new getXMLHTTPRequest();
		http.onreadystatechange = function() {if (http.readyState != 4) { return; }
			window.location.reload();
		};
		http.open("POST", myurl, true); http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		http.send("Mode=1&"+new Date().getTime());
	};
	this.rUpdateBasket = function (){
		var LPart;
		var myurl = "Func/Payment/UpdateBasket.php", http = new getXMLHTTPRequest();
		http.onreadystatechange = function() {if (http.readyState != 4) { return; }
			//alert("already");
			SaveFlightDetail();
		};
		http.open("POST", myurl, true); http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		http.send("Mode=1&"+new Date().getTime());
	};

	this.rCancel = function (){
		if($("sCancellationPolicy")){
			var myurl = "Func/Payment/PaymentViewCXLPolicy.php", http = new getXMLHTTPRequest();
			var PartPost = "Status=HB";
			http.onreadystatechange = function() {if (http.readyState != 4) { return; }
				myText=http.responseText;
				if(myText !=""){
					if($("sCancellationPolicy"))$("sCancellationPolicy").style.display="";
					if($("sCancellationPolicyDetail"))$("sCancellationPolicyDetail").innerHTML=myText;
				}
			};
			http.open("POST", myurl, true); http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			http.send(PartPost+"&"+new Date().getTime());
		}
	};

	this.Forgot = function (){
		var myurl = "../Login/FormForgotPwd.php", http = new getXMLHTTPRequest();
		http.onreadystatechange = function() {if (http.readyState != 4) { return; }
			if($("TpDetail")){
				$("TpDetail").innerHTML=http.responseText;
				if($("txtEmail")){$("txtEmail").focus();}
			}
		};
		http.open("POST", myurl, true); http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		http.send("Mode=1&"+new Date().getTime());
	};
	this.SendForgot = function (Email){
		var myurl = "../Login/SendForgotPwd.php", http = new getXMLHTTPRequest();
		$("Submit1").disabled=true;
		http.onreadystatechange = function() {if (http.readyState != 4) { return; }
			if($("sForgot")){
				$("sForgot").innerHTML=http.responseText;
				$("Submit1").disabled=false;
			}
			if($("ChkEmail")){
				if($("ChkEmail").value == 0 || $("ChkEmail").value == ""){
					alert("This email not have data !");
				}else{
					alert("Username and password send to this email complete.");
					window.location.reload();
				}
			}
		};
		http.open("POST", myurl, true); http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		http.send("Email="+Email+"&"+new Date().getTime());
	};
}

var termcondition=false;
function Terms(){
termcondition=!termcondition;
	if(termcondition){
		window.open("../termandcondition.php","termandcondition");
		$("termandcondition").style.display="";
	}else{
		$("termandcondition").style.display="none";
	}
}


var RegisterDiv = "RegisterDiv";
function sInputRegister(){
	//cboHide("none");
	var objMyDiv = new CreateDIV();
	//set property div
	objMyDiv.id = RegisterDiv;
	objMyDiv.position = "absolute";
	objMyDiv.display = "";
	objMyDiv.left = "0";
	objMyDiv.top = "0";
	objMyDiv.width = document.body.scrollWidth;
	objMyDiv.height = document.body.scrollHeight;
	//objMyDiv.backgroundColor = "#FF0000";
	//data in div
	objMyDiv.dataDiv = "";
	//create div
	objMyDiv.divCreate();
	//display div
	document.body.appendChild(objMyDiv.div);

	var bgImage="../images/bAlpha.gif";
	var strData = "<table border='0' cellpadding='0' cellspacing='0'  width='100%' height='100%' background='"+bgImage+"'>\n";
	strData += "<tr>\n";
	strData += "<td height='450'>&nbsp;</td>\n";
	strData += "<td>&nbsp;</td>\n";
	strData += "<td>&nbsp;</td>\n";
	strData += "</tr>\n";
	strData += "<tr>\n";
	strData += "<td height='50'>&nbsp;</td>\n";
	strData += "<td bgcolor='#FFCC00' width='500'><input type='button' onclick='Register();' value='regissss'><br><span onclick='CloseRegister();'>Close</span></td>\n";
	strData += "<td >&nbsp;</td>\n";
	strData += "</tr>\n";
	strData += "<tr>\n";
	strData += "<td></td>\n";
	strData += "<td>&nbsp;</td>\n";
	strData += "<td>&nbsp;</td>\n";
	strData += "</tr>\n";
	strData += "</table>\n";
	$(objMyDiv.id).innerHTML = strData;
}

function CloseRegister(){
	//cboHide("");
	document.body.removeChild($(RegisterDiv));
}

function Register(){
	var httpRegister = getXMLHTTPRequest();
	var objDate = new Date();
	myurl = "Func/Register.php/TimeBasket.php?DateTime="+ new Date().getTime();
	//window.open(myurl);
	httpRegister.open("GET", myurl, true);
	httpRegister.onreadystatechange = function(){
	   if (httpRegister.readyState == 4) {
		if(httpRegister.status == 200) {
			var mytext = httpRegister.responseXML;
			var obj = mytext.getElementsByTagName("register");
			Pass = mytext.getElementsByTagName("Pass")[0].firstChild.nodeValue;
			if(Pass==1){
				CloseRegister();
				$("chkAccept").disabled=false;
				$("chkAccept").checked=true;
				BottonAccept();
				//window.location.reload();
			}
		}
	  }
	}
	httpRegister.send(null);
}
function DeleteWB(SessionID,ServiceNo){
	//alert(SessionID);
	cDel=confirm("Are you sure you want to delete?");
	(cDel)?window.open("../Package/pDelBooking.php?SessionID="+SessionID+"&ServiceNo="+ServiceNo+"&"+new Date().getTime(),"_self"):"";
}
function EditWB(SessionID,ServiceNo){
		//alert(ServiceNo);
		//window.open(myurl, "_blank","left=100,top=50;status=no,scrollbars=yes,resizable=yes,width=800,height=600");
		window.open("../Package/pEditBooking.php?SessionID="+SessionID+"&ServiceNo="+ServiceNo+"&"+new Date().getTime(),"_self");
}
function ConfirmDel(SessionID,UserCode,ServiceNo,Code,FromDt,ToDt){
	cDel=confirm("Are you sure you want to delete?");
	dUrl="../Accom/DelBasketHotel.php?SessionID="+SessionID+"&UserCode="+UserCode;
	dUrl+="&ServiceNo="+ServiceNo+"&Code="+Code+"&FromDt="+FromDt+"&ToDt="+ToDt+"&"+new Date().getTime();
	(cDel)?SendConfirmDel(dUrl):"";
	//(cDel)?window.open(dUrl,"_self"):"";
}
function ConfirmDelCatg(SessionID,UserCode,ServiceNo){
	cDel=confirm("Are you sure you want to delete?");
	dUrl="../Accom/DelBasketRoomCatg.php?SessionID="+SessionID+"&UserCode="+UserCode;
	dUrl+="&ServiceNo="+ServiceNo+"&"+new Date().getTime();
	(cDel)?SendConfirmDel(dUrl):"";
	//(cDel)?window.open(dUrl,"_self"):"";
}
function SendConfirmDel(myurl){
	var httpDel = getXMLHTTPRequest();
	var objDate = new Date();
	httpDel.open("GET", myurl, true);
	httpDel.onreadystatechange = function(){
	   if (httpDel.readyState == 4) {
		if(httpDel.status == 200) {
			//var mytext = httpRegister.responseXML;
			$("TpDetail").innerHTML="";
			fPay.rPayment (0);//CHKPRICEBASKET
		}
	  }
	}
	httpDel.send(null);
}

function SetShowPrice(FrmName){
    GenHtml = "<span style='display:none;'>";
    GenHtml += $("r"+FrmName).innerHTML;
    GenHtml += "</span>";
	var objWindow = window.open("","_blank","left=0,top=0;status=no,scrollbars=yes,resizable=yes,width=" + (800) + ",height=" + (250));
	objWindow.document.write(GenHtml);
	objWindow.document.close();
    objFrm = eval("objWindow.document."+FrmName);
	objFrm.submit();
}//PopupShowPrice############################

function SaveFlightDetail(){
	txtgroupname=$("txtgroupname").value;
	txtOSRef=$("txtOSRef").value;
	txtFromDt=$("txtFromDt").value;
	txtFromTm=$("txtFromTm").value;
	txtFromFlight=$("txtFromFlight").value;
	txtVoyageFrom=$("txtVoyageFrom").value;
	txtToDt=$("txtToDt").value;
	txtToTm=$("txtToTm").value;
	txtToFlight=$("txtToFlight").value;
	txtVoyageTo=$("txtVoyageTo").value;

	var httpFlightDetail = getXMLHTTPRequest();
	var objDate = new Date();
	myurl = "SaveFlightDetail.php?";
	myurl += "txtgroupname="+txtgroupname;
	myurl += "&txtOSRef="+txtOSRef;
	myurl += "&txtFromDt="+txtFromDt;
	myurl += "&txtFromTm="+txtFromTm;
	myurl += "&txtFromFlight="+txtFromFlight;
	myurl += "&txtVoyageFrom="+txtVoyageFrom;
	myurl += "&txtToDt="+txtToDt;
	myurl += "&txtToTm="+txtToTm;
	myurl += "&txtToFlight="+txtToFlight;
	myurl += "&txtVoyageTo="+txtVoyageTo;
	myurl += "&DateTime="+ new Date().getTime();
	//window.open(myurl);
	httpFlightDetail.open("GET", myurl, true);
	httpFlightDetail.onreadystatechange = function(){
	   if (httpFlightDetail.readyState == 4) {
		if(httpFlightDetail.status == 200) {
			var mytext = httpFlightDetail.responseXML;
			var obj = mytext.getElementsByTagName("register");
			Pass = mytext.getElementsByTagName("Pass")[0].firstChild.nodeValue;
			if(Pass==1){
				window.document.form1.submit();
			}
		}
	  }
	}
	httpFlightDetail.send(null);
}

var sec = 0;  // set the seconds
var min = 0;   // set the minutes
var SD;
function countDown() {
	if((sec==0 || sec=="00")&&(min==0 || min=="00")){
		var BURL = window.location.href;
		window.open("../Accom/Home.php","_self");
	}else{
		sec--;
		if (sec == -1) {
		sec = 59;
		min = min - 1;
		}else {
		min = min;
		}
	if (sec<=9) { sec = "0" + sec; }
	time = min + " min and " + sec + " sec ";
	if($("theTime")){ $("theTime").innerHTML = time; }
	SD = window.setTimeout("countDown();", 1000);
	}
}

function mozilarShow(e) {
	evt = e;
	if(navigator.appName!="Netscape"){
	xCoord =event.x+document.body.scrollLeft-100;
	yCoord = event.y+document.body.scrollTop+20;
	}else{
	xCoord = window.evt.pageX-100 ;
	yCoord = window.evt.pageY+20 ;
	}
	$("dek").style.left = xCoord;
	$("dek").style.top = yCoord;
}
function hide(){
//if(!old){yyy=-1000;skn.visibility="hidden";}
$("dek").style.visibility="";
}

function popup(txt){
GenHtml = "<table width='230'  border='0' cellspacing='1' cellpadding='3' bgcolor='#FFFFFF'  class='bdmenu'> ";
GenHtml +=" 	<tr class='t11' ><td style='padding-left:10px' bgcolor='#FFFEEE' align='left'> "+txt;
GenHtml +=" 	</td></tr> ";
GenHtml +=" </table> ";
document.all("dek").innerHTML=GenHtml;
$("dek").style.visibility="visible";
document.onmousemove = mozilarShow;
}
function EditService(Group, ServiceNo){
	strFile = (Group=="TRANS")? "../Transfer/tHome.php" : "../Sightseeing/sHome.php";
	strFile += "?Mode=Edit";
	strFile += "&ServiceNo=" + ServiceNo;
	strFile += "&DateTime=" + new Date().getTime();
	window.open(strFile,"_self");
}

function DeleteTranfer(ServiceNo){
/*	strFile = "../Transfer/Func/tDeleteBasket.php?ServiceNo=" + ServiceNo;
	strFile += "&DateTime=" + new Date().getTime();
	window.wDelete.open(strFile,"_self");
*/
	cDel=confirm("Are you sure you want to delete?");
	dUrl="../Transfer/Func/tDeleteBasket.php?ServiceNo=" + ServiceNo;
	dUrl+="&DateTime=" + new Date().getTime();
	(cDel)?SendConfirmDel(dUrl):"";
}
function isEmail(string) {
chkMail=string.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) ;
	if(chkMail==-1){
		alert("You have entered an invalid email address. Please try again.");
		string.focus();
		string.value="";
	}
}
function SetDataGuest(){
	if($("txtEmailMem")){ $("txtEmailMem").value=$("txtEmail").value; }
	if($("txtUserNameMem")){$("txtUserNameMem").value=$("txtUserName").value; }
	if($("txtPasswordMem")){$("txtPasswordMem").value=$("txtPassword").value; }
	if($("txtRePasswordMem")){$("txtRePasswordMem").value=$("txtPassword").value; }
}