/*
Rollover images for top nav
*/

image1 = new Image();
image1.src = "/images/nav/nav_routesschedules.gif";
image1on = new Image();
image1on.src = "/images/nav/nav_routesschedules_over.gif";

image2 = new Image();
image2.src = "/images/nav/nav_ridingmtd.gif";
image2on = new Image();
image2on.src = "/images/nav/nav_ridingmtd_over.gif";

image3 = new Image();
image3.src = "/images/nav/nav_walkbike.gif";
image3on = new Image();
image3on.src = "/images/nav/nav_walkbike_over.gif";

image4 = new Image();
image4.src = "/images/nav/nav_stopwatch.gif";
image4on = new Image();
image4on.src = "/images/nav/nav_stopwatch_over.gif";

image5 = new Image();
image5.src = "/images/nav/nav_about.gif";
image5on = new Image();
image5on.src = "/images/nav/nav_about_over.gif";

image6 = new Image();
image6.src = "/images/nav/nav_advertise.gif";
image6on = new Image();
image6on.src = "/images/nav/nav_advertise_over.gif";

/*
Rollover functionas
*/
function on(pNameOfImg) {
	document[pNameOfImg].src = eval(pNameOfImg + "on.src");
	}	
	
function out(pNameOfImg) {
	document[pNameOfImg].src = eval(pNameOfImg + ".src");
	}
	
/*---------------------------------------------------------------
WindowPopup() - Popup helper function
---------------------------------------------------------------*/
function WindowPopup(pPopupURL)
{
	window.open(pPopupURL, '', 'width=550,height=425,resizable=yes');
}

/*---------------------------------------------------------------
WindowGoAndPopup() - Popup helper, with redirect
---------------------------------------------------------------*/
function WindowGoAndPopup(pPopupURL, pRedirectURL)
{
	window.location = pRedirectURL
	window.open(pPopupURL, '', 'width=550,height=425,resizable=yes');
}

/*---------------------------------------------------------------
LandmarkPicker() - Popup helper function, calls page with
		            with parameters to be used in return from cal
---------------------------------------------------------------*/
function LandmarkPicker(strField)
{
	window.open('/public/laf/journey/Landmarks.aspx?field=' + strField, 'LandmarkPopup', 'width=300,height=400,resizable=yes,scrollbars=yes');
}

/*---------------------------------------------------------------
RouteMapPopup() - Popup helper function, calls page with
		          with parameters to be used in return from cal
---------------------------------------------------------------*/
function RouteMapPopup(strImgName)
{
    // Calculate a popup, slightly less than the full screen & center it
    intW = screen.width * .9
    intH = screen.height * .7
    intLeftPos = (screen.width) ? (screen.width-intW)/2 : 0;
    intTopPos = (screen.height) ? (screen.height-intH)/2 : 0;

	window.open('/routeschedules/LargeMap.aspx?file=' + strImgName, 'RouteMapPopup', 'top=' + intTopPos + ',left=' + intLeftPos + ',width=' + intW + ',height=' + intH + ',resizable=yes,scrollbars=yes,menubar=no,toolbar=no');
}

/*---------------------------------------------------------------
ts() - text resizer, can increase/decrease visible font size
---------------------------------------------------------------*/
function ts(a) {
    if(window.document){
        fs = window.document.getElementById("Article").style.fontSize;
        if(!fs) {
            ns = a?"12":"10"
            }
        else {
            ns = fs.substring(0, fs.indexOf("px"));
            ns = a?(ns * 1) + 1:(ns * 1) - 1;
            if(ns > 16){ns = 16}
            if(ns < 9){ns = 9}
            }
    
    window.document.getElementById("Article").style.fontSize = ns + "px"}
    }

