function newWindow(mypage, myname, w, h, scroll) {
	var winl = (screen.width - w) / 18;
	var wint = (screen.height - h) /16;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',status=yes , scrollbars='+scroll+',resizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function airportlookup(aformfieldname) {
	airport_window = window.open('air_charter_Airportlookup.aspx?formname=' + aformfieldname,'airport_window','width=530,height=500,scrollbars=yes,resizable=1');
	airport_window.focus();
}

function airportlookuprunonchange(aformfieldname) {
	airport_window = window.open('air_charter_Airportlookup.aspx?runonchange=true&formname=' + aformfieldname,'airport_window','width=530,height=500,scrollbars=yes,resizable=1');
	airport_window.focus();
}


function airportlookuprestart(aformfieldname) {
	airport_window = window.open('air_charter_Airportlookup.aspx?restart=true&formname=' + aformfieldname,'airport_window','width=530,height=500,scrollbars=yes,resizable=1');
	airport_window.focus();
}

function calendarpopup(aformfieldname) {
	calwindow = window.open('CACalendar.aspx?formname=' + aformfieldname,'calwindow','width=200,height=250');
	calwindow.focus();
}

function calendarpopuptriprequest(aformfieldname) {
	calwindow = window.open('DateTimePicker.aspx?restart=true&formname=' + aformfieldname,'calwindow','width=350,height=250');
	calwindow.focus();
}

function calendartimepopup(aformfieldname, anoptvalue) {
    var optvalue;
    optvalue = new String(anoptvalue)
    if (optvalue != 'undefined') {
        optvalue = anoptvalue;
    } else {
        optvalue = '';
    }

    caltimewindow = window.open('DateTimePicker.aspx?formname=' + aformfieldname + '&optvalue=' + optvalue, 'calwindow', 'width=350,height=250');
	caltimewindow.focus();
}

function ancillariespopup(aBookingID, lnk) {
	ancillarieswindow = window.open('CABookingCater.aspx?BookingID=' + aBookingID + '#' + lnk ,'ancillarieswindow','width=850,height=500,scrollbars=yes,resizable=1');
	ancillarieswindow.focus();
}

function bookingpaxpopup(aBookingID) {
	paxwindow = window.open('CABookingPax.aspx?BookingID=' + aBookingID,'paxwindow','width=800,height=500,scrollbars=yes');
	paxwindow.focus();
}

function setbidgrouplegspopup(aRfqID, aBidGroupID) {
	bidgrouplegswindow = window.open('SetBidGroupLegsPU.aspx?RfqID=' + aRfqID + '&BidGroupID=' + aBidGroupID,'bidgrouplegswindow','width=600,height=500,scrollbars=yes');
	bidgrouplegswindow.focus();
}

/*Users that are operators*/
function useroperatorlookup(aformfieldname) {
	user_window = window.open('UserOperatorLookupPU.aspx?restart=true&formname=' + aformfieldname,'user_window','width=500,height=500');
	user_window.focus();
}

function OneStat_Pageview() {
    var d=document;
    var sid="296171"
    var CONTENTSECTION="";
    var CUSTOMDATA="";
    var osp_URL= d.URL;
    var osp_Title= d.title;
    var t=new Date();
    var p="http"+(document.URL.indexOf('https:')==0?'s':'')+"://stat.onestat.com/stat.aspx?tagver=2&sid="+sid;
    p+="&url="+escape(osp_URL);
    p+="&ti="+escape(osp_Title);
    p+="&section="+escape(CONTENTSECTION);
    p+="&custom="+escape(CUSTOMDATA);
    p+="&rf="+escape(parent==self?window.document.referrer:top.document.referrer);
    p+="&tz="+escape(t.getTimezoneOffset());
    p+="&ch="+escape(t.getHours());
    p+="&js=1";
    p+="&ul="+escape(navigator.appName=="Netscape"?navigator.language:navigator.userLanguage);
    if (osp_URL!=d.URL)
        p+="&ol="+escape(d.URL);
    if (typeof(screen)=="object") {
        p+="&sr="+screen.width+"x"+screen.height;p+="&cd="+screen.colorDepth;
        p+="&jo="+(navigator.javaEnabled()?"Yes":"No");
    }
    d.write('<img id="ONESTAT_TAG" border="0" width="1" height="1" src="'+p+'" >');
}