// JavaScript Document

function thisMovie(movieName) {
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	return (isIE) ? window[movieName] : document[movieName];
}

//home
function hFunc() {
	window.location.hash = "Home";
	document.title = "CorkTampa - Home";
	getData('home.php');
	//alert("You pressed the flash HOME button");
}

//nightly specials
function nsFunc(dy) {
	param = dy ? '?dy='+dy : '';
	window.location.hash = "Nightly_Specials";
	document.title = "CorkTampa - Nightly Specials";
	getData('nightly_special.php'+param);
	//alert(param);
}

//special events
function seFunc(cnt) {
	param = cnt ? '?cnt='+cnt : '';
	window.location.hash = "Special_Events";
	document.title = "CorkTampa - Special Events";
	getData('special_event.php'+param);
	//alert("You pressed the flash SPECIAL EVENTS button");
}

//parties
function paFunc() {
	window.location.hash = "Parties";
	document.title = "CorkTampa - Parties";
	getData('parties.php');
	//alert("You pressed the flash PARTIES button");
}

//office parties submit
function opFunc() {
	window.location.hash = "Hump-Day-Office-Parties";
	document.title = "CorkTampa - Hump Day Office Parties";
	getData('Hump-Day-Office-Parties.php') ;
}

//photos
function phFunc() {
	window.location.hash = "Photos";
	document.title = "CorkTampa - Photos";
	getData('photo.php');
	//alert("You pressed the flash PHOTOS button");
}

//menu
function mFunc(cat) {
	param = cat ? '?cat='+cat : '';
	window.location.hash = "Menu";
	document.title = "CorkTampa - Menu";
	getData('menu.php'+param);
	//alert("You pressed the flash MENU button");
}

//about
function aFunc() {
	window.location.hash = "About";
	document.title = "CorkTampa - About";
	getData('about.php');
	//alert("You pressed the flash ABOUT button");
}

//contact us
function cuFunc() {
	window.location.hash = "Contact_Us";
	document.title = "CorkTampa - Contact Us";
	getData('contact.php');
	//alert("You pressed the flash CONTACT US button");
}

//join list
function jlFunc() {
	window.location.hash = "Join_List";
	document.title = "CorkTampa - Join List";
	getData('join.php');
	//alert("You pressed the flash JOIN LIST button");
}

//privacy policy
function ppFunc() {
	window.location.hash = "Privacy_Policy";
	document.title = "CorkTampa - Privacy Policy";
	getData('privacy_policy.php');
}

//site map
function smFunc() {
	window.location.hash = "Site_Map";
	document.title = "CorkTampa - Site Map";
	getData('sitemap.php');
}

//party thank you
function ptyFunc() {
	window.location.hash = "Thank_You";
	document.title = "CorkTampa - Thank You";
	getData('thanks.php');
}

//contact thank you
function ctyFunc() {
	window.location.hash = "Thank_You";
	document.title = "CorkTampa - Thank You";
	getData('thankyou.php');
}

//contact submit
function coFunc(qstr) {
	window.location.hash = "Contact_Us";
	document.title = "CorkTampa - Contact Us";
	getData('contact.php?' + qstr);
}

//parties submit
function parFunc(qstr) {
	window.location.hash = "Parties";
	document.title = "CorkTampa - Parties";
	getData('parties.php?' + qstr);
}
//ofice parties submit
function oparFunc(qstr) {
	window.location.hash = "Hump-Day-Office-Parties.php";
	document.title = "CorkTampa - Hump Day Office Parties";
	getData('Hump-Day-Office-Parties.php?' + qstr);
}
//office party thank you
function optyFunc() {
	window.location.hash = "Thank_You";
	document.title = "CorkTampa - Thank You";
	getData('thanks.php');
}

function bookmarkFunc() {
	var page = location.hash;
	var section;
	var sectionPos;

	if (eval(thisMovie("cork"))) {
		thisMovie("cork").asFunc(page);
	}
	switch(page.substring(page.lastIndexOf('#')+1)) {
		case "Home":
			hFunc();
			break;
		case "Nightly_Specials":
			nsFunc();
			break;
		case "Special_Events":
			seFunc();
			break;
		case "Parties":
			paFunc();
			break;
		case "Hump-Day-Office-Parties":
			opFunc();
			break;
		case "Photos":
			phFunc();
			break;
		case "Menu":
			mFunc();
			break;
		case "About":
			aFunc();
			break;
		case "Contact_Us":
			cuFunc();
			break;
		case "Join_List":
			jlFunc();
			break;
		case "Privacy_Policy":
			ppFunc();
			break;
		case "Site_Map":
			smFunc();
			break;
		default:
			break;
	}
//	alert("bookmarkFunc()");
}

var hash = location.hash;
setInterval(function(){
    if (location.hash != hash)    {
		bookmarkFunc();
        hash = location.hash;
    }
}, 100);