//author: Michael Tutino (t2design) January 20, 2005

//home page random photo
var randomnumber=Math.floor(Math.random()*7);

function fprod(){
	if (randomnumber==0){
		parent.document.location.href="store/main/item.asp?item=90";
	}
	if (randomnumber==1){	
		parent.document.location.href="store/main/item.asp?item=116";
	}
	if (randomnumber==2){
		parent.document.location.href="store/main/item.asp?item=102";
	}
	if (randomnumber==3){
		parent.document.location.href="store/main/item.asp?item=118";
	}
	if (randomnumber==4){
		parent.document.location.href="store/main/item.asp?item=99";
	}
	if (randomnumber==5){
		parent.document.location.href="store/main/item.asp?item=47";
	}
	if (randomnumber==6){
		parent.document.location.href="store/main/item.asp?item=12";
	}
	if (randomnumber==7){
		parent.document.location.href="store/main/item.asp?item=201";
	}
}
// end home page random photo


// Home page specials box
var arImg = new Array();
 var arRef = new Array();
                     
 arRef[0] = 'store/main/whats_new.htm#hurricane';
 arImg[0] = 'graphics/homespecials/katrina_relief_special.jpg'

arRef[1] = 'store/main/blackboard_launcher.asp';
 arImg[1] = 'graphics/homespecials/blackboard.jpg'  
  
  arRef[2] = 'store/main/sausages.asp';
  arImg[2] = 'graphics/homespecials/sausageshop_special.jpg'

  arRef[3] = 'store/main/item.asp?item=176';
  arImg[3] = 'graphics/homespecials/book_primecuts_special.jpg'
 
  arRef[4] = 'store/main/heritage_main.htm';
  arImg[4] = 'graphics/homespecials/heritage_special_v3.gif'
  
  arRef[5] = 'store/main/catalog_orderform.asp';
  arImg[5] = 'graphics/homespecials/cat2005_special.jpg'

  arRef[6] = 'store/main/item.asp?item=244';
  arImg[6] = 'graphics/homespecials/book_weber_special.jpg' 
  
  arRef[7] = 'store/main/condiments.htm';
  arImg[7] = 'graphics/homespecials/pantry_special.jpg'

 arRef[8] = 'recipe/main_wine_list.htm';
 arImg[8] = 'graphics/homespecials/parker.jpg'
 
  arRef[9] = 'store/main/item.asp?item=118';
 arImg[9] = 'graphics/homespecials/amer_wagyu_hip.jpg'

 
 <!-- arRef[6] = 'javascript:newurlwindow()';
 <!-- arImg[6] = 'graphics/homespecials/tsunami_relief_special.jpg'

 
 var intMax = arImg.length;
 var dateObj = new Date();
 var intIndex = dateObj.getSeconds() % intMax;
 var intIndex = (intIndex % intMax);
// var intIndex = (intIndex % 2) * 2;
// var intIndex = (intIndex % 2);
// var intIndex = 0 ;

// <a href="javascript:linkImage();"><img name="imgIndex" alt="Click Here" src="" border="0" width="224px" height="407px"></a>
function writeImage() {
  document.write('<a href="javascript:linkImage();">')
  document.write('<img name="imgIndex" alt="Click Here" src="');
  document.write(arImg[intIndex]);
  document.write('" border="0" width="224px" height="407px"></a>');
}

 var intTimeout = 8000;

function rotateImage() {
  // Workaround strange Explorer issue with GTEQ
  if (++intIndex >= intMax) intIndex = 0;
  document.images['imgIndex'].src = arImg[intIndex];
  window.setTimeout('rotateImage();',intTimeout);
  }

function linkImage() {
  location=arRef[intIndex]
  }

// end of Home page specials box

// WEBER home page photo rotation
var weberrandomnumber=Math.floor(Math.random()*3);

function weberfprod(){
	if (randomnumber==1){	
		parent.document.location.href="store/main/item.asp?item=97";
	}
	if (randomnumber==2){
		parent.document.location.href="store/main/item.asp?item=98";
	}
	if (randomnumber==0){
		parent.document.location.href="store/main/item.asp?item=96";
	}
}
// end WEBER home page photo rotation

<!-- Whats new rotation script-->
var beforeMsg = "<a href='store/main/whats_new.htm'>";
// var beforeMsg = "<a href='#' onclick='newurlwindow()'>";
var afterMsg = "</a>";
var msgRotateSpeed = 6000; // Rotate delay in milliseconds
var textStr = new Array();

//Start Items
textStr[0] = "What's New!";
textStr[1] = "Help for Hurricane Victims";
textStr[2] = "New Catalog Now Available";
textStr[3] = "New: Lobel's Gift Boxes";
textStr[4] = "New Book: Weber's Real Grilling";
textStr[5] = "Introducing Lobel's Gift Shop";
textStr[6] = "Now Open: Lobel's Sausage Shop";
textStr[7] = "Introducing Lobel's Pantry";
textStr[8] = "Holiday Ordering Deadlines";
//End Items


if (document.layers) {
document.write('<ilayer id="NS4message" height=25 width=100%><layer id="NS4message2" height=25 width=100%></layer></ilayer>')
temp = 'document.NS4message.document.NS4message2.document.write(beforeMsg + textStr[i++] + afterMsg);'+
'document.NS4message.document.NS4message2.document.close()';
}
else if (document.getElementById) {
document.write(beforeMsg + '<div id="message">IE division</div>' + afterMsg);
temp = 'document.getElementById("message").firstChild.nodeValue = textStr[i++];';
}
else if (document.all) {
document.write(beforeMsg + '<div id="message">IE division</div>' + afterMsg);
temp = 'message.innerHTML = textStr[i++];';
}
var i = 0;
function msgRotate() {
eval(temp);
if (i == textStr.length) i = 0;
setTimeout("msgRotate()", msgRotateSpeed);
}
// window.onload = msgRotate;

//  End Whats new script -->

<!-- Open New Sized Window -->
// use the following code to open a pop window from the specials box
//var myurl1 = "http://www.website.com";
//<a href="javascript:newurlwindow(myurl1)">test</a>

function newurlwindow(jumpurl) { //v2.0
  window.open(jumpurl,"newwindow","status=yes,scrollbars=yes,width=400,height=400");
}
<!--  End Sized Window -->