//----------- Browser Detection -----------

var oldTimer = true;
var artistPage = null;
var registerPage = null;
var flashUp = null;

if (parseInt(navigator.appVersion) >= 4) {
  oldTimer = false;
  var browserVar = navigator.platform;
  var isWin = browserVar.indexOf("Win") != -1;
  var isMac = browserVar.indexOf("Mac") != -1;
  if (document.layers) {
    var n4 = true;
  } else if (document.getElementById && !(document.all)) {
    var ns = true;
  } else if (document.getElementById && document.all) {
    var ie = true;
  } else if(document.all) {
    var i4 = true;
  }
}


//----------- Open new Window -----------

function openWindow(lnk,windowName) {
  	objWindow = window.open(lnk, windowName, "top='25',left='25',toolbar=yes,menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes");
  	//objWindow = window.open(lnk, windowName,'top=25,left=25,toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1');
  	//objWindow.opener = this;
}


//----------- Go To Page script -----------
function sendToLocation(s_Section) {
	//
 	switch (s_Section) 
	{ 
   		case "sow" : 
      		openWindow("../sow/index.php","sow")
			break; 
   		case "trapdoor" : 
			parent.location.href = "../trapdoor/index.php";
			break; 
   		case "background" : 
 			parent.location.href = "../background/index.php";
      		break; 
   		case "expert" : 
			parent.location.href = "../expert/index.php";
      		break; 
   		case "huh" : 
      		openWindow("../huh/index.php","huh")
     		break; 
   		case "beforeafter" : 
 			parent.location.href = "../beforeafter/index.php";
     		break; 
   		case "howto" : 
 			parent.location.href = "../howto/index.php";
     		break; 
   		case "etiquette" : 
 			parent.location.href = "../etiquette/index.php";
     		break; 
   		case "recipe" : 
 			parent.location.href = "../recipe/index.php";
     		break; 
   		case "chunks" : 
			parent.location.href = "../chunks/index.html";
      		break; 
   		case "calendar" : 
 			parent.location.href = "../calendar/index.html";
     		break; 
   		case "games" : 
 			parent.location.href = "../games/index.html";
     		break; 
   		case "submissions" : 
			parent.location.href = "../submit/index.php";
      		break; 
   		case "archives" : 
			parent.location.href = "../archives/index.php";
      		break; 
   		case "contact" : 
			parent.location.href = "../contact/index.html";
      		break; 
   		case "legal" : 
 			parent.location.href = "../legal/index.html";
     		break; 
   		case "home" : 
 			parent.location.href = "../index.php";
     		break; 
	} 
	//
} 
//----------- Drop-down list script -----------
function gotoSection() {

	var sectionLnk,sectionChoice;
	//
 	if (n4) {
		sectionLnk=document.layers[0].document.layers['right'].document.forms[0].sections;
	} else {
		sectionLnk=document.forms[0].sections;
	}
	sectionChoice = sectionLnk.options[sectionLnk.selectedIndex].value;
	//
 	sendToLocation(sectionChoice) 
	//
}
