// DHTML Sign written by Raland Kinley, 2002
// Contact: discm@discorporatemusic.com

 function printStatement() {
// print the DHTML message if good IE or good Netscape

	if(document.all) {
		// Good IE
    document.write('<div id=\"welcomeChicken\"><img src=\"images/bird_welcome.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Welcome\" /></div>\n');
    document.write('<div id=\"menuChicken\"><img src=\"images/bird_menu.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Menu\" /></div>\n');
    document.write('<div id=\"locationChicken\"><img src=\"images/bird_location.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Location\" /></div>\n');
    document.write('<div id=\"historyChicken\"><img src=\"images/bird_history.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - History\" /></div>\n');
    document.write('<div id=\"storeChicken\"><img src=\"images/bird_store.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Store\" /></div>\n');
    document.write('<div id=\"guestbookChicken\"><img src=\"images/bird_guestbook.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Guestbook\" /></div>\n');
    document.write('<div id=\"downloadsChicken\"><img src=\"images/bird_download.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Downloads\" /></div>\n');
    document.write('<div id=\"jobsChicken\"><img src=\"images/bird_jobs.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Jobs\" /></div>\n');
    document.write('<div id=\"contactChicken\"><img src=\"images/bird_contact.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Contact\" /></div>\n');
    document.write('<div id=\"oopsieChicken\"><img src=\"images/bird_oopsie.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Oopsie\" /></div>\n');
    document.write('<div id=\"divSign\" onmouseover=\"animateSign()\;\"><img src=\"images/sign_nolights.gif\" width=\"504\" height=\"114\" border=\"0\" alt=\"The Chickenburger\" /></div>\n');
    document.write('<div id=\"divLite01\"><img src=\"images/lights_position_1.gif\" width=\"504\" height=\"114\" border=\"0\" alt=\"The Chickenburger\" /></div>\n');
    document.write('<div id=\"divLite02\"><img src=\"images/lights_position_2.gif\" width=\"504\" height=\"114\" border=\"0\" alt=\"The Chickenburger\" /></div>\n'); 
    document.write('<div id=\"divLite03\" onmouseover=\"animateSign()\;\"><img src=\"images/lights_both.gif\" width=\"504\" height=\"114\" border=\"0\" alt=\"The Chickenburger\" /></div>\n'); 
              
	} else if(document.layers) {
		// Good Netscape (version 4.x)     
    document.write('<layer name=\"welcomeChicken\" top=\"0\" left=\"20\" width=\"143\" height=\"114\" clip=\"143,114\" visibility=\"hide\" z-index=\"2\"><img src=\"images/bird_welcome.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Welcome\" /></layer>\n');
    document.write('<layer name=\"menuChicken\" top=\"0\" left=\"20\" width=\"143\" height=\"114\" clip=\"143,114\" visibility=\"hide\" z-index=\"2\"><img src=\"images/bird_menu.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Menu\" /></layer>\n');
    document.write('<layer name=\"locationChicken\" top=\"0\" left=\"20\" width=\"143\" height=\"114\" clip=\"143,114\" visibility=\"hide\" z-index=\"2\"><img src=\"images/bird_location.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Location\" /></layer>\n');
    document.write('<layer name=\"historyChicken\" top=\"0\" left=\"20\" width=\"143\" height=\"114\" clip=\"143,114\" visibility=\"hide\" z-index=\"2\"><img src=\"images/bird_history.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - History\" /></layer>\n');
    document.write('<layer name=\"storeChicken\" top=\"0\" left=\"20\" width=\"143\" height=\"114\" clip=\"143,114\" visibility=\"hide\" z-index=\"2\"><img src=\"images/bird_store.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Store\" /></layer>\n');
    document.write('<layer name=\"guestbookChicken\" top=\"0\" left=\"20\" width=\"143\" height=\"114\" clip=\"143,114\" visibility=\"hide\" z-index=\"2\"><img src=\"images/bird_guestbook.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Guestbook\" /></layer>\n');
    document.write('<layer name=\"downloadsChicken\" top=\"0\" left=\"20\" width=\"143\" height=\"114\" clip=\"143,114\" visibility=\"hide\" z-index=\"2\"><img src=\"images/bird_download.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Downloads\" /></layer>\n');
    document.write('<layer name=\"jobsChicken\" top=\"0\" left=\"20\" width=\"143\" height=\"114\" clip=\"143,114\" visibility=\"hide\" z-index=\"2\"><img src=\"images/bird_jobs.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Jobs\" /></layer>\n');
    document.write('<layer name=\"contactChicken\" top=\"0\" left=\"20\" width=\"143\" height=\"114\" clip=\"143,114\" visibility=\"hide\" z-index=\"2\"><img src=\"images/bird_contact.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Contact\" /></layer>\n');
    document.write('<layer name=\"oopsieChicken\" top=\"0\" left=\"20\" width=\"143\" height=\"114\" clip=\"143,114\" visibility=\"hide\" z-index=\"2\"><img src=\"images/bird_oopsie.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Oopsie\" /></layer>\n');
    document.write('<layer name=\"divSign\" onmouseover=\"animateSign()\;\" top=\"0\" left=\"163\" width=\"504\" height=\"114\" clip=\"504,114\" visibility=\"show\" z-index=\"1\"><img src=\"images/sign_nolights.gif\" width=\"504\" height=\"114\" border=\"0\" alt=\"The Chickenburger\" /></layer>\n');
    document.write('<layer name=\"divLite01\" top=\"0\" left=\"163\" width=\"504\" height=\"114\" clip=\"504,114\" visibility=\"hide\" z-index=\"3\"><img src=\"images/lights_position_1.gif\" width=\"504\" height=\"114\" border=\"0\" alt=\"The Chickenburger\" /></layer>\n');
    document.write('<layer name=\"divLite02\" top=\"0\" left=\"163\" width=\"504\" height=\"114\" clip=\"504,114\" visibility=\"hide\" z-index=\"3\"><img src=\"images/lights_position_2.gif\" width=\"504\" height=\"114\" border=\"0\" alt=\"The Chickenburger\" /></layer>\n');
    document.write('<layer name=\"divLite03\" onmouseover=\"animateSign()\;\" top=\"0\" left=\"163\" width=\"504\" height=\"114\" clip=\"504,114\" visibility=\"show\" z-index=\"1\"><img src=\"images/lights_both.gif\" width=\"504\" height=\"114\" border=\"0\" alt=\"The Chickenburger\" /></layer>\n');
         
	} else if(!document.all && document.getElementById) {

		// Mozilla or Netscape 6
		// Top Nav Items
    document.write('<div id=\"welcomeChicken\" style=\"top:0px;left:20px;width:143px;height:114px;visibility:hidden;z-index:2;\"><img src=\"images/bird_welcome.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Welcome\" /></div>\n');
    document.write('<div id=\"menuChicken\" style=\"top:0px;left:20px;width:143px;height:114px;visibility:hidden;z-index:2;\"><img src=\"images/bird_menu.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Menu\" /></div>\n');
    document.write('<div id=\"locationChicken\" style=\"top:0px;left:20px;width:143px;height:114px;visibility:hidden;z-index:2;\"><img src=\"images/bird_location.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Location\" /></div>\n');
    document.write('<div id=\"historyChicken\" style=\"top:0px;left:20px;width:143px;height:114px;visibility:hidden;z-index:2;\"><img src=\"images/bird_history.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - History\" /></div>\n');
    document.write('<div id=\"storeChicken\" style=\"top:0px;left:20px;width:143px;height:114px;visibility:hidden;z-index:2;\"><img src=\"images/bird_store.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Store\" /></div>\n');
    document.write('<div id=\"guestbookChicken\" style=\"top:0px;left:20px;width:143px;height:114px;visibility:hidden;z-index:2;\"><img src=\"images/bird_guestbook.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Guestbook\" /></div>\n');
    document.write('<div id=\"downloadsChicken\" style=\"top:0px;left:20px;width:143px;height:114px;visibility:hidden;z-index:2;\"><img src=\"images/bird_download.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Downloads\" /></div>\n');
    document.write('<div id=\"jobsChicken\" style=\"top:0px;left:20px;width:143px;height:114px;visibility:hidden;z-index:2;\"><img src=\"images/bird_jobs.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Jobs\" /></div>\n');
    document.write('<div id=\"contactChicken\" style=\"top:0px;left:20px;width:143px;height:114px;visibility:hidden;z-index:2;\"><img src=\"images/bird_contact.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Contact\" /></div>\n');
    document.write('<div id=\"oopsieChicken\" style=\"top:0px;left:20px;width:143px;height:114px;visibility:hidden;z-index:2;\"><img src=\"images/bird_oopsie.gif\" width=\"143\" height=\"114\" border=\"0\" alt=\"The Chickenburger - Oopsie\" /></div>\n');
    document.write('<div id=\"divSign\" style=\"top:0px;left:163px;width:504px;height:114px;visibility:visible;z-index:1;\" onmouseover=\"animateSign()\;\"><img src=\"images/sign_nolights.gif\" width=\"504\" height=\"114\" border=\"0\" alt=\"The Chickenburger\" /></div>\n');
    document.write('<div id=\"divLite01\" style=\"top:0px;left:163px;width:504px;height:114px;visibility:hidden;z-index:3;\"><img src=\"images/lights_position_1.gif\" width=\"504\" height=\"114\" border=\"0\" alt=\"The Chickenburger\" /></div>\n');
    document.write('<div id=\"divLite02\" style=\"top:0px;left:163px;width:504px;height:114px;visibility:hidden;z-index:3;\"><img src=\"images/lights_position_2.gif\" width=\"504\" height=\"114\" border=\"0\" alt=\"The Chickenburger\" /></div>\n');
    document.write('<div id=\"divLite03\" style=\"top:0px;left:163px;width:504px;height:114px;visibility:visible;z-index:1;\" onmouseover=\"animateSign()\;\"><img src=\"images/lights_both.gif\" width=\"504\" height=\"114\" border=\"0\" alt=\"The Chickenburger\" /></div>\n');         
 
   
	}   
} 


function animateSign() {
   hideSign('divLite03');   
	x = 0;   
   
	for(i = 1; i <= 5; i++) {
		x += 200;
		setTimeout("hideSign('divLite02')", x);
		setTimeout("showSign('divLite01')", x);
		x += 200;
		setTimeout("hideSign('divLite01')", x);
		setTimeout("showSign('divLite03')", x);
		x += 200;
		setTimeout("hideSign('divLite03')", x);
		setTimeout("showSign('divLite02')", x);
		x += 200;
		setTimeout("hideSign('divLite02')", x);
		setTimeout("showSign('divLite01')", x);
		x += 200;
		setTimeout("hideSign('divLite01')", x);
		setTimeout("showSign('divLite03')", x);
		x += 200;
		setTimeout("hideSign('divLite03')", x);
		setTimeout("showSign('divLite02')", x);
	}
   
   x += 200;
   setTimeout("hideSign('divLite02')", x);
   setTimeout("showSign('divLite03')", x);
   
}

 
// showSign -- runs if good IE, good Netscape, Netscape 6 or Mozilla
function showSign(lights) {
	if(document.all) {
		// We have IE4+
		var signBlock = eval("document.all." + lights + ".style");     
		signBlock.xpos = parseInt(signBlock.pixelLeft);      
		signBlock.ypos = parseInt(signBlock.pixelTop);
		signBlock.visibility = "visible";
      
	} else if(document.layers) {
		// We have Netscape 4.x
		var signBlock = eval("document." + lights);
		signBlock.xpos = parseInt(signBlock.left);
		signBlock.ypos = parseInt(signBlock.top);
		signBlock.visibility = "show";
   
   } else if(!document.all && document.getElementById) {
		// We have Mozilla or Netscape 6.x
		var signBlock = document.getElementById(lights).style;    
		signBlock.left = parseInt(signBlock.left) + "px";
		signBlock.top = parseInt(signBlock.top) + "px";
    signBlock.visibility = "visible";

	}
} 
 
// hideSign -- runs if good IE, good Netscape, Netscape 6 or Mozilla
function hideSign(lights) {
	if(document.all) {
   	// We have IE4+
		var signBlock = eval("document.all." + lights + ".style");       
		signBlock.xpos = parseInt(signBlock.pixelLeft);      
		signBlock.ypos = parseInt(signBlock.pixelTop);
		signBlock.visibility = "hidden";
    
	} else if(document.layers) {
		// We have Netscape 4.x   
		var signBlock = eval("document." + lights);
    signBlock.xpos = parseInt(signBlock.left);
		signBlock.ypos = parseInt(signBlock.top);
    signBlock.visibility = "hide";
      
	} else if(!document.all && document.getElementById) {
		// We have Mozilla or Netscape 6.x
		var signBlock = document.getElementById(lights).style;    
		signBlock.left = parseInt(signBlock.left) + "px";
		signBlock.top = parseInt(signBlock.top) + "px";
		signBlock.visibility = "hidden";   

	}
}

function historyLinks(template) {

   if(template == "") {
      template = "chick_history";
   }
   
   var getAppVers = parseFloat(navigator.appVersion);
   if(document.all || (document.layers && getAppVers > 4.08) || document.getElementById) {
      location.href = "/cgi-bin/TheChick.cgi?tp=" + template;
   } else {
      location.href = "/cgi-bin/TheChick.cgi?tp=" + template + "&j=1";
   }

   return false;
}

function controlWindow() {
    if (navigator.appName.substring(0, 5) == 'WebTV')
        return true;

    url = "http://www.thechickenburger.com/mail_order_form.php";
    cntrlWin = window.open(url,"newPicture","toolbar=yes,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=no,copyhistory=no,width=500,height=400,top=0,left=0");

    return false;
}


// Begin DHTML Guestbook 

var move = 8; // amount of movement per interval  
var scrollTime = 20; // length of interval between movements
var limitTop; //  the message ceiling
var limitBottom = 0;

// the scrolling down function -- runs if good IE, Netscape 4.x, Netscape 6.x or Mozilla
function scrollDown(upperLimit) {
   limitTop = (-1)*(upperLimit);
   if(document.layers || document.all || (!document.all && document.getElementById)) {
      down = setInterval("slideDown()", scrollTime);
   }
}
                                
// the scrolling up function -- runs if good IE, Netscape 4.x, Netscape 6.x or Mozilla
function scrollUp() {
   if(document.layers || document.all || (!document.all && document.getElementById)) {
      up = setInterval("slideUp()", scrollTime);
   }
}
                        
// the function that scrolls down the DHTML content
function slideDown() {
   // Netscape scrolling code
   if(document.layers) {
      var scrollBlock = document.GBContainer.document.GBContent;
                        
      scrollBlock.xpos = parseInt(scrollBlock.left);
      scrollBlock.ypos = parseInt(scrollBlock.top);
                        
      if(scrollBlock.ypos > limitTop) {
         scrollBlock.ypos -= move;
         scrollBlock.top = scrollBlock.ypos;
      } else {
         clearInterval(down);
      }

    // IE scrolling code
    } else if(document.all) {
       var scrollBlock = document.all.GBContent.style;
        
       scrollBlock.xpos = parseInt(scrollBlock.pixelLeft);
       scrollBlock.ypos = parseInt(scrollBlock.pixelTop);
                 
       if(scrollBlock.ypos > limitTop) {
          scrollBlock.ypos -= move;
          scrollBlock.top = scrollBlock.ypos;
       } else {
          clearInterval(down);
       }
                 
    // Mozilla, Netscape 6.x scrolling code
    } else if(!document.all && document.getElementById) {
       var scrollBlock = document.getElementById('GBContent').style;
        
       scrollBlock.left = parseInt(scrollBlock.left) + "px";
       scrollBlock.top = parseInt(scrollBlock.top) + "px";
                        
       var t = parseInt(scrollBlock.top);
                        
       if(t > limitTop) {
          scrollBlock.top = parseInt(scrollBlock.top) - move + "px";
       } else {
          clearInterval(down);
       }
    }
}

// the function that scrolls up the DHTML content
function slideUp() {
   // Netscape scrolling code
   if(document.layers) {
      var scrollBlock = document.GBContainer.document.GBContent;
                        
      scrollBlock.xpos = parseInt(scrollBlock.left);
      scrollBlock.ypos = parseInt(scrollBlock.top);
                        
      if(scrollBlock.ypos < limitBottom) {
         scrollBlock.ypos += move;
         scrollBlock.top = scrollBlock.ypos;
      } else {
         clearInterval(up);
      }
                
   // IE scrolling code
   } else if(document.all) {
      var scrollBlock = document.all.GBContent.style;
                        
      scrollBlock.xpos = parseInt(scrollBlock.pixelLeft);
      scrollBlock.ypos = parseInt(scrollBlock.pixelTop);
                        
      if(scrollBlock.ypos < limitBottom) {
         scrollBlock.ypos += move;
         scrollBlock.top = scrollBlock.ypos;
      } else {
         clearInterval(up);  
      }

   // Mozilla, Netscape 6.x scrolling code
   } else if(!document.all && document.getElementById) {
      var scrollBlock = document.getElementById('GBContent').style;
        
      scrollBlock.left = parseInt(scrollBlock.left) + "px";
      scrollBlock.top = parseInt(scrollBlock.top) + "px";
                        
      var t = parseInt(scrollBlock.top);
                        
      if(t < limitBottom) {
         scrollBlock.top = parseInt(scrollBlock.top) + move + "px";
      } else {
         clearInterval(up);
      }
   }
}

// End DHTML Guestbook



//Rollover stuff

if(document.images && !document.layers) {

	//define the image states
	nav1on = new Image();
	nav1on.src = "images/nav/nav_menu_r.gif";
	nav2on = new Image();
	nav2on.src = "images/nav/nav_location_r.gif";
	nav3on = new Image();
	nav3on.src = "images/nav/nav_history_r.gif";
	nav4on = new Image();
	nav4on.src = "images/nav/nav_store_r.gif";
	nav5on = new Image();
	nav5on.src = "images/nav/nav_guestbook_r.gif";
	navjobson = new Image();
	navjobson.src = "images/nav/nav_jobs_r.gif";
	nav6on = new Image();
	nav6on.src = "images/nav/nav_contact_r.gif";
	nav7on = new Image();
	nav7on.src = "images/nav/nav_home_r.gif";
	nav8on = new Image();
	nav8on.src = "images/nav/nav_download_r.gif";
	history1on = new Image();
	history1on.src = "images/historical-news_r.gif";
	history2on = new Image();
	history2on.src = "images/historical-years_r.gif";
	history3on = new Image();
	history3on.src = "images/historical-hollywood_r.gif";
	history4on = new Image();
	history4on.src = "images/historical-founder_r.gif";
   
	nav1off = new Image();
	nav1off.src = "images/nav/nav_menu_n.gif";
	nav2off = new Image();
	nav2off.src = "images/nav/nav_location_n.gif";
	nav3off = new Image();
	nav3off.src = "images/nav/nav_history_n.gif";
	nav4off = new Image();
	nav4off.src = "images/nav/nav_store_n.gif";
	nav5off = new Image();
	nav5off.src = "images/nav/nav_guestbook_n.gif";
	navjobsoff = new Image();
	navjobsoff.src = "images/nav/nav_jobs_n.gif";
	nav6off = new Image();
	nav6off.src = "images/nav/nav_contact_n.gif";
	nav7off = new Image();
	nav7off.src = "images/nav/nav_home_n.gif";
	nav8off = new Image();
	nav8off.src = "images/nav/nav_download_n.gif";
	history1off = new Image();
	history1off.src = "images/historical-news_n.gif";
	history2off = new Image();
	history2off.src = "images/historical-years_n.gif";
	history3off = new Image();
	history3off.src = "images/historical-hollywood_n.gif";
	history4off = new Image();
	history4off.src = "images/historical-founder_n.gif";

	nav1Darkoff = new Image();
	nav1Darkoff.src = "images/nav/dark/nav_menu_n.gif";
	nav2Darkoff = new Image();
	nav2Darkoff.src = "images/nav/dark/nav_location_n.gif";
	nav3Darkoff = new Image();
	nav3Darkoff.src = "images/nav/dark/nav_history_n.gif";
	nav4Darkoff = new Image();
	nav4Darkoff.src = "images/nav/dark/nav_store_n.gif";
	nav5Darkoff = new Image();
	nav5Darkoff.src = "images/nav/dark/nav_guestbook_n.gif";
	navjobsDarkoff = new Image();
	navjobsDarkoff.src = "images/nav/dark/nav_jobs_n.gif";
	nav6Darkoff = new Image();
	nav6Darkoff.src = "images/nav/dark/nav_contact_n.gif";
	nav7Darkoff = new Image();
	nav7Darkoff.src = "images/nav/dark/nav_home_n.gif";
	nav8Darkoff = new Image();
	nav8Darkoff.src = "images/nav/dark/nav_download_n.gif";

 
   //the rollover function
   function imgOn(imgName, layerName){
      if(document.images) {
         document[imgName].src = eval(imgName + "on.src");
      }
	}

   //the rolloff function
   function imgOff(imgName, layerName, dir) {
      if(document.images) {
         document[imgName].src = eval(imgName + dir + "off.src");
      }
	}

}

// end rollover stuff

