var count;
count = 0;

var adHTML=new Array(2);

adHTML[0]="<div class=\"announcement2\">"+
		  "<img src=\"images/announcement2.jpg\" width=\"130\" height=\"175\" alt=\"Cakes for every occasion!\" />"+
		  "</div>";

adHTML[1]="<div class=\"announcement3\">"+
		  "<img src=\"images/announcement3.gif\" width=\"130\" height=\"175\" alt=\"Minooka Pastry Shop Gift Cards Make a Great Gift!\" />"+
		  "</div>";



/*

adHTML[0]="<div>"+
		  "<a href=\"http://www.minookapastry.com/products.asp?productID=1/23/2007%2010:12:03%20AM&pageNumber=4&category=cakes\">"+
		  "<img src=\"images/p_communion.jpg\" width=\"150\" height=\"195\" border=\"0\"  />"+
		  "</a></div>";

adHTML[0]="<div>"+
		  "<a href=\"http://www.minookapastry.com/products.asp?productID=1/23/2007%2010:25:28%20AM&pageNumber=4&category=cakes\">"+  
		  "<img src=\"images/p_confirm.jpg\" width=\"150\" height=\"195\" border=\"0\" />"+
		  "</a></div>";


adHTML[0]="<div>"+
		  "<a href=\"http://www.minookapastry.com/products.asp?productID=1/23/2007%2010:12:03%20AM&pageNumber=4&category=cakes\">"+
		  "<img src=\"images/ad_bunny.jpg\" width=\"150\" height=\"195\" border=\"0\"  />"+
		  "</a></div>";


adHTML[0]="<div>"+
		  "<a href=\"http://www.minookapastry.com/products.asp?productID=1/23/2007%2010:25:28%20AM&pageNumber=4&category=cakes\">"+  
		  "<img src=\"images/ad_egg.jpg\" width=\"150\" height=\"195\" border=\"0\" />"+
		  "</a></div>";


adHTML[0]="<div class=\"announcementPaczki\">"+
		  "<a href=\"javascript:popWindow('paczki.asp', 570,400)\">"+
		  "<img src=\"images/announcement1a.jpg\" width=\"130\" height=\"175\" alt=\"THE PACZKI ARE HERE!\" border=\"0\" /></a>"+
		  "</div>";

adHTML[0]="<div class=\"announcementPaczki\">"+
		  "<a href=\"javascript:popWindow('paczki.asp', 570,400)\">"+
		  "<img src=\"images/announcement1b.jpg\" width=\"130\" height=\"175\" alt=\"THE PACZKI ARE HERE!\" border=\"0\" ></a>"+
		  "</div>";
	 








adHTML[0]="<div class=\"announcement1\">"+
			  "<p>Only " + daysTilChristmas() + " days until Chistmas!</p>"+
			  "<p><strong>Stop in for your cookies & minis now!</strong></p>"+
			  "</div>";  		  





adHTML[0]="<div class=\"announcement2\">"+
		  "<img src=\"images/products/Flag300.jpg\" width=\"130\" height=\"175\" alt=\"Freedom Cake!\" />"+
		  "</div>";

adHTML[0]="<div>"+
		  "<a href=\"/christmas/2009orderform.asp\"><img src=\"images/ad_christmasOrders.jpg\" width=\"150\" height=\"200\" alt=\"Click Here to Place Your Christmas Order Online!\" border=\"0\" /></a>"+
		  "</div>";



adHTML[0]="<div>"+
		  "<a href=\"http://www.minookapastry.com/products.asp?category=cakes\">"+  
		  "<img src=\"images/GraduationDay.jpg\" width=\"150\" height=\"195\" border=\"0\" />"+
		  "</a></div>";





*/
  





			
var seconds;
seconds = 3;
			
//===============================================================================================

function rotateAds(divName){
	
	document.getElementById(divName).innerHTML = "";
	document.getElementById(divName).innerHTML = adHTML[count];
	
	count++;
	
	if (count == adHTML.length) {
		count = 0;
	}
	
	var rotator=setTimeout("rotateAds('" + divName + "')",(seconds * 1000));
	
}

//===============================================================================================//

function daysTilChristmas() {

today=new Date();
var christmas=new Date(today.getFullYear(), 11, 25);
var daysLeft;

if (today.getMonth()==11 && today.getDate()>25) {
	christmas.setFullYear(christmas.getFullYear()+1)}

var one_day=1000*60*60*24

daysLeft = Math.ceil((christmas.getTime()-today.getTime())/(one_day));
return daysLeft;
}

//================================================================================================//

function popWindow(winlink, width, height){
	portWindow = window.open(winlink, "popWin", " width=" + width + ",height=" + height + ",scrollbars=1")
	portWindow.focus()
}

function closeWindow(){
self.close()
}


//===============================================================================================

function getSubCat(subcatDropdown, currentCategory){
	
	var selSubcategory = subcatDropdown.options[subcatDropdown.selectedIndex].value
	var newURL  = "products.asp?category=" + currentCategory + "&subCategory=" + selSubcategory
	top.location.href = newURL;
    
	return true;
	
}
