//
// This script writes the drop-down menu navigation component
//
// By using a .js include file we are able to minimize non-relavant
// keywords on the page, as well as have a central location for
// making changes (additions, deletions, modifications, etc).
//

var site = "http://www.idhouse.com/"; // used to direct pages to the approriate site
var tagO = "<option value=\""; // to reduce the amount of code
var newLocation = ""; // where hitting "go" will take you

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

function componentNav() {

	with (document) {
		writeln("<form name=\"goform\" size=\"10\">");
		writeln("<select name=\"golinks\">");
		writeln(tagO + "\" selected size=\"15\">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 + "fargo.htm\">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 + "lam1.htm\">Laminator");
		writeln(tagO + site + "neck1.htm\">Lanyards");
		writeln(tagO + site + "magread1.htm\">Magnetic Reader/Writer");
		writeln(tagO + site + "pvc.htm\">PVC Cards");
		writeln(tagO + site + "print1.htm\">Printers");
		writeln(tagO + site + "fargo.htm\">Ribbons");
		writeln(tagO + site + "services.htm\">Services");
		writeln(tagO + site + "mmperiph.htm\">Signature Capture Tablet");
		writeln(tagO + site + "slot.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>');

		
		}
}



<!-- Specials -->

function addspecials() {

	var rand1 = 0;
	var rand2 = 0;
	var rand3 = 0;


	images = ["special9.gif", "special20.gif"];
	links = ["pl4a.htm", "pl12a.htm"];

	rand1 = Math.round(Math.random() * (images.length -1));

	do {
		rand2 = Math.round(Math.random() * (images.length -1));
	} while (rand2 == rand1);

	//do {
	//	rand3 = Math.round(Math.random() * (images.length -1));
	//} while (rand3 == rand1 || rand3 == rand2);

	document.write("<a href=\""+links[rand1]+"\"><img src=\"images/"+images[rand1]+"\" width=\"80\" height=\"100\" border=\"0\" alt=\"View This Special\"></a><br><br>");
	document.write("<a href=\""+links[rand2]+"\"><img src=\"images/"+images[rand2]+"\" width=\"80\" height=\"100\" border=\"0\" alt=\"View This Special\"></a><br><br>");
//	document.write("<a href=\""+links[rand3]+"\"><img src=\"images/"+images[rand3]+"\" width=\"80\" height=\"100\" border=\"0\" alt=\"View This Special\"></a><br><br>");
//	document.write("<a href=\"upstrack.htm\"><img border=0 src=\"images/upstrack.gif\" width=\"59\" height=\"73\" alt=\"Track UPS Shipment Sent from ID House\"></a><br><br>");
//	document.write("<a href=\"fedextrack.htm\"><img border=0 src=\"images/fedextrack.gif\" width=\"100\" height=\"66\" alt=\"Track FedEx Shipment Sent from ID House\"></a><br><br>");
//	document.write("<br><a href=\"faq1.htm\"><img border=0 src=\"images/idhfaq.jpg\" width=\"100\" height=\"25\" alt=\"Frequently Asked Questions\"></a>");
}

function CheckOptions(myForm)
{
	if(myForm.selectedIndex==0)
	{
		alert("Please select an option.");
		myForm.focus();
		return false;
	}
	else
	{
		return true;
	
	}
}

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/22/2005"] = "thanksgiving";
		dateArray["11/23/2005"] = "thanksgiving";
		dateArray["11/24/2005"] = "thanksgiving";
	
		dateArray["12/22/2005"] = "christmas";
		dateArray["12/23/2005"] = "christmas";
		dateArray["12/24/2005"] = "christmas";
		dateArray["12/25/2005"] = "christmas";
		dateArray["12/26/2005"] = "christmas";
	
		dateArray["12/28/2005"] = "newyear";
		dateArray["12/29/2005"] = "newyear";
		dateArray["12/30/2005"] = "newyear";
		dateArray["12/31/2005"] = "newyear";
		dateArray["1/1/2006"] = "newyear";
		dateArray["1/2/2006"] = "newyear";
	
		dateArray["5/25/2006"] = "memorial";
		dateArray["5/26/2006"] = "memorial";
		dateArray["5/27/2006"] = "memorial";
		dateArray["5/28/2006"] = "memorial";
		dateArray["5/29/2006"] = "memorial";
	
		dateArray["6/30/2006"] = "independence";
		dateArray["7/1/2006"] = "independence";
		dateArray["7/2/2006"] = "independence";
		dateArray["7/3/2006"] = "independence";
		dateArray["7/4/2006"] = "independence";
	
		dateArray["9/1/2006"] = "labor";
		dateArray["9/2/2006"] = "labor";
		dateArray["9/3/2006"] = "labor";
		dateArray["9/4/2006"] = "labor";	

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