//Form highlighting script
if (navigator.userAgent.indexOf('MSIE') != -1)
{
	function doHighlight(elementName)
	{
	var defaultBGcolor = "#E4F1F7";
	var defaultFGcolor = "#2C2C2C";
	var defaultBDcolor = "#838383";
	var hoverBGcolor = "#EBD8D8";
	var hoverFGcolor = "#2C2C2C";
	var hoverBDcolor = "#000000";
	for (var i=0;i<whatTag(elementName).length;i++)
		{
			var currentEl=whatTag(elementName)[i];
			if (!((currentEl.className=="nohigh")||(currentEl.type=="button")||(currentEl.type=="submit")||(currentEl.type=="radio")))
			{
				currentEl.onfocus=function(){this.style.backgroundColor=hoverBGcolor;this.style.color=hoverFGcolor;this.style.borderColor=hoverFGcolor;};
				currentEl.onblur=function(){this.style.backgroundColor=defaultBGcolor;this.style.color=defaultFGcolor;this.style.borderColor=defaultBDcolor;};
			}
		}
	}
	function highlightFormInput()
	{
	//need to find the default value from the style sheet
	//alert(document.styleSheets[1].cssText);
	//var strRule ="";
	//for (r=0;r<document.styleSheets[1].cssText.length;r++)
	//	{
	//	strRule+=document.styleSheets[1].cssText[r].value;
	//	}
	//	alert(strRule);
	doHighlight("INPUT");
	doHighlight("TEXTAREA");
	doHighlight("SELECT");
	}
	function whatTag(tagName)
	{
	var value=document.getElementByTagName?document.getElementByTagName(tagName):document.all.tags(tagName);
		return value;
	}
	if (document.all)
		{
		window.onload = highlightFormInput;
		}
}
var win=null;
function NewWindow(myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open('invoice.html',myname,settings);}
function toggle_promos()
{
	var box = document.getElementById('promobox');
	var expand_button_text = document.getElementById('expand_button_text');
	if (box.style.display == "none") { var protog = false; }
	else { var protog = true; }
	if (protog)
	{
		box.style.display = "none";
		expand_button_text.innerHTML = "VIEW";
		protog = false;
		
		var exdate=new Date();
		exdate.setDate(exdate.getDate()+365);
		document.cookie = "view_specials=" +escape("off")+";expires="+exdate.toUTCString()+"; path=/";
	}
	else
	{
		box.style.display = "block";
		expand_button_text.innerHTML = "CLOSE";
		protog = true;
		
		var exdate=new Date();
		exdate.setDate(exdate.getDate()+365);
		document.cookie = "view_specials=" +escape("on")+";expires="+exdate.toUTCString()+"; path=/";
	}
}

