init = function() {

	// enable sIFR
	if(typeof sIFR == "function" && !sIFR.UA.bIsIEMac){
		sIFR.setup();
		sIFR.replaceElement(named({sSelector:"h2", sFlashSrc:base_web_dir+"flash/jgaramond.swf", sColor:"#ffffff", sLinkColor:"#ffffff", sBgColor:"#286991", sWmode:"transparent", sHoverColor:"#c8dfef", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"textalign=left&offsetTop=0"}));
	};
	
	// add onclick statement to popup links
	$("#content a").each(function(){
			if($(this).attr("href")) {
				var url = $(this).attr("href");
				if( url.indexOf("popup") != -1 ) {
					$(this).bind("click", function(){
						if (url=="popup-webcam.html"){
							popup = window.open(url,"popup","resizable=1,resizeable=1,location=0,status=0,scrollbars=1,toolbar=0,directories=0,menubar=0,search=0,width=990,height=700,left=5,top=20");							
						}else{						
							popup = window.open(url,"popup","resizable=1,resizeable=1,location=0,status=0,scrollbars=1,toolbar=0,directories=0,menubar=0,search=0,width=790,height=500,left=5,top=20");
						}
							popup.focus();
							return false;
						
					});
				}
			}
	});

	if ( typeof( window[ 'TBexist' ] ) != "undefined" ) {
		TB_init();
	}

	$("li.car a, li.plane a, li.train a").click(function() {
	    // alert('x');
	    var divclass = $(this).parent().attr('class');
	    $("div.carInfo, div.planeInfo, div.trainInfo").slideUp('fast');
	    $("div.carInfo, div.planeInfo, div.trainInfo").removeClass('vis');

	    // alert("div." + divclass + "Info");
	    if($("div." + divclass + "Info").hasClass('vis')) {
		$("div." + divclass + "Info").removeClass('vis');
		$("div." + divclass + "Info").slideUp('fast');
	    } else {
		$("div." + divclass + "Info").addClass('vis');
		$("div." + divclass + "Info").slideDown('fast');
	    }

	    return false;
	});

	$('a#locationMap').click(function(){

		if($(this).is('img')){
			window.open($(this).parent().href);
		}else{
			window.open(this.href);
		}
		return false;
	});
	
};

$(document).ready(init);