//  Popup Window
function OpenWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}

//  Popup Window with same features
function Gallery()
{
window.open("/Sama/Templates/Photo.aspx","Gal","top=150,left=250,width=350,height=500,scrollbars=1");
}


function over(i){
	i.style.backgroundColor="#A6BC09"
	i.style.cursor="hand"
}

function validateSearchField(id)
{
	var txt = document.all(id);
     if (txt.value.length < 3)
     {
        alert('<%= alert %>');
        return false;
     }
}

function out(i){
	i.style.backgroundColor=""
	i.style.cursor="hand"
}

function down(i){
	i.style.backgroundColor=""
	i.style.cursor="hand"
}

function up(i){
	i.style.backgroundColor=""
	i.style.cursor="hand"
}

// script for search button

function over2(i){
	i.style.backgroundColor="#E27120"
	i.style.cursor="hand"
}

function out2(i){
	i.style.backgroundColor=""
	i.style.cursor="hand"
}




// ******************* Added script for booking engine *******//

// ****************** ibeframe\func.js *************************//
	function imgchng(name, src){
	document[name].src = src;
}

function popbill(pop){
	var i;
	
	if (pop){
		document.forms[0].txtCardholder.value = p1fn + ' ' + p1mn + ' ' + p1ln;
		document.forms[0].txtAddr1.value = p1a1;
		document.forms[0].txtAddr2.value = p1a2;
		document.forms[0].txtCity.value = p1ct;
		document.forms[0].txtPCode.value = p1pc;
		document.forms[0].txtPhone.value = p1ph;		
		document.forms[0].lstProv.selectedIndex = p1pr;	
		inner: for(i = 0; i < document.forms[0].lstCtry.length; i++){
			if(document.forms[0].lstCtry.options[i].value == p1cn){
				document.forms[0].lstCtry.options[i].selected = true;
				break inner;
			}
		}
		inner: for(i = 0; i < document.forms[0].lstProv.length; i++){
			if(document.forms[0].lstProv.options[i].value == p1pr){
				document.forms[0].lstProv.options[i].selected = true;
				break inner;
			}
		}
	}
	else{
		document.forms[0].txtCardholder.value = '';
		document.forms[0].txtAddr1.value = '';
		document.forms[0].txtAddr2.value = '';
		document.forms[0].txtCity.value = '';
		document.forms[0].txtPCode.value = '';
		document.forms[0].txtPhone.value = '';		
		document.forms[0].lstProv.selectedIndex = 0;
		document.forms[0].lstCtry.selectedIndex = 0;
	}
}

function chnmn(lang){
	var page;
	page = location.href;
	page = page.substr(page.lastIndexOf('/')+1,page.indexOf('.',page.lastIndexOf('/'))-page.lastIndexOf('/')-1);
	parent.updmn(page.toLowerCase(),lang);
}
// ****************** ibeframe\func.js *************************//

//**************************************************************//

// ****************** 1k_standards.js *************************//
// 1k DHTML API - standards version
d=document;l=d.layers;op=navigator.userAgent.indexOf('Opera')!=-1;px='px';
function gE(e,f){var t;if(l){f=(f)?f:self;var V=f.document.layers;if(V[e])return V[e];for(var W=0;W<V.length;)t=gE(e,V[W++]);return t;}if(d.all)return d.all[e];return d.getElementById(e);}
function sE(e){l?e.visibility='show':e.style.visibility='visible';}
function hE(e){l?e.visibility='hide':e.style.visibility='hidden';}
function sZ(e,z){l?e.zIndex=z:e.style.zIndex=z;}
function sX(e,x){l?e.left=x:op?e.style.pixelLeft=x:e.style.left=x+px;}
function sY(e,y){l?e.top=y:op?e.style.pixelTop=y:e.style.top=y+px;}
function sW(e,w){l?e.clip.width=w:op?e.style.pixelWidth=w:e.style.width=w+px;}
function sH(e,h){l?e.clip.height=h:op?e.style.pixelHeight=h:e.style.height=h+px;}
function sC(e,t,r,b,x){l?(X=e.clip,X.top=t,X.right=r,X.bottom=b,X.left=x):e.style.clip='rect('+t+px+' '+r+px+' '+b+px+' '+x+px+')';}
function wH(e,h){if(l){Y=e.document;Y.open();Y.write(h);Y.close();}if(e.innerHTML)e.innerHTML=h;}

// ****************** 1k_standards.js *************************//

//**************************************************************//

// ****************** Datapicker_combo ************************//
// Title: Timestamp picker
// Description: See the demo at url
// URL: http://www.softcomplex.com/products/tigra_calendar/
// Version: 1.0.a (Date selector only)
// Date: 12-12-2001 (mm-dd-yyyy)
// Author: Denis Gritcyuk <denis@softcomplex.com>
// Notes: Permission given to use this script in any kind of applications if
//    header lines are left unchanged. Feel free to contact the author
//    for feature requests and/or donations
//
// Jonathan Markevich - Sept 11, 2003
//   Changed to modify combo boxes instead of a text box
//   Changed the input date format to yyyy/mm/dd
//   Added datepicker_init() function to insert different language weekday abbreviations
//
//   - Dec 30, 2003
//  Removed hyperlinks to months other than the current.
//   - Mar 12, 2004
//   Added styles block

var arr_months;
var week_days;
var n_weekstart; // day week starts from (normally 0 or 1)

var ctrl_day;
var ctrl_month;
var str_styles ="";
var str_dflt_style = ".wke{background:#DBEAF5;text-align:right;font-size:9pt;}"+
".wkd{background:#fff;text-align:right;font-size:9pt;}";

datepicker_init('en');
function show_calendar(str_target,str_datetime) {
	
	var dt_datetime = (str_datetime == null || str_datetime =="" ?  new Date() : str2dt4(str_datetime));
	var dt_prev_month = new Date(dt_datetime);

	// Control names
	ctrl_day = new String("window.opener.document.getElementById('" + str_target + "_Day')");
	ctrl_month = new String("window.opener.document.getElementById('" + str_target + "_Month')");
	
        dt_prev_month.setMonth(dt_datetime.getMonth()-1);

	if (dt_datetime.getMonth()%12 != (dt_prev_month.getMonth()+1)%12) {
		dt_prev_month.setMonth(dt_datetime.getMonth());
		dt_prev_month.setDate(0);
	}
	
	var dt_next_month = new Date(dt_datetime);
	dt_next_month.setMonth(dt_datetime.getMonth()+1);
	if ((dt_datetime.getMonth() + 1)%12 != dt_next_month.getMonth()%12)
		dt_next_month.setDate(0);
	
	var dt_firstday = new Date(dt_datetime);
	dt_firstday.setDate(1);
	dt_firstday.setDate(1-(7+dt_firstday.getDay()-n_weekstart)%7);
	var dt_lastday = new Date(dt_next_month);
	dt_lastday.setDate(0);
		
	// html generation (feel free to tune it for your particular application)
	// print calendar header
	var str_buffer = new String (
		"<html><head><title>Calendar</title>\n"+
		"<script>\n"+
		"  var dt_new = new Date('"+dt_datetime+"');\n"+
		"  var dt_diff=new Date();\n"+
		"  var i_months = ((12-dt_diff.getMonth()+dt_new.getMonth())%12);\n"+	
		"</script>\n"+
        "<style>body{background:white;font-family:Tahoma,Helvetica,sans-serif}\n"+
        "table{padding:0;border-width:1px;width:100%;}\ntd{padding:3px;}"+
        ".wkd, .wke {color:#ccc;font-size:9pt}\n"+
        ".wkd a,.wke a{color:#000;}\n"+
        str_styles+"</style>\n"+
		"</head>\n"+
		"<body>\n"+
		"<table class=\"clsOTable\">\n"+
		"<tr><td bgcolor=\"#4682B4\">\n"+
		"<table cellspacing=\"1\" >\n"+
		"<tr>\n	<td bgcolor=\"#4682B4\"><a href=\"javascript:window.opener.show_calendar('"+
		str_target+"', '"+ dt2dtstr4(dt_prev_month)+"');\">"+
		"<img src=\"/sama/images/prev.gif\" width=\"16\" height=\"16\" border=\"0\""+
		" alt=\"previous month\"></a></td>\n"+
		"	<td bgcolor=\"#4682B4\" colspan=\"5\">"+
		"<font color=\"white\">"
		+arr_months[dt_datetime.getMonth()]+" "+dt_datetime.getFullYear()+"</font></td>\n"+
		"	<td bgcolor=\"#4682B4\" align=\"right\"><a href=\"javascript:window.opener.show_calendar('"
		+str_target+"', '"+dt2dtstr4(dt_next_month)+"');\">"+
		"<img src=\"/sama/images/next.gif\" width=\"16\" height=\"16\" border=\"0\""+
		" alt=\"next month\"></a></td>\n</tr>\n"
	);
		
    var dt_current_day = new Date(dt_firstday);
	// print weekdays titles
	str_buffer += "<tr>\n";
	for (var n=0; n<7; n++)
		str_buffer += "	<td bgcolor=\"#87CEFA\">"+
		"<font color=\"white\" size=\"2\">"+
		week_days[(n_weekstart+n)%7]+"</font></td>\n";
	// print calendar table
	str_buffer += "</tr>\n";
	while (dt_current_day.getMonth() == dt_datetime.getMonth() ||
		dt_current_day.getMonth() == dt_firstday.getMonth()) {
		// print row header
		str_buffer += "<tr>\n";
		for (var n_current_wday=0; n_current_wday<7; n_current_wday++) {
				//if (dt_current_day.getDate() == dt_datetime.getDate() &&
				//	dt_current_day.getMonth() == dt_datetime.getMonth())
					// print current date
				//	str_buffer += "	<td bgcolor=\"#FFB6C1\" align=\"right\">";
				//else 
                if (dt_current_day.getDay() == 0 || dt_current_day.getDay() == 6)
					// weekend days
					str_buffer += "	<td class=\"wke\">";
				else
					// print working days of current month
					str_buffer += "	<td class=\"wkd\">";

				if (dt_current_day.getMonth() == dt_datetime.getMonth())
					// print days of current month
					str_buffer += "<a href=\"javascript:"+setcombos(str_target,dt_current_day)+"i_months; window.close();\">"+
                    dt_current_day.getDate()+"</a></td>\n";
				else 
					// print days of other months
					/* Change to adjust the combo boxes instead of changing the textboxes */
					str_buffer += ""+
                    dt_current_day.getDate()+"</td>\n";
                    
				dt_current_day.setDate(dt_current_day.getDate()+1);
		}
		// print row footer
		str_buffer += "</tr>\n";
	}
	// print calendar footer
	str_buffer +=
		"</table>\n" +
		"</tr>\n</td>\n</table>\n" +
		"</body>\n" +
		"</html>\n";

	var vWinCal = window.open("", "Calendar", 
		"width=200,height=250,status=no,resizable=yes,top=200,left=200");
	vWinCal.opener = self;
	vWinCal.focus();
	var calc_doc = vWinCal.document;
	calc_doc.write (str_buffer);
	calc_doc.close();
}

function dt2dtstr4 (dt_datetime) {
	return (new String (
			(dt_datetime.getFullYear()+"/"+(dt_datetime.getMonth()+1)+"/"+dt_datetime.getDate())));
}

function datepicker_init(langcode) {
	switch (langcode) {
		case 'en':
			arr_months = "January,February,March,April,May,June,July,August,September,October,November,December".split(",");
			week_days = "Su,Mo,Tu,We,Th,Fr,Sa".split(",");
			n_weekstart = 6;
            str_styles = str_dflt_style;
		break;

		case 'ar':
			arr_months = "&#1610;&#1606;&#1575;&#1610;&#1585;,&#1601;&#1576;&#1585;&#1575;&#1610;&#1585;,&#1605;&#1575;&#1585;&#1587;,&#1575;&#1576;&#1585;&#1610;&#1604;,&#1605;&#1575;&#1610;&#1608;,&#1610;&#1608;&#1606;&#1610;&#1608;,&#1610;&#1608;&#1604;&#1610;&#1608;,&#1571;&#1594;&#1587;&#1591;&#1587;,&#1587;&#1576;&#1578;&#1605;&#1576;&#1585;,&#1606;&#1608;&#1601;&#1605;&#1576;&#1585;,&#1571;&#1603;&#1578;&#1608;&#1576;&#1585;,&#1583;&#1610;&#1587;&#1605;&#1576;&#1585;".split(",");
			week_days = "Su,Mo,Tu,We,Th,Fr,Sa".split(",");
			n_weekstart = 6; 
            str_styles="\n.clsOTable{direction:rtl;}"+
            "\n.wke,.wkd{background:white;text-align:right;font-size:9pt;}";
            
		break;

		default:
		break;
	}
}

// Set the combo boxes to the picked values
function setcombos(str_control,dt_datetime) {
	
	return ctrl_day + ".selectedIndex="+ (dt_datetime.getDate()-1) +";" + ctrl_month + ".selectedIndex=";
}

function changeDates(dp, rt) {
	var offset = 0;
    var dm=gE(dp+"_Month"); var rm=gE(rt+"_Month");
    var dln = dm.value.length;
    var mth = dm.value.substring(dln-2,dln);  
    
    rm.selectedIndex = dm.selectedIndex;
    
    var day = parseInt(gE(dp+"_Day").value,10) + offset;
    var d = new Date(dm.value + "/" + day);
    
    gE(rt+"_Day").selectedIndex=d.getDate()-1;
    
    if (d.getMonth()+1 > parseInt(mth,10)) {rm.selectedIndex += 1;}
}
// ****************** Datapicker_combo ************************//

//*************************************************************//

// ****************** func.js ********************************//
function imgchng(name, src){
	document[name].src = src;
}

function popbill(pop){
	var i;
	
	if (pop){
		document.forms[0].txtCardholder.value = p1fn + ' ' + p1mn + ' ' + p1ln;
		document.forms[0].txtAddr1.value = p1a1;
		document.forms[0].txtAddr2.value = p1a2;
		document.forms[0].txtCity.value = p1ct;
		document.forms[0].txtPCode.value = p1pc;
		document.forms[0].txtPhone.value = p1ph;		
		document.forms[0].lstProv.selectedIndex = p1pr;	
		inner: for(i = 0; i < document.forms[0].lstCtry.length; i++){
			if(document.forms[0].lstCtry.options[i].value == p1cn){
				document.forms[0].lstCtry.options[i].selected = true;
				break inner;
			}
		}
		inner: for(i = 0; i < document.forms[0].lstProv.length; i++){
			if(document.forms[0].lstProv.options[i].value == p1pr){
				document.forms[0].lstProv.options[i].selected = true;
				break inner;
			}
		}
	}
	else{
		document.forms[0].txtCardholder.value = '';
		document.forms[0].txtAddr1.value = '';
		document.forms[0].txtAddr2.value = '';
		document.forms[0].txtCity.value = '';
		document.forms[0].txtPCode.value = '';
		document.forms[0].txtPhone.value = '';		
		document.forms[0].lstProv.selectedIndex = 0;
		document.forms[0].lstCtry.selectedIndex = 0;
	}
}

function chnmn(lang){
	var page;
	page = location.href;
	page = page.substr(page.lastIndexOf('/')+1,page.indexOf('.',page.lastIndexOf('/'))-page.lastIndexOf('/')-1);
	parent.updmn(page.toLowerCase(),lang);
}
// ****************** func.js ********************************//

//************************************************************//

// ******************* main.js *******************************//
function updmn(page,lang){
	var i, p, b = false;
	
	switch (page){
		case 'ibeframe':
			p = 1;
			break;
		case 'valueviewer':
			b = true;
			p = 1;
			break;
		case 'traveloptions':
			b = true;
			p = 2;
			break;
		case 'details':
			b = true;
			p = 3;
			break;
		case 'seatassignment':
			b = true;
			p = 4;
			break;
		case 'payments':
			b = true;
			p = 5;
			break;
		case 'confirm':
			b = true;
			p = 6;
			break;
		case 'itinerary':
			b = true;
			p = 7;
			break;
		default:
			p = 0;
	}

	if(p > 0){
		for(i = 1; i < 8; i++){
			if(p == i){
				parent.document.getElementById('prognum' + i).className = 'number selected';
				parent.document.getElementById('progstr' + i).className = 'status-text selected-text';
			}
			else {
				parent.document.getElementById('prognum' + i).className = 'number';
				parent.document.getElementById('progstr' + i).className = 'status-text';
			}
		}
		identity = parent.document.getElementById('contentprog').className = '';
	}
	else{
		parent.document.getElementById('contentprog').className = 'hidden';
	}
	if(b){
		popinfo(page,lang);
	}
	else{
		clrinfo();
	}
}

function popinfo(page,lang){
	//fHideDiv("msghdrs", hdrDivVis); hdrDivVis = false;

	//document.getElementById('sbinfo').innerHTML = "<h2>Searching....Please Wait</h2>";
	//fShowDiv("msghdrs", hdrDivVis); hdrDivVis = true;        

	fMakeRequest('TravelInfo.aspx?lang=' + lang + '&page=' + page,fMsgHdrCallback);        
}

function clrinfo(){
	document.getElementById('sbinfo').innerHTML = '';
	document.getElementById('sbinfo').className = 'hidden';	
}

//http://www.mozilla.org/docs/dom/domref/dom_doc_ref50.html

// AJAX setup
var http_request = false;		// holder for the request regardless of browser

function fMakeRequest(aRequestUrl,theCallBackFunction) {
	if(window.XMLHttpRequest) { // Mozilla, Safari, etc
		http_request = new XMLHttpRequest();
		if(http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	}
	else if(window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Mxsml2.XMLHTTP");
		}
		catch (e) {
			try {
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e) {}
		}
	}

	if(!http_request) {
		alert("Can't create XmlHttp instance!");
		return false;
	}

	http_request.onreadystatechange = theCallBackFunction;
	http_request.open('GET', aRequestUrl, true);
	http_request.send(null);
}

function fMsgHdrCallback() {
	if(http_request.readyState == 4) {
		if(http_request.status == 200) {
			document.getElementById("sbinfo").innerHTML = http_request.responseText;
			//fShowDiv("msghdrs", hdrDivVis); hdrDivVis = true;
			
			document.getElementById('sbinfo').className = '';	
		}
		else {            
			document.getElementById("sbinfo").innerHTML = "<h2>Error Retrieving Results</h2>";
			//fShowDiv("msghdrs", hdrDivVis); hdrDivVis = true;
	    
			document.getElementById('sbinfo').className = 'hidden';
			alert('Problem with the request.  Status Code Returned: ' + http_request.status);            
		}
	}
} // function fMsgHdrCallback() {

/*
http://www.objectgraph.com/dictionary/
http://developer.mozilla.org/en/docs/AJAX:Getting_Started	
*/
// ******************* main.js *******************************//

//************************************************************//

// ******************** validation.js ************************//
// Date validation from http://javascript.internet.com/forms/val-date.html
// Other validation:
// Found on http://developer.netscape.com/docs/examples/javascript/formval/overview.html
// (c) 1997 Netscape Communications Corporation

var digits = "0123456789";
var whitespace = " \t\n\r";

function isEmpty(s)  {   return ((s == null) || (s.length == 0))  }
function isDigit(c)  {   return ((c >= "0") && (c <= "9"))        }

function isWhitespace (s){
   var i;
   if (isEmpty(s)) return true;

   for (i = 0; i < s.length; i++)
   {   
      // Check that current character isn't whitespace.
      var c = s.charAt(i);
      if (whitespace.indexOf(c) == -1) return false;
   }
   return true;
}


function isInteger (s){
   var i;

   if (isEmpty(s)) 
      if (isInteger.arguments.length == 1) return false;
      else return (isInteger.arguments[1] == true);

   for (i = 0; i < s.length; i++)
   {   
      // Check that current character is number.
      var c = s.charAt(i);
      if (!isDigit(c)) return false;
   }
   // All characters are numbers.
   return true;
}

function isEmail (s) {
   if (isEmpty(s)) 
      if (isEmail.arguments.length == 1) return false;
      else return (isEmail.arguments[1] == true);
   
   if (isWhitespace(s)) return false;
    
   var i = 1;
   var sLength = s.length;

   // look for @
   while ((i < sLength) && (s.charAt(i) != "@"))    {  i++  }

   if ((i >= sLength) || (s.charAt(i) != "@")) return false;
   else i += 2;

   while ((i < sLength) && (s.charAt(i) != "."))    {  i++  }

   if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
   else return true;
}

// datetime parsing and formatting routimes. modify them if you wish other datetime format
function str2dt4 (str_datetime) {
	var re_date = /^(\d+)\/(\d+)\/(\d+)$/;
	if (!re_date.exec(str_datetime))
		return alert("Invalid Datetime format: "+ str_datetime);
	return (new Date (RegExp.$1, RegExp.$2-1, RegExp.$3));
}
//  End -->

// ******************** validation.js ************************//

//************************************************************//

// ******************** wait.js ******************************//
var waitwin = null;

// Create popup wait window
function pop(params) {}

// Remove previous popup window when entering page
function unpop() {}

// Used for Verisign
function chkVerisign(url) {
	sealWin=window.open(url,'win','toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
	self.name = 'mainWin';
}

// Popup terms window - copy Wait window code for unpop() reuse
function terms(params) {
	var w, h;

	if (document.all || document.layers) {
		w = screen.availWidth;
		h = screen.availHeight;
	} else {
		w = screen.width;
		h = screen.height;
	}	

	// Center window
	var popW = 600, popH = 550;
	var leftPos = (w-popW)/2, topPos = (h-popH)/2;
    var url = params;
    
	waitwin = window.open(url, '_wait', 'toolbar=no,location=no,menubar=no,status=no,scrollbars=1,'+'width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos);
}

// Method to show ViewCharges page for the Edit Website.../
function showCharges() {
	var  w, h;

	if (document.all || document.layers) {
		w = screen.availWidth;
		h = screen.availHeight;
	} else {
		w = screen.width;
		h = screen.height;
	}	

	// Center window
		var popW = 620;
		var popH = 500;
		var popH;
		var leftPos = (w-popW)/2, topPos = h/5;
	
		var dimensions = "width=" + popW +
						 ", height=" + popH +
						 ",top=" + topPos +
						 ",left=" + leftPos;				
								
		chargeWindow = window.open('ViewCharges.aspx', 'chargeWindow', 'location=no,toolbar=no,status=no,resizable=no,scrollbars=yes,'+ dimensions);
		chargeWindow.focus()
		}

// Method to show Window to select number of paxs for the Edit Website.../
function selectPaxNumber() {
	var  w, h;

	if (document.all || document.layers) {
		w = screen.availWidth;
		h = screen.availHeight;
	} else {
		w = screen.width;
		h = screen.height;
	}	

	// Center window
		var popW = 580; 
		var popH = 200;
		var leftPos = (w-popW)/2, topPos = (h-popH)/2;
	
		var dimensions = "width=" + popW +
						 ", height=" + popH +
						 ",top=" + topPos +
						 ",left=" + leftPos;	
				 			
								
		addPaxNumWindow = window.open('AddPaxPrompt.aspx', 'addPaxNumWindow', 'toolbar=no,status=no,scrollbars=no,resizable=no,'+ dimensions);
		//addPaxNumWindow = window.open('AddPaxPrompt.html', 'addPaxNumWindow', 'toolbar=no,status=no,scrollbars=no,resizable=yes','width=200,height=200,screenX=400,screenY=400,top=400,left=400');
		addPaxNumWindow.focus()
		}
		
function unloadPaxNumber() {
	// Find existing window
	addPaxNumWindow = window.open('AddPaxPrompt.aspx', 'addPaxNumWindow');

	if (addPaxNumWindow != null && addPaxNumWindow.open) 	addPaxNumWindow.close();
}

// create popup window to search for pax
function paxsearch(url, pax) {
	var searchwin
	var w, h;

	if (document.all || document.layers) {
		w = screen.availWidth;
		h = screen.availHeight;
	} else {
		w = screen.width;
		h = screen.height;
	}	

	// Center window
	var popW = 850, popH = 400;
	var leftPos = (w-popW)/2, topPos = (h-popH)/2;
        
	searchwin = window.open(url + '&pax=' + pax + '&paxid=' + document.forms[0].elements['hidPax' + pax + '_Search'].value + '&fname=' + document.forms[0].elements['txtPax' + pax + '_FName'].value + '&lname=' + document.forms[0].elements['txtPax' + pax + '_LName'].value + '&phone1=' + document.forms[0].elements['txtPax' + pax + '_Phone1'].value + '&phone2=' + document.forms[0].elements['txtPax' + pax + '_Phone2'].value, '_paxsearch', 'location=no,toolbar=no,status=yes,scrollbars=yes,resizable=no,'+'width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos);
}

// Method to open the email page for the Edit Website, this also sends the email.../
function openEmailPage(url) {
	var  w, h;

	if (document.all || document.layers) {
		w = screen.availWidth;
		h = screen.availHeight;
	} else {
		w = screen.width;
		h = screen.height;
	}	

	// Center window
		var popW = 520;
		var popH = 300;
		var popH;
		var leftPos = (w-popW)/2, topPos = h/5;
	
		var dimensions = "width=" + popW +
						 ", height=" + popH +
						 ",top=" + topPos +
						 ",left=" + leftPos;				
								
		emailWindow = window.open(url, 'emailWindow', 'location=no,toolbar=no,status=no,resizable=no,scrollbars=yes,'+ dimensions);
		emailWindow.focus()
	}
	
// Method to open the email confirmation window for the Edit Website.../
function openEmailConfirmPage(url) {
	var  w, h;

	if (document.all || document.layers) {
		w = screen.availWidth;
		h = screen.availHeight;
	} else {
		w = screen.width;
		h = screen.height;
	}	

	// Center window
		var popW = 650;
		var popH = 500;
		var popH;
		var leftPos = (w-popW)/2, topPos = h/5;
	
		var dimensions = "width=" + popW +
						 ", height=" + popH +
						 ",top=" + topPos +
						 ",left=" + leftPos;				
								
		emailWindow = window.open(url, 'emailConfirmWindow', 'location=no,toolbar=no,status=no,resizable=no,scrollbars=yes,'+ dimensions);
		emailWindow.focus()
	}
	
function unloadConfirmWindow() {
// Find existing window
	emailConfirmWindow = window.open('EWConfimEditItin.aspx', 'emailConfirmWindow');

	if (emailConfirmWindow != null && emailConfirmWindow.open) 	emailConfirmWindow.close();
}

// Method to open the window for emailing the userprofile password.../
function openPasswordReminderPage(url) {
	var  w, h;

	if (document.all || document.layers) {
		w = screen.availWidth;
		h = screen.availHeight;
	} else {
		w = screen.width;
		h = screen.height;
	}	

	// Center window
		var popW = 520;
		var popH = 300;
		var popH;
		var leftPos = (w-popW)/2, topPos = h/5;
	
		var dimensions = "width=" + popW +
						 ", height=" + popH +
						 ",top=" + topPos +
						 ",left=" + leftPos;				
								
		emailWindow = window.open(url, 'emailPasswordWindow', 'location=no,toolbar=no,status=no,resizable=no,scrollbars=yes,'+ dimensions);
		emailWindow.focus()
	}
/*	
function unloadPasswordReminderPage() {
// Find existing window
	emailPasswordWindow = window.open('UserProfileEmailPassword.aspx', 'emailPasswordWindow');

	if (emailPasswordWindow != null && emailPasswordWindow.open) 	emailPasswordWindow.close();
}

// Method to open the window for emailing the userprofile password.../
function openPasswordConfirmPage(sUrl) {
	var  w, h;

	if (document.all || document.layers) {
		w = screen.availWidth;
		h = screen.availHeight;
	} else {
		w = screen.width;
		h = screen.height;
	}	

	// Center window
		var popW = 650;
		var popH = 300;
		var popH;
		var leftPos = (w-popW)/2, topPos = h/5;
	
		var dimensions = "width=" + popW +
						 ", height=" + popH +
						 ",top=" + topPos +
						 ",left=" + leftPos;				
								
		emailWindow = window.open(sUrl, 'PasswordConfirmWindow', 'location=no,toolbar=no,status=no,resizable=no,scrollbars=yes,'+ dimensions);
		emailWindow.focus()
	}
*/	
// Method to open the window for update the userprofile from the itinerary page.../
function openProfileUpdatePage(sUrl) {
	var  w, h;

	if (document.all || document.layers) {
		w = screen.availWidth;
		h = screen.availHeight;
	} else {
		w = screen.width;
		h = screen.height;
	}	

	// Center window
		var popW = 520;
		var popH = 300;
		var popH;
		var leftPos = (w-popW)/2, topPos = h/5;
	
		var dimensions = "width=" + popW +
						 ", height=" + popH +
						 ",top=" + topPos +
						 ",left=" + leftPos;				
								
		UpdateProfileWindow = window.open(sUrl, 'UpdateProfileWindow', 'location=no,toolbar=no,status=no,resizable=no,scrollbars=yes,'+ dimensions);
		UpdateProfileWindow.focus()
	}


// Others Menu 

var menuids=["treemenu1"] //Enter id(s) of SuckerTree UL menus, separated by commas

function buildsubmenus_horizontal(){
for (var i=0; i<menuids.length; i++){
  var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
		if (ultags[t].parentNode.parentNode.id==menuids[i]){ //if this is a first level submenu
			ultags[t].style.top=ultags[t].parentNode.offsetHeight+"px" //dynamically position first level submenus to be height of main menu item
			ultags[t].parentNode.getElementsByTagName("a")[0].className="mainfoldericon"
		}
		else{ //else if this is a sub level menu (ul)
		  ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
    	ultags[t].parentNode.getElementsByTagName("a")[0].className="subfoldericon"
		}
    ultags[t].parentNode.onmouseover=function(){
    this.getElementsByTagName("ul")[0].style.visibility="visible"
    }
    ultags[t].parentNode.onmouseout=function(){
    this.getElementsByTagName("ul")[0].style.visibility="hidden"
    }
    }
  }
}

if (window.addEventListener)
window.addEventListener("load", buildsubmenus_horizontal, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus_horizontal)

// ******************** wait.js ******************************//

//************************************************************//

// ******************* Page Scripts **************************//

// ******************* Page Scripts **************************//
// ******************* Added script for booking engine *******//