<!--
var mainEmailAddress = "skyboxpub@aol.com";

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i>d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_nbGroup(event, grpName) { //v3.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : args[i+1];
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    if ((nbArr = document[grpName]) != null)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = args[i+1];
      nbArr[nbArr.length] = img;
  } }
}

function OpenWindow(strFile, strWin)
{
   var openWin, winWidth, winHeight;
   
   if (strWin == "enlarged") {
      winWidth = 500;
	  winHeight = 500;
   }
   if (strWin == "property") {
      winWidth = 500;
	  winHeight = 400;
   }
   
   openWin = window.open(strFile, strWin, "scrollbars=no,toolbar=no,menubar=no,resizable=no,width=" + winWidth + ",height=" + winHeight + ",left=0,top=0");
   openWin.focus();
}

function validateForm(strThisForm)
{
   var strPath, commaPosition, atFound, dotFound;
   var comma = ",";
   var start = 0;
   var strLocationSplit = new String;
   
   //alert("In validateForm: strThisForm = " + strThisForm.name);
   
   //validate email address for newsletter signup on home page
   if (strThisForm.name == "frmEmailAddr") {
      //alert("Email address = " + strThisForm.emailField.value);
      atFound = strThisForm.emailField.value.indexOf("@");
      dotFound = strThisForm.emailField.value.lastIndexOf(".");
      //alert("atFound = " + atFound + "   dotFound = " + dotFound);
      if ((atFound < 0) || (dotFound <= atFound)) {  //is this a valid email address?
         //invalid email address
         alert("Email address '" + strThisForm.emailField.value + "' must contain an @ and a subsequent dot(.). Please try again.");
         strThisForm.action = self.location;
      }
      else { //email address is valid; continue processing
         strThisForm.action = "../home/newsletter_signup.php?emailField=" + strThisForm.emailField.value;
         //alert("strThisForm.action=" + strThisForm.action);
         form.submit();
      }
   }
}

function jumpToPage(strValue, strForm)
{
	//alert("strValue = " + strValue);
	switch (strValue) {
		case "coupons":  //Coupons
			strForm.action = "../links/coupons.php";
			strForm.submit();
			break;

		case "directions":  //Directions
			window.location.href = "../about/directions.php";
			break;

		case "events":  //Upcoming Events and Shows
			window.location.href = "../about/events.php";
			break;

		case "order":  //Place Order
			window.location.href = "../menu/place-order.php";
			break;

		case "adventures":  //Adventures in Cake!
			window.location.href = "../about/adventures_home.php";
			break;

		case "newsletter":  //Newsletter
			window.location.href = "../home/newsletter_signup.php";
			break;

		case "gift":  //Gift Certificates
			window.location.href = "../links/coupons.php";
			break;

		case "faqs":  //FAQs
			window.location.href = "../service/faqs.php";
			break;

		case "hours":  //Shop Hours
			window.location.href = "../about/hours.php";
			break;

		case "thankyou":  //Thank Yous
			window.location.href = "../about/thankyous.php";
			break;

		case "info":  //Request Info
			window.location.href = "../home/request-info.php";
			break;

		case "ask":  //Ask Question
			window.location.href = "../service/ask-question.php";
			break;
			
		default: alert("Oops, can't happen!");
	}
}

function giveEmailAddress(obj, addr, subj) {
	var builtAddr = "mailto:";
	var sArr = mainEmailAddress.split("@");
	var siteAddress = sArr[1];

	if (addr == null) {
		builtAddr += mainEmailAddress;
	}
	else {
		builtAddr += addr + "@skyboxpub.com";
	}
	if (subj != null) {
		builtAddr += "?subject=" + subj;
	}
	obj.href = builtAddr;
	obj.click();
}
//-->