var bgActiveColor="#FFFDD7";
var bgNormalColor="#FFFFFF";
var objActive;
var BURL = window.location.href;
function Zaehlen () {
	// 1 sec = 1000
	//window.open(BURL,"_self");
	window.location.reload ();
	aktiv = window.setTimeout("Zaehlen()", 300000);
}
function ClearTime () {
	window.clearTimeout(aktiv);
	aktiv = window.setTimeout("Zaehlen()", 300000);
}
aktiv = window.setTimeout("Zaehlen()", 300000);
window.ClearTime();
function setSelectSearch(obj) { if (obj.type!="select-one") { obj.select(); } obj.style.background=bgActiveColor;}
function setBgNormal(obj) { obj.style.background=bgNormalColor; }
function SetFocus(){   document.form1.txtqDocID.focus();  }
function LoadObj(str){return(document.getElementById(str));}
function showSearch(){
	imS = LoadObj('imgSearch');
	if(imS.src.indexOf('ico_search_act')!=-1){
		imS.src="images/ico_search.gif";
		LoadObj('TbSearch').style.display="none";
	}else{
		imS.src="images/ico_search_act.gif";
		LoadObj('TbSearch').style.display="";
	}
}
function setCboCompareDate() {
        var objCompare = document.form1.cboqDatecd;
        //disable text ###############################
        document.getElementById("lyDateSearch1").style.display="none";
        document.getElementById("lyDateSearch2").style.display="none";
        switch (objCompare.value) {
        //user only value1 ###################################
        case "ATDATE" :
        case "LESS" :
        case "LESSEQUAL" :
        case "MORE" :
        case "MOREEQUAL" :
                document.getElementById("lyDateSearch1").style.display="";
        break;
        //user both value1 and value2 ########################
        case "BETWEEN" :
                document.getElementById("lyDateSearch1").style.display="";
                document.getElementById("lyDateSearch2").style.display="";
        break;
        }
}
function setCboCompareNumber() {
	var objCompare = document.form1.cboqNumcd;
	//disable text ###############################
	document.getElementById("lyNumberSearch1").style.display="none";
	document.getElementById("lyNumberSearch2").style.display="none";

	switch (objCompare.value) {
		//user only value1 ###################################
		case "EQUAL" :
		case "LESS" :
		case "LESSEQUAL" :
		case "MORE" :
		case "MOREEQUAL" :
			document.getElementById("lyNumberSearch1").style.display="";
			break;
		case "BETWEEN" :
			document.getElementById("lyNumberSearch1").style.display="";
			document.getElementById("lyNumberSearch2").style.display="";
			break;
	}
}
function ChangeStatus(DocID, fixStatus){
	var Status = $('ly'+DocID).getAttribute('propStatus');
	var ConfirmNo = $('ly'+DocID).getAttribute('propConfirmNo');
	var SP2 = $('ly'+DocID).getAttribute('propSP2');
	var spCXL = $('ly'+DocID).getAttribute('propspCXL');
	var Mode = 1;
	var Search = 0;

	if(Status=="RSVN"){ Status="RESERVED";}

	if (spCXL == '1')
	{
		window.open("UpdateStatusHC.php?status="+Status+"&mode="+Mode+"&DocID="+DocID+"&file="+ConfirmNo+"&fStatus="+fixStatus+"&s="+Search+"&SP2="+SP2+"&"+(+new Date()),"wStatus");
	} else {
		switch(fixStatus){
			case"CONF":
			case"AMENDCONF":
				window.open("UpdateStatusHB.php?status="+Status+"&mode="+Mode+"&DocID="+DocID+"&file="+ConfirmNo+"&fStatus="+fixStatus+"&s="+Search+"&SP2="+SP2+"&"+(+new Date()),"wStatus");
				break;
			default:
				window.open("UpdateStatusHB.php?status="+Status+"&mode="+Mode+"&DocID="+DocID+"&file="+ConfirmNo+"&fStatus="+fixStatus+"&s="+Search+"&SP2="+SP2+"&"+(+new Date()),"wStatus");
				break;
		}
	}
}
function waiting(DocID,status){
	window.open("waiting.php?DateTime=" + (+new Date())+"&docid="+DocID+"&status="+status,"wWaiting");
}
function JumpToVoucher(DocID){
	window.open("rptVoucher.php?DocID="+DocID+"&"+ (+new Date()), "_blank", "left=0,top=0,status=no,scrollbars=yes,resizable=yes,width=" + 900 + ",height=" + 800);
}
function JumpToDetail(DocID,Status,doctype){
    if(doctype=="HB"){
        window.open("rptHBooking.php?DocID="+DocID+"&Status="+Status,"_blank","left=0,top=0,status=no,scrollbars=yes,resizable=yes,width=" + 900 + ",height=" + 800); }
    else if(doctype=="AHB"){
        window.open("rptAHBooking.php?DocID="+DocID+"&Status="+Status,"_blank","left=0,top=0,status=no,scrollbars=yes,resizable=yes,width=" + 900 + ",height=" + 800);   }
    else {
        window.open("rptCHBooking.php?DocID="+DocID+"&Status="+Status,"_blank","left=0,top=0,status=no,scrollbars=yes,resizable=yes,width=" + 900 + ",height=" + 800);  }
    }
function Msg(DocID){
    window.open("MsgMercury.php?DocID="+DocID,"_blank","left=0,top=0,status=no,scrollbars=yes,resizable=yes,width=" + 900 + ",height=" + 800);
    window.location.reload();}
function Allotment(ServiceNo,Status){
    window.WAllotment.open("AcceptAllotment.php?ServiceNo="+ServiceNo+"&s="+Status,"_self"); }
function LoadCbo(obj){
	DocType=document.form1.cboqDocType.value;
	window.open("LoadcboStatus.php?DocType="+DocType,"LoadStatus");
}
function OpendReport(){   window.open("rptHBsmy.php","_blank","left=0,top=0,status=no,scrollbars=yes,resizable=yes,width=" + 900 + ",height=" + 800); }
function OpendReport1(){   window.open("rptArrivaldate.php","_blank","left=0,top=0,status=no,scrollbars=yes,resizable=yes,width=" + 900 + ",height=" + 800); }
function OpendReport2(){   window.open("rMakeToDay.php","_blank","left=0,top=0,status=no,scrollbars=yes,resizable=yes,width=" + 900 + ",height=" + 800); }
function SendEmailConfirm(Status,DocID,ConfirmNo,Mode,fixStatus){
    objDate = new Date();
    if(Status=="CONF")
	{
		window.open("HBookingSendmail.php?Status="+Status+"&DocID="+DocID+"&"+ (+new Date()),"wSpecial");
	}
    else if(Status=="AMENDCONF")
	{
		window.open("AHBookingSendmail.php?Status="+Status+"&DocID="+DocID+"&"+ (+new Date()),"wSpecial");
	} else {
		window.open("CHBookingSendmail.php?Status="+Status+"&DocID="+DocID+"&"+ (+new Date()),"wSpecial");
	}
}//SendEmailConfirm


function getXMLHTTPRequest() {
	try {req = new XMLHttpRequest();}
		catch(err1) {  try {req = new ActiveXObject("Msxml2.XMLHTTP");}
		catch (err2) { try {req = new ActiveXObject("Microsoft.XMLHTTP");}
		catch (err3) {req = false;}
	  }
	}
	return req;
}

function $ (str){return document.getElementById(str);}
function Neptune () {
	this.LoadListStatus = function (){
		/*
		var myurl = "Func/LoadListStatus.php";
		var http = new getXMLHTTPRequest();
		http.onreadystatechange = function() {if (http.readyState != 4) { return; }
			var mytext = http.responseText;
			//$("lyListStatus").innerHTML = mytext;
		};
		http.open("POST", myurl, true);
		http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		http.send("Code="+this.Code+"&"+(+new Date()));
		*/
	};

	this.LoadStatus = function (StatusValue, Mode){
		$('lyLoadStatus').innerHTML = '<img src="../b2b/images/sLoad.gif">';
		var myurl = "Func/LoadStatus.php";
		var http = new getXMLHTTPRequest();
		http.onreadystatechange = function() {if (http.readyState != 4) { return; }
			var mytext = http.responseText;
			$("lyLoadStatus").innerHTML = mytext;
			if (JB.SPrice)
			{
				var elm = $("lyLoadStatus").getElementsByTagName("span");
				for (var i=0; i<elm.length; i++)
				{
					if (elm[i].getAttribute("SPrice")=="1")
					{
						setTimeout("JB.getCostByServiceNo('"+elm[i].getAttribute("ServiceNo")+"');", 50);
					}
				}
			}
		};
		http.open("POST", myurl, true);
		http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		http.send("Code="+this.Code+"&Mode="+Mode+"&StatusValue="+StatusValue+"&"+(+new Date()));
	};

	this.Search = function (){
		param = "pSupplierCode="+this.Code;
		param += "&Mode=Search";
		param += "&pFileNo=" + $("txtqFileNo").value;
		param += "&pDocID=" + $("txtqDocID").value;
		param += "&pVoucherNo=" + $("txtqVoucherNo").value;
		param += "&pDocType=" + $("cboqDocType").value;
		param += "&pStatus=" + $("cboqStatus").value;
		param += "&pCode=" + $("cboqCode").value;
		param += "&pGuestName=" + $("txtqGuestName").value;
		param += "&pSearchDate=" + $("cboqSearchDate").value;
		param += "&pFromDate=" + $("txtqsfromdate").value;
		param += "&pDatecd=" + $("cboqDatecd").value;
		param += "&pToDate=" + $("txtqstodate").value;
		param += "&pSearchNum=" + $("cboqSearchnum").value;
		param += "&pFromPrice=" + $("txtqfromprice").value;
		param += "&pNumcd=" + $("cboqNumcd").value;
		param += "&pToPrice=" + $("txtqtoprice").value;

		var myurl = "Func/LoadSearch.php";
		var http = new getXMLHTTPRequest();
		http.onreadystatechange = function() {if (http.readyState != 4) { return; }
			var mytext = http.responseText;
			$("lyLoadStatus").innerHTML = mytext;
			if($("lyLoadStatus").innerHTML){
				var elm = $("lyLoadStatus").getElementsByTagName("span");
				for (var i=0; i<elm.length; i++)
				{
					if (elm[i].getAttribute("SPrice")=="1")
					{
						setTimeout("JB.getCostByServiceNo('"+elm[i].getAttribute("ServiceNo")+"');", 50);
					}
				}
			}
		};
		http.open("POST", myurl, true);
		http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		http.send(param+"&"+(+new Date()));
	};

	this.getDocumentDetail = function (myurl, DocID, Status){
		var http = new getXMLHTTPRequest();
		http.onreadystatechange = function() {if (http.readyState != 4) { return; }
			var mytext = http.responseText;
			$("lyDetail").innerHTML = mytext;
		};
		http.open("POST", myurl, true);
		http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		http.send("DocID="+DocID+"&Status="+Status+"&"+(+new Date()));
	};

	this.Login = function (){
		if (!this.LoginMode)this.LoginMode = 1;

		var param = "Mode="+this.LoginMode;
		param += "&SupplierID="+$("txtSupplierID").value;
		param += "&UserName="+$("txtUserName").value;
		param += "&Password="+$("txtPassword").value;
		var myurl = "Func/Login/Login.php";
		var http = new getXMLHTTPRequest();
		http.onreadystatechange = function() {if (http.readyState != 4) { return; }
			var mytext = eval("("+http.responseText+")");
			if (mytext.canlogin == 'Y')
			{
				if (mytext.Master == 'Y')
				{
					window.open("../newNeptune/Master.php", "_self");
				} else {
					var mode = mytext.Group;
					if (mode == 'SUPPLIER')
					{
						mode = mytext.sGroup;
					}
					switch (mode)
					{
						case 'ACCOM':
							window.open("../newNeptune/bookingHotel.php", "_self");
							break;
						case 'TOUR':
							window.open("../newNeptune/bookingSightseeing.php", "_self");
							break;
						case 'PACK':
							window.open("../newNeptune/bookingPackage.php", "_self");
							break;
						case 'TRANS':
							window.open("../newNeptune/bookingTransfer.php", "_self");
							break;
					}
				}
			}else {
				alert("username or password invalid");
			}
		};
		http.open("POST", myurl, true);
		http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		http.send(param+"&"+(+new Date()));
	};

	this.MasterLoadList = function (){
		var param = "Mode=MasterLoadList";
		var myurl = "Func/Master/Master.php";
		var http = new getXMLHTTPRequest();
		http.onreadystatechange = function() {if (http.readyState != 4) { return; }
			var mytext = http.responseText;
			$("lyMaster").innerHTML = mytext;
		};
		http.open("POST", myurl, true);
		http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		http.send(param+"&"+(+new Date()));
	};

	this.MastergetProfile = function (Code){
		var param = "Mode=MastergetProfile";
		param += "&Code="+Code;
		var myurl = "Func/Master/Master.php";
		var http = new getXMLHTTPRequest();
		http.onreadystatechange = function() {if (http.readyState != 4) { return; }
			var mytext = http.responseText;
			window.open ("Neptune.php?"+(+new Date()), "wDetail");
		};
		http.open("POST", myurl, true);
		http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		http.send(param+"&"+(+new Date()));
	};

}
var JB = new Neptune () ;
JB.getCostByServiceNo = function (ServiceNo){
	var param = "ServiceNo="+ServiceNo;
	var myurl = "Func/LoadCostByServiceNo.php";
	var http = new getXMLHTTPRequest();
	http.onreadystatechange = function() {if (http.readyState != 4) { return; }
		var myprice = eval("("+http.responseText+")");

		n=myprice.length;
		i=0;
		while(i<n){
			i++;
			if ($("s-"+ServiceNo+"-"+i))
			{
				$("s-"+ServiceNo+"-"+i).innerHTML = jNumberFormat((myprice[i-1][0]+myprice[i-1][1]+myprice[i-1][2]), 2) + " " + myprice[i-1][3];
				if(i>1){
					$("s-"+ServiceNo+"-"+i).innerHTML="<br>"+$("s-"+ServiceNo+"-"+i).innerHTML;
				}
				$("s-"+ServiceNo+"-"+i).setAttribute("xroom", myprice[i-1][0]);
				$("s-"+ServiceNo+"-"+i).setAttribute("xcompulsory", myprice[i-1][1]);
				$("s-"+ServiceNo+"-"+i).setAttribute("xsupplement", myprice[i-1][2]);
				$("s-"+ServiceNo+"-"+i).setAttribute("xcurrency", myprice[i-1][3]);
			}
		}
	};
	http.open("POST", myurl, true);
	http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	http.send(param+"&"+(+new Date()));
}

JB.popcostshow = function(obj){
	var room = parseFloat(obj.getAttribute("xroom"));
	var compulsory = parseFloat(obj.getAttribute("xcompulsory"));
	var supplement = parseFloat(obj.getAttribute("xsupplement"));
	var headname = "";
	switch (obj.getAttribute("xroomtype"))
	{
		case "SGL":headname = "Single ";break;
		case "TW":headname = "Twin ";break;
		case "DBL":headname = "Double ";break;
		case "TPL":headname = "Triple ";break;
		case "TPL":headname = "Triple ";break;
		case "TPLC":headname = "Triple Child ";break;
		case "QUAD":headname = "Quad ";break;
	}
	headname += obj.getAttribute("xnight") + " Nights";
	$("lypopcost-head").innerHTML = headname;
	$("lypopcost-room").innerHTML = jNumberFormat(room, 2) + " " + obj.getAttribute("xcurrency");
	$("lypopcost-compulsory").innerHTML = jNumberFormat(compulsory, 2) + " " + obj.getAttribute("xcurrency");
	$("lypopcost-supplement").innerHTML = jNumberFormat(supplement, 2) + " " + obj.getAttribute("xcurrency");
	$("lypopcost-total").innerHTML = jNumberFormat(room+compulsory+supplement, 2) + " " + obj.getAttribute("xcurrency");
	$("lypopcost").style.top = Calendar.getAbsolutePos (obj).y - 115+"px";
	$("lypopcost").style.left = Calendar.getAbsolutePos (obj).x + 5+"px";
	$("lypopcost").style.visibility = "";
}

JB.popcosthide = function(){
	$("lypopcost").style.visibility = "hidden";
}

JB.onloadpage = function(){
	JB.LoadListStatus ();
	JB.LoadStatus (sStatus, "1");
}

function OpendDetail (DocID, Status){
	var strFileName = "Func/ChangeRate/index.php?DocID="+DocID+"&Status="+Status+"&"+(+new Date());
	window.open(strFileName, "_blank", "left=0,top=0,status=no,scrollbars=yes,resizable=yes,width=" + 900 + ",height=" + 800);
}

function OpenReport(){
	imS = LoadObj("imgReport");
	if(imS.src.indexOf('ico_search_act')!=-1){
		imS.src="images/ico_search.gif";
		LoadObj('lyReport').style.display="none";
	}else{
		imS.src="images/ico_search_act.gif";
		LoadObj('lyReport').style.display="";
	}
}

function GotoReport(strType){
	var strFileName;
	switch(strType){
		case "ArrivalbyDate":
			strFileName="../Report/RSVN/ArrivalbyDateReportSearch.php";
		break;
		case "ArrivalbyHotel":
			strFileName="../Report/RSVN/ArrivalByHotelReportSearch.php";
		break;
		case "DeparturebyDate":
			strFileName="../Report/RSVN/DepartureByDateReportSearch.php";
		break;
		case "DeparturebyHotel":
			strFileName="../Report/RSVN/DepartureByHotelReportSearch.php";
		break;
		case "Cancellation":
			strFileName="../Report/RSVN/CancellationReportSearch.php";
		break;
		case "HotelBookingSummary":
			strFileName="../Report/RSVN/HBookingSmySearch.php";
		break;
		case "VoucherAccomSummary":
			strFileName="../Report/RSVN/VoucherAccomSmySearch.php";
		break;
		case "CreditorInvoiceCosting":
			strFileName="../Report/Account/CreditorInvoiceCostingSearch.php";
		break;
	}
	strFileName += "?Code="+JB.Code+"&GroupCode="+JB.GroupCode+"&"+(+new Date());
	window.open(strFileName,"_blank","left=0,top=0,status=no,scrollbars=yes,resizable=yes,width=" + (screen.width-10) + ",height=" + (screen.height-50));
}
function refreshNeptune(){
	window.open("Neptune.php?"+(+new Date()),"_self");
}
JB.resendEmailHotel = function(obj, mode){
	if (!mode)
	{
		mode = 1;
	}
	$('ly-popresendemail-processing').style.display = 'none';
	$('ly-popresendemail-complete').style.display = 'none';

	switch (mode)
	{
		case 1:
			JB.setPageOverlay(true);
			$('ly-popresendemail-processing').style.display = '';
			$('ly-popresendemail').style.visibility = '';
			window.location.hash = 'pagetop';

			var param = "propConfirmNo="+obj.getAttribute('propConfirmNo');
			param += "&propDocID="+obj.getAttribute('propDocID');
			param += "&propStatus="+obj.getAttribute('propStatus');
			param += "&propCompanyCode="+obj.getAttribute('propCompanyCode');
			if (obj.getAttribute('propVoucherNo'))
			{
				param += "&propVoucherNo="+obj.getAttribute('propVoucherNo');
			}
			var myurl = "Func/UpdateStatus/resendEmail.php";
			var http = new getXMLHTTPRequest();
			http.onreadystatechange = function() {if (http.readyState != 4) { return; }
				$('ly-popresendemail-processing').style.display = 'none';
				$('ly-popresendemail-complete').style.display = '';
			};
			http.open("POST", myurl, true);
			http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			http.send(param+"&"+(+new Date()));
			break;

		case 2:
			$('ly-popresendemail').style.visibility = 'hidden';
			JB.setPageOverlay(false);
			break;
	}

}
JB.editReference = function(obj, mode){
	if (!mode)
	{
		mode = 1;
	}
	$('ly-popreference-input').style.display = 'none';
	$('ly-popreference-processing').style.display = 'none';
	$('ly-popreference-complete').style.display = 'none';

	switch (mode)
	{
		case 1:
			JB.setPageOverlay(true);
			$('ly-popreference-ConfirmNo').innerHTML = obj.getAttribute('propConfirmNo');
			$('ly-popreference-DocID').innerHTML = obj.getAttribute('propDocID');
			$('txtHotelRefNo').value = obj.getAttribute('propSupRef');
			$('btnHotelRefNo').setAttribute('propConfirmNo', obj.getAttribute('propConfirmNo'));
			$('btnHotelRefNo').setAttribute('propDocID', obj.getAttribute('propDocID'));
			$('btnHotelRefNo').setAttribute('propSupRef', obj.getAttribute('propSupRef'));
			$('ly-popreference-input').style.display = '';
			$('ly-popreference').style.visibility = '';
			window.location.hash = 'pagetop';
			break;
		case 2:
			$('ly-popreference-processing').style.display = '';

			var param = "ConfirmNo="+obj.getAttribute('propConfirmNo');
			param += "&DocID="+obj.getAttribute('propDocID');
			param += "&HotelRefNo="+$('txtHotelRefNo').value;
			var myurl = "Func/UpdateStatus/updateHotelReference.php";
			var http = new getXMLHTTPRequest();
			http.onreadystatechange = function() {if (http.readyState != 4) { return; }
				$('ly-popreference-processing').style.display = 'none';
				$('ly-popreference-complete').style.display = '';
				$('imgReference-'+obj.getAttribute('propDocID')).setAttribute('propSupRef', $('txtHotelRefNo').value);
			};
			http.open("POST", myurl, true);
			http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			http.send(param+"&"+(+new Date()));

			break;
		case 3:
			$('ly-popreference').style.visibility = 'hidden';
			JB.setPageOverlay(false);
			break;
	}
}
JB.getPageSize = function () {
	var xScroll, yScroll;
	if (window.innerHeight && window.scrollMaxY) {
		xScroll = window.innerWidth + window.scrollMaxX;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	var windowWidth, windowHeight;
	if (self.innerHeight) { // all except Explorer
		if(document.documentElement.clientWidth){
			windowWidth = document.documentElement.clientWidth;
		} else {
			windowWidth = self.innerWidth;
		}
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else {
		pageHeight = yScroll;
	}
	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){
		pageWidth = xScroll;
	} else {
		pageWidth = windowWidth;
	}
	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
	return arrayPageSize;
};
JB.setPageOverlay = function (bF) {
	if (bF)
	{
		var arrayPageSize = JB.getPageSize();
		$('ly-popbg').style.width = arrayPageSize[0]+'px';
		$('ly-popbg').style.height = arrayPageSize[1]+'px';
		$('ly-popbg').style.visibility = '';
	} else {
		$('ly-popbg').style.visibility = 'hidden';
		$('ly-popbg').style.height = '0px';
	}
}
JB.cancelHotelBooking = function(obj, mode){
	if (!mode)
	{
		mode = 1;
	}
	$('ly-popcxlbooking-input').style.display = 'none';
	$('ly-popcxlbooking-processing').style.display = 'none';
	$('ly-popcxlbooking-complete').style.display = 'none';

	switch (mode)
	{
		case 1:
			JB.setPageOverlay(true);
			$('ly-popcxlbooking-ConfirmNo').innerHTML = obj.getAttribute('propConfirmNo');
			$('ly-popcxlbooking-DocID').innerHTML = obj.getAttribute('propDocID');
			$('btnCxlBooking').setAttribute('propConfirmNo', obj.getAttribute('propConfirmNo'));
			$('btnCxlBooking').setAttribute('propDocID', obj.getAttribute('propDocID'));
			$('btnCxlBooking').setAttribute('propCompanyCode', obj.getAttribute('propCompanyCode'));
			$('ly-popcxlbooking-input').style.display = '';
			$('ly-popcxlbooking').style.visibility = '';
			$('ly-popcxlbooking-complete').setAttribute('propProcess', '');
			window.location.hash = 'pagetop';
			break;
		case 2:
			$('ly-popcxlbooking-processing').style.display = '';

			var param = "ConfirmNo="+obj.getAttribute('propConfirmNo');
			param += "&DocID="+obj.getAttribute('propDocID');
			param += "&CompanyCode="+obj.getAttribute('propCompanyCode');
			var myurl = "Func/UpdateStatus/cancelHotelBooking.php";
			var http = new getXMLHTTPRequest();
			http.onreadystatechange = function() {if (http.readyState != 4) { return; }
				$('ly-popcxlbooking-processing').style.display = 'none';
				$('ly-popcxlbooking-complete').style.display = '';
				$('ly-popcxlbooking-complete').setAttribute('propProcess', '1');
			};
			http.open("POST", myurl, true);
			http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			http.send(param+"&"+(+new Date()));

			break;
		case 3:
			$('ly-popcxlbooking').style.visibility = 'hidden';
			JB.setPageOverlay(false);
			if (obj.getAttribute('propProcess') == '1')
			{
				refreshNeptune();
				return;
			}
			break;
	}
}

