if (document.images)
{
	helpover = new Image;
	faqover = new Image;
	cartover = new Image;
	searchover = new Image;
	idsystemsover = new Image;
	idservicesover = new Image;
	idsuppliesover = new Image;
	idaccover = new Image;
	shreddersover = new Image;
	securityover = new Image;
	
	helpover.src = "images/help1_over.gif";
	faqover.src = "images/faq1_over.gif";
	cartover.src = "images/cart1_over.gif";
	searchover.src = "images/search_button_over.jpg";
	idsystemsover.src = "images/idsystems1_over.gif";
	idservicesover.src = "images/idservices1_over.gif";
	idsuppliesover.src = "images/idsupplies1_over.gif";
	idaccover.src = "images/idacc1_over.gif";
	shreddersover.src = "images/shredders1_over.gif";
	securityover.src = "images/security1_over.gif";
} else {
	
	helpover = "";
	faqover = "";
	cartover = "";
	searchover = "";
	helpover = "";
	faqover = "";
	cartover = "";
	helpover = "";
	faqover = "";
	cartover = "";
}

var site = "http://www.idhouse.com/"; // used to direct pages to the approriate site

function goThere() 
{
	newLocation = document.goform.golinks.options[document.goform.golinks.selectedIndex].value;
	// alert(newLocation); debug line
	if (newLocation != '')
	{
		window.location = newLocation;
	}
}

function componentNav() 
{

        var tagO = "<option value=\""; // to reduce the amount of code
	with (document) 
	{
		writeln("<form id=\"goform\" name=\"goform\" >");
		writeln("<select class=\"golinks1\" name=\"golinks\" onchange=\"goThere();\">");
		writeln(tagO + "\" selected=\"selected\">Choose a Category");
		writeln(tagO + site + "photo_s.htm\">Accessories");
		writeln(tagO + site + "badge1.htm\">Badge Holders");
		writeln(tagO + site + "badgreel.htm\">Badge Reels");
		writeln(tagO + site + "print_s.htm\">Camera Film");
		writeln(tagO + site + "compon.htm\">Cameras");
		writeln(tagO + site + "eltron_s.htm#eltron_sclean\">Cleaning Kits");
		writeln(tagO + site + "compon.htm\">Components");
		writeln(tagO + site + "corn1.htm\">Corner Rounder");
		writeln(tagO + site + "diecut1.htm\">Die Cutter");
		writeln(tagO + site + "photo1.htm\">ID Systems");
		writeln(tagO + site + "lamp_s.htm\">Lamination Film");
		writeln(tagO + site + "lamp.htm\">Laminator");
		writeln(tagO + site + "neck1.htm\">Lanyards");
		writeln(tagO + site + "magread1.htm\">Mag Stripe Devices");
		writeln(tagO + site + "pvc.htm\">PVC Cards");
		writeln(tagO + site + "print1.htm\">Printers");
		writeln(tagO + site + "print_s.htm\">Ribbons");
		writeln(tagO + site + "support.htm\">Services");
		writeln(tagO + site + "mmperiph.htm\">Signature Capture");
		writeln(tagO + site + "slot1.htm\">Slot Punch");
		writeln(tagO + site + "softcrd1.htm\">Software");
		writeln(tagO + site + "stclip1.htm\">Strap Clips");
		writeln(tagO + site + "print_s.htm\">Supplies");
//		writeln(tagO + site + "litecut.htm\">Trimmer");

		writeln("</select>");
		//writeln("<input type=\"button\" value=\"GO!\" onClick=\"goThere();\">");
		writeln("</form>");

		//Error Message
		// writeln('<br><div style="font-weight : Bold; font-size:13 pt;">Due to technical difficulties, our phone systems are temporarily down. You may still place orders via our shopping cart or e-mail us questions at <a href="mailto:info&#64;idhouse.com">info&#64;idhouse.com</a>.</div><br>');
	}
}

function checkExtOps(frmname)
{
 //go through each element to see if any are dropdowns, check to see if something is selected.
 for(i=0; i < frmname.length; i++)
 {  
  if(frmname.elements[i].type == 'select-one' || frmname.elements[i].type == 'select-multiple')
  {
   if(frmname.elements[i].selectedIndex==0)
   {
    alert("Please select an option.");
    frmname.elements[i].focus();
    return false;
   }
  }
 } 
 return true;
}

function changeImages() {
	preloadFlag = true;
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		preloadFlag = true;
	}
}

// this function is used for the holiday popup from the home page.
function PopUp()
{
	if(document.cookie==null || document.cookie=="")
		{
		var myDate = new Date();
		// Y2K Fix
		if (myDate.getYear() <= 1000) var myYear= myDate.getYear() + 1900;
		else  myYear= myDate.getYear(); 
		var myMonth = myDate.getMonth() +1; // this line gets the Month variable to correspond with the 		calendar month.
		var dayOfMonth = myDate.getDate();  // this line gets the current date (day of the month).
		var holiday = (myMonth + "/" + dayOfMonth + "/" + myYear);
		//document.write(holiday);
		var dateArray = new Array();
		dateArray["11/20/2006"] = "thanksgiving";
		dateArray["11/21/2006"] = "thanksgiving";
		dateArray["11/22/2006"] = "thanksgiving";
		dateArray["11/23/2006"] = "thanksgiving";
	
		dateArray["12/21/2006"] = "christmas";
		dateArray["12/22/2006"] = "christmas";
		dateArray["12/23/2006"] = "christmas";
		dateArray["12/24/2006"] = "christmas";
		dateArray["12/25/2005"] = "christmas";

		dateArray["12/28/2006"] = "newyear";
		dateArray["12/29/2006"] = "newyear";
		dateArray["12/30/2006"] = "newyear";
		dateArray["12/31/2006"] = "newyear";
		dateArray["1/1/2007"] = "newyear";

		dateArray["5/24/2007"] = "memorial";
		dateArray["5/25/2007"] = "memorial";
		dateArray["5/26/2007"] = "memorial";
		dateArray["5/27/2007"] = "memorial";
		dateArray["5/28/2007"] = "memorial";

		dateArray["7/1/2007"] = "independence";
		dateArray["7/2/2007"] = "independence";
		dateArray["7/3/2007"] = "independence";
		dateArray["7/4/2007"] = "independence";

		dateArray["8/30/2007"] = "labor";
		dateArray["8/31/2007"] = "labor";
		dateArray["9/1/2007"] = "labor";
		dateArray["9/2/2007"] = "labor";
		dateArray["9/3/2007"] = "labor";

		if (dateArray[holiday])
			{
			window.open('holidays.htm', dateArray[holiday], 'scrollbars=no,toolbar=no,width=435,height=400');
			}
		}
	document.cookie="Visited=Yes;";
}
