﻿var winH = screen.availHeight - 200;
function parkingPopup(href) {
    window.open(href, 'parkingWin', 'width=525,height=' + winH + ',scrollbars=yes,resizable=yes');
}
function securityPopup(href) {
    window.open(href, 'securityWin', 'width=515,height=278,scrollbars=no,resizable=no');
}
function genInfoPopup(href) {
    window.open(href, 'infoWin', 'width=310,height=117,scrollbars=no,resizable=no');
}
function idirectionsPopup(href) {
    window.open(href, 'idirections', 'width=520,height=270,scrollbars=no,resizable=no');
}
function popBio(theURL) {
    window.open(theURL, 'bioWin', 'width=440,height=480,scrollbars=yes');
}
function MM_openBrWindow(theURL, winName, features) { //v2.0
    window.open(theURL, winName, features);
}
function popw(theURL) {
    ver = parseInt(navigator.appVersion.substring(0, 1));
    newWin = window.open(theURL, 'track', 'menubar=yes,scrollbars=yes,toolbar=yes,status=yes,width=800,height=500,resizable=yes');
    if ((navigator.appName == "Netscape") && (ver == 2)) {
        newWin = window.open(theURL, 'track', 'menubar=yes,scrollbars=yes,toolbar=yes,status=yes,width=800,height=500,resizable=no');
    }
    if ((!((navigator.appName == "Netscape") && (ver == 2))) && (!((navigator.appName == "Microsoft Internet Explorer") && (ver < 4)))) {
        setTimeout("if (newWin) newWin.focus();", 1000);
    }
}

function popwA(theURL) {
    ver = parseInt(navigator.appVersion.substring(0, 1));
    newWin = window.open(theURL, 'McCarranArrivals', 'menubar=no,scrollbars=no,toolbar=no,status=yes,width=305,height=253,resizable=yes');
    if ((navigator.appName == "Netscape") && (ver == 2)) {
        newWin = window.open(theURL, 'McCarranArrivals', 'menubar=no,scrollbars=no,toolbar=no,status=yes,width=305,height=253,resizable=no');
    }
    if ((!((navigator.appName == "Netscape") && (ver == 2))) && (!((navigator.appName == "Microsoft Internet Explorer") && (ver < 4)))) {
        setTimeout("if (newWin) newWin.focus();", 1000);
    }
}

function popwD(theURL) {
    ver = parseInt(navigator.appVersion.substring(0, 1));
    newWin = window.open(theURL, 'McCarranArrivals', 'menubar=no,scrollbars=no,toolbar=no,status=yes,width=300,height=298,resizable=yes');
    if ((navigator.appName == "Netscape") && (ver == 2)) {
        newWin = window.open(theURL, 'McCarranArrivals', 'menubar=no,scrollbars=no,toolbar=no,status=yes,width=300,height=298,resizable=no');
    }
    if ((!((navigator.appName == "Netscape") && (ver == 2))) && (!((navigator.appName == "Microsoft Internet Explorer") && (ver < 4)))) {
        setTimeout("if (newWin) newWin.focus();", 1000);
    }
}


// Used to change disclaimer upon search
function searchResults(target, id) {
    var selAirline = target.airline.options[target.airline.selectedIndex].value + ",";
    var selAirline = unescape(selAirline);
    var selCity = target.airport.options[target.airport.selectedIndex].value + ",";
    var selCity = unescape(selCity);
    var selNumber = target.flightnum.value;
    var text = "<i>Search results for: " + selAirline + " " + selCity + " " + selNumber + "</i>";

    if (document.getElementById) {
        x = document.getElementById(id);
        x.innerHTML = text;
    }
    else if (document.all) {
        x = document.all[id];
        x.innerHTML = text;
    }
    else if (document.layers) {
        x = document.layers[id];
        x.document.open();
        x.document.write(text);
        x.document.close();
    }
}
function openEmailWindow(fileName,windowName) {
	if (windowName == "RandomWindow") 
	{
		//generate random window ID
		 windowName = new String(Math.round(Math.random() * 100000));
	}
	theWidth=550
	theHeight=455
	window.open(fileName,windowName,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+theWidth+",height="+theHeight)
}
function openNewWindow(URLtoOpen, windowName, windowFeatures) {
    newWindow = window.open(URLtoOpen, windowName, windowFeatures);
}
function openTerminal(theGate) {
    var windowName = "terminal";
    var linkName = "http://arizona.mccarran.com/mia/mia.html";
    linkName = "openairportguide.aspx";
    if (theGate != "") {
        linkName = linkName + "?gates=" + theGate;
    }
    theWidth = 900
    theHeight = 583
    newWin = window.open(linkName, windowName, "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=" + theWidth + ",height=" + theHeight)
    newWin.focus();
}