// Company Info Specific Scripts
var listChanging = false;

function Video_Disable(){
    try {
        var player = $('ply');
        player.sendEvent("STOP", "true");
    }
    catch(err) {}
}

//Change tabs funtionality
function changeTabs(id) {	
	var tabs = new Array(5);
	tabs[0] = "company";
	tabs[1] = "culture";
	tabs[2] = "careers";
	tabs[3] = "contact";
	tabs[4] = "restaurants";
	
	var tabNav = id + "-nav";
	
	if (!listChanging) {
		listChanging = true;
		//Disable Video
		if(id != "culture") {			    
		    Video_Disable();
		}
			
		for(var j = 0; j < 5; j++) {		
			if (tabs[j] != id) {
				$(tabs[j]).style.backgroundColor = "#ffffff";
				Effect.Fade(tabs[j], { duration: 0.5 });
				$(tabs[j] + "-nav").style.backgroundPosition = "1px -46px";			
			}			
		}
		$(id).style.backgroundColor = "#ffffff";
		Effect.Appear(id, { duration: 0.8 });	
		$(tabNav).blur();
		setTimeout(function() {$(tabNav).style.backgroundPosition = "1px 0px";}, 50);
		setTimeout(function() {$(id).style.backgroundColor = "";}, 850);
		setTimeout(viewChangeDone,1500);
	}
	
	
	
}



function viewChangeDone() {
	listChanging = false;
}

//Address Cloaking - returns link and text as same
function stopall(c) {
var end = "</a>";
var stopall = "com'>";
var synstop = "<a href='";
var e = "ma";
var n = "flemingssteakhouse";
var d = "ilt";
var a = "@";
var f = "o:";

var s = e + d + f;

var stopped = synstop + s + c + a + n + "." + stopall + c + a + n + "." + "com" + end;

return stopped;
}

//Address Cloaking - allows custom text
function stopall2(c,g) {
var end = "</a>";
var stopall = "com'>";
var synstop = "<a href='";
var e = "ma";
var n = "flemingssteakhouse";
var d = "ilt";
var a = "@";
var f = "o:";

var s = e + d + f;

var stopped = synstop + s + c + a + n + "." + stopall + g + end;

return stopped;
}