
//Function to close the Modal windows and redirect to a page based on url parameter


function goToLink(url) {
    Lightview.hide();
    var loc = document.location=url;
    setTimeout("loc;",1000);
    

}
//Use this to call the function from inside of an iframe javascript:parent.goToLink('/locations/');


//Flemings Steakhouse local page js

//Cloak
var end = "</a>";
var stopall = "com'>";
var synstop = "<a href='";
var e = "ma";
var n = "flemingssteakhouse";
var d = "ilt";
var a = "@";
var f = "o:";
//Stop

Event.observe(window, 'load',
      initAll
    );


function initAll() {
		
	scrollWindow();
	locationsPageActive();
}

function scrollWindow() {
	if (window.innerWidth) //if browser supports window.innerWidth
		{ var winWidth= window.innerWidth; }
	else {
			if (document.all) //else if browser supports document.all (IE 4+)
			{ var winWidth= document.documentElement.clientWidth; }
		}
			
	if((winWidth < 1100) && (winWidth > 960)) {
		var scrollAmount = (1100 - winWidth)/2;
		window.scrollTo(scrollAmount,0);
	}else{
		if(winWidth < 960) {
			window.scrollTo(60,0);
		}
	}
}

//set Locations & Reservations button to active state if on Locations page
function locationsPageActive() {    
    var searchString = "locations/";	
    var urlString = document.location.toString();
    if (urlString.match(searchString) == searchString) {
        var findLocationsIndex = urlString.indexOf("locations");
        if ((urlString.lastIndexOf("/") - findLocationsIndex) < 10) {            
            $('find').style.backgroundPosition = "0 -30px";
        }	
    } 
}

//handle form fields

//reset fields

//submit location query

//state change animations - loading - error - parsing

//parse where2getit XML response

//get location XML file

//parse location XML file

//get url for location results

//slide location finder down

//slide location finder up

//validate zipcode

//validate states

//check for enter button


//X-Cloak
var s = e + d + f;