﻿theObjects = document.getElementsByTagName("object");
for (var i = 0; i < theObjects.length; i++) {
	theObjects[i].outerHTML = theObjects[i].outerHTML;
}

function setDialogs() {
    $('#imgbtnSearch').click(function() {
        $('.dialog').hide();
        $('#dialogsearch').show();
        //    $('#dialogsearch').fadeIn('medium');
       // $("#dialogsearch input[type='text']:first").focus();
    });
    $('#RyanLogin').click(function() {
    	$('.dialog').hide();
    	$('#dialogLogin').show();
    });
}

function closeDialog(dialogId) {
	 $('#' + dialogId).fadeOut(0);
   }

   function redirectLanding(o) {
   	if (o.selectedIndex == 0) return false;
   	window.location = o.value + '.aspx';
   }

   function locationSwitchSections(sender, section) {
   		$get("spnDrivingDirections").style.display = 'inline';
   		$get("spnParkingDirections").style.display = 'inline';
   		$get("spnInclementWeather").style.display = 'inline';
   		sender.style.display = 'none';
   		locationEnableSection(section);
   }
   

        function locationSwitchSectionsDriving(sender) {
            
            var currentText = $get("linkDrivingDirections").innerText;
           
            if (currentText == 'Driving Directions') {
                $get("linkDrivingDirections").innerText = "Parking Directions";
                $get("linkInclementWeather").innerText = "Inclement Weather";
                locationEnableSection("phDrivingDirections");
            } else {
                $get("linkDrivingDirections").innerText = "Driving Directions";
                locationEnableSection("phParkingDirections");
            }
        }

        function locationSwitchSectionsWeather(sender) {
            var currentText = $get("linkInclementWeather").innerText;
            
            if (currentText == 'Inclement Weather') {
                $get("linkInclementWeather").innerText = "Parking Directions";
                $get("linkDrivingDirections").innerText = "Driving Directions";
                locationEnableSection("phInclementWeather");
            } else {
                $get("linkInclementWeather").innerText = "Inclement Weather";
                locationEnableSection("phParkingDirections");
            }
        }

        function locationEnableSection(phName) {
            $get("phDrivingDirections").style.display = 'none';
            $get("phParkingDirections").style.display = 'none';
            $get("phInclementWeather").style.display = 'none';
            $get(phName).style.display = '';
        }

        function searchFocus(o) {
        	if (o.value == "Search") o.value = "";
        }

        function searchBlur(o) {
        	if (o.value == "") o.value = "Search";
        }

        function initTraining(url,name) {

        	var flashvars = { height: "443", width: "650" };
        	var params = {
        		//movie: url, quality: "high", wmode: "transparent"
        	};
        	var attributes = { id: "training", name: "training" };
        	swfobject.embedSWF(url, "Training", "650", "443", "9.0.0", "flash/expressInstall.swf", flashvars, params, attributes);
        }