// JavaScript Document
function Address(user) {
site = "wendrickstruss";
document.write('<a href=\"mailto:' + user + '@' + site + '.com\" onmouseover=\"status=\'\'; return true\">');
}

function fullAddress(user) {
site = "wendrickstruss";
document.write('<a href=\"mailto:' + user + '@' + site + '.com\" onmouseover=\"status=\'\'; return true\">' + user + '@' + site + '.com</a>');
}

function otherFullAddress(suffix,site,user) {
document.write('<a href=\"mailto:' + user + '@' + site + '.' + suffix + '\" onmouseover=\"status=\'\'; return true\">' + user + '@' + site + '.' + suffix + '</a>');
}

function hiddenLink(filename,path,querystring) {
var suffix="asp"
document.write('<a href=\"' + path + '/' + filename + '.' + suffix + querystring + '\" onmouseover=\"status=\'\'; return true\">');
}

function deleteTitle(title,descrip) {
	if (confirm("Are you sure you want to delete this?\n\n"+title+"\n"+descrip)==false) {
		return false
	}
	else {
		return true
	}
}

function popupCheck() {
	if (window.newWindow != null) {
		window.newWindow.focus()
		if (window.newWindow.newWindow2 != null) {
			window.newWindow.newWindow2.focus()
		}
	}
}

function findEmail2(form) {
	contactChoice=form.Contact.selectedIndex
	if (form.Contact.options[contactChoice].value=="AddNew") {
		document.getElementById("ContactCell").innerHTML="<input type='text' name='Contact' style='width:112px'>"
		form.Contact.focus()
	}
	else {
		var contactpair=form.Contact.value
		var address=contactpair.search(/&/)+1
		form.Email.value=contactpair.substring(address)
		//form.Contact[form.Contact.selectedIndex].value=contactpair.slice(0,contactpair.search(/&/)-1)
		form.Email.blur()
	}
}

function buttonDown(button) {
	button.style.borderStyle="inset"
	if (button.tagName=="TD" || button.tagName=="td") {
		var i=-1
		do {
			i++
		} while (document.getElementsByTagName("td")[i].className!="selected")
		document.getElementsByTagName("td")[i].style.borderStyle="solid"
	}
}
var buttonElement
function buttonUp(button) {
	buttonElement=button
	setTimeout("liftButton()",200)
}
function liftButton() {
	buttonElement.style.borderStyle="solid"
}
function buttonClick(button) {
	button.style.borderStyle="inset"
	buttonUp(button)
}

function printPage() {
        if (window.print) {
               setTimeout('window.print();', 333);
        }
        else if (agt.indexOf("mac") != -1) {
               alert("Press 'Cmd+p' on your keyboard to print article.");
        }
        else {
               alert("Press 'Ctrl+p' on your keyboard to print article.")
        }
}

//Macromedia functions
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features); 
}
function mmLoadMenus() {
  window.mm_menu_0826201618_0 = new Menu("root",120,15,"Verdana, Arial, Helvetica, sans-serif",9,"#999999","green","#373737","#373737","left","middle",3,0,1000,-5,7,true,false,true,0,false,true);
  mm_menu_0826201618_0.addMenuItem("RAFTER&nbsp;CALCULATOR","location='/calculator/index.asp'");
  mm_menu_0826201618_0.addMenuItem("ROOF&nbsp;&&nbsp;WALL&nbsp;DATA","location='/pages/areacalc.htm'");
   mm_menu_0826201618_0.fontWeight="bold";
   mm_menu_0826201618_0.hideOnMouseOut=true;
   mm_menu_0826201618_0.bgColor='#555555';
   mm_menu_0826201618_0.menuBorder=1;
   mm_menu_0826201618_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0826201618_0.menuBorderBgColor='#777777';
    window.mm_menu_0826204228_0 = new Menu("root",120,15,"Verdana, Arial, Helvetica, sans-serif",9,"#999999","green","#373737","#373737","left","middle",3,0,1000,-5,7,true,false,true,0,true,true);
  mm_menu_0826204228_0.addMenuItem("","");  // placeholder for sports schedules
  mm_menu_0826204228_0.addMenuItem("PHOTO ALBUMS","location='/pages/sponsorships.asp'");
  //mm_menu_0826204228_0.addMenuItem("SPORTS&nbsp;SCHEDULES","location='/pages/schedules.asp'");
   mm_menu_0826204228_0.fontWeight="bold";
   mm_menu_0826204228_0.hideOnMouseOut=true;
   mm_menu_0826204228_0.bgColor='#555555';
   mm_menu_0826204228_0.menuBorder=1;
   mm_menu_0826204228_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0826204228_0.menuBorderBgColor='#777777';
   
 //admin menus
  window.mm_menu_0826201619_0 = new Menu("root",120,15,"Verdana, Arial, Helvetica, sans-serif",9,"#999999","green","#373737","#373737","left","middle",3,0,1000,-5,7,true,false,true,0,false,true);
  mm_menu_0826201619_0.addMenuItem("RAFTER&nbsp;CALCULATOR","location='/calculator/index.asp'");
  mm_menu_0826201619_0.addMenuItem("ROOF&nbsp;&&nbsp;WALL&nbsp;DATA","location='/pages/areacalc.htm'");
   mm_menu_0826201619_0.fontWeight="bold";
   mm_menu_0826201619_0.hideOnMouseOut=true;
   mm_menu_0826201619_0.bgColor='#555555';
   mm_menu_0826201619_0.menuBorder=1;
   mm_menu_0826201619_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0826201619_0.menuBorderBgColor='#777777';
   
    window.mm_menu_0826204229_0 = new Menu("root",120,15,"Verdana, Arial, Helvetica, sans-serif",9,"#999999","green","#373737","#373737","left","middle",3,0,1000,-5,7,true,false,true,0,true,true);
  mm_menu_0826204229_0.addMenuItem("PHOTO ALBUMS","location='sponsorships.asp'");
  mm_menu_0826204229_0.addMenuItem("SPORTS&nbsp;SCHEDULES","location='schedules.asp'");
   mm_menu_0826204229_0.fontWeight="bold";
   mm_menu_0826204229_0.hideOnMouseOut=true;
   mm_menu_0826204229_0.bgColor='#555555';
   mm_menu_0826204229_0.menuBorder=1;
   mm_menu_0826204229_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0826204229_0.menuBorderBgColor='#777777';


//contests menu
  if (window.mm_menu_0919114213_0) return;
  window.mm_menu_0919114213_0 = new Menu("root",180,15,"Verdana, Arial, Helvetica, sans-serif",9,"#999999","#ffcc33","#333333","#666666","left","middle",3,1,1000,-5,7,true,true,true,0,true,true);
  //mm_menu_0919114213_0.addMenuItem("Outdoor Photos","location='/Pages/Client/Up/BuckContest.asp'");
  mm_menu_0919114213_0.addMenuItem("Outdoor Journal","location='/Pages/Client/Up/BuckContest.asp'");
  mm_menu_0919114213_0.addMenuItem("NASCAR pool","location='/Pages/Client/NASCAR.asp'");
  mm_menu_0919114213_0.addMenuItem("NASCAR pool standings","location='/Pages/Client/Standings.asp?id=2'");
  //mm_menu_0919114213_0.addMenuItem("NFL Pool","document.SportsPool.submit()");
  mm_menu_0919114213_0.addMenuItem("NFL Pool","location='/Pages/Client/NFLpool.asp'");
  //mm_menu_0919114213_0.addMenuItem("NFL Pool standings","location='/Pages/Client/Standings.asp?id=1&start=17'");
  //2007 Sportsline link: http://wendrickstrusspool.football.sportsline.com/opm/make-picks
  //2008 mm_menu_0919114213_0.addMenuItem("NFL Pool standings","document.SportsPool.xurl.value='http://wendrickstrusspool.football.sportsline.com/opm/standings?&_1:col_1=3&_1:col_2=2';document.SportsPool.submit()");
  mm_menu_0919114213_0.addMenuItem("NCAA Basketball pool","document.SportsPool.submit()");
  mm_menu_0919114213_0.addMenuItem("NCAA Basketball pool standings","document.SportsPool.xurl.value='http://wendricks.mayhem.cbssports.com/opm/standings';document.SportsPool.submit()");
  if (mmLoadMenus.arguments.length>0) {
  	for (i=0; i<mmLoadMenus.arguments.length; i++) {
  		mm_menu_0919114213_0.addMenuItem(mmLoadMenus.arguments[i],"location='"+mmLoadMenus.arguments[i+1]+"'")
  		i++
  	}
  }
   mm_menu_0919114213_0.fontWeight="bold";
   mm_menu_0919114213_0.hideOnMouseOut=true;
   mm_menu_0919114213_0.bgColor='#cccccc';
   mm_menu_0919114213_0.menuBorder=1;
   mm_menu_0919114213_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0919114213_0.menuBorderBgColor='#A8A8A8';

//how-to's menu
  if (window.mm_menu_0919114215_0) return;
  window.mm_menu_0919114215_0 = new Menu("root",160,15,"Verdana, Arial, Helvetica, sans-serif",9,"#999999","#ffcc33","#333333","#666666","left","middle",3,1,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0919114215_0.addMenuItem("About Wendricks Truss","window.open('/Pages/Client/Howtos/About Wendricks Truss.pdf','OnlinePricing')");
  mm_menu_0919114215_0.addMenuItem("Client Screen Overview","window.open('/Pages/Client/Howtos/Client Screen Overview.pdf','CustomerQuote')");
  mm_menu_0919114215_0.addMenuItem("Change your client settings","window.open('/Pages/Client/Howtos/How to change your client settings.pdf','OnlinePricing')");
  mm_menu_0919114215_0.addMenuItem("Log In","window.open('/Pages/Client/Howtos/How to Log In.pdf','CustomerQuote')");
  mm_menu_0919114215_0.addMenuItem("Use Customer Quote","window.open('/Pages/Client/Howtos/How to use Customer Quote.pdf','OnlinePricing')");
  mm_menu_0919114215_0.addMenuItem("Use Get Quote","window.open('/Pages/Client/Howtos/How to use Get Quote.pdf','CustomerQuote')");
  mm_menu_0919114215_0.addMenuItem("Use Online Pricing","window.open('/Pages/Client/Howtos/Online Pricing.pdf','OnlinePricing')");
  mm_menu_0919114215_0.addMenuItem("Roof and Floor Manual","window.open('/Pages/Client/Howtos/Roof and Floor Manual.pdf','CustomerQuote')");
  mm_menu_0919114215_0.addMenuItem("Upload Drawings to Wendricks","window.open('/Pages/Client/Howtos/Upload Drawings to Wendricks.pdf','CustomerQuote')");
  mm_menu_0919114215_0.addMenuItem("View and Approve Shop Drawings","window.open('/Pages/Client/Howtos/View and Approve Shop Drawings.pdf','OnlinePricing')");
  mm_menu_0919114215_0.addMenuItem("View Delivered Jobs","window.open('/Pages/Client/Howtos/View Delivered Jobs.pdf','CustomerQuote')");
  mm_menu_0919114215_0.addMenuItem("Website Tour","window.open('/Pages/Client/Howtos/Website Tour.pdf','OnlinePricing')");
  mm_menu_0919114215_0.addMenuItem("Wendricks Total Wall System","window.open('/Pages/Client/Howtos/Wendricks Total Wall System.pdf','CustomerQuote')");
   mm_menu_0919114215_0.fontWeight="bold";
   mm_menu_0919114215_0.hideOnMouseOut=true;
   mm_menu_0919114215_0.bgColor='#cccccc';
   mm_menu_0919114215_0.menuBorder=1;
   mm_menu_0919114215_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0919114215_0.menuBorderBgColor='#A8A8A8';

mm_menu_0919114213_0.writeMenus();

mm_menu_0826204228_0.writeMenus();

mm_menu_0919114215_0.writeMenus();


} // mmLoadMenus()

function getPassword(contactName) {
	contactName.style.border='none'
	if (contactName[contactName.selectedIndex].value.slice(0,1)=='p') {
		contactName[contactName.selectedIndex].value=contactName[contactName.selectedIndex].value.slice(1)
		document.getElementById("ContactLogin").innerHTML="Please select a personal password:<input type='text' name='Password' style='width:92px; background:transparent; text-align:center;'><input type='submit' value='Submit' style='margin-left:22px'><br><input type='checkbox' class='checkbox' name='Remember' value='True'>Remember"
		alert("Please enter a personal password in the box which is different from your company password.\n  This will keep track of your Truss Bucks for the store and games, and fill in your name on forms.\n  You can also login on the homepage with your name and this password.")
	}
	else {
		if (contactName[contactName.selectedIndex].value==0) {
			document.Login.submit()  //logout
		}
		else {
			document.getElementById("ContactLogin").innerHTML="Password:<input type='text' name='Password' style='width:92px; background:transparent; text-align:center;'><input type='submit' value='Submit' style='margin-left:22px'><br><input type='checkbox' class='checkbox' name='Remember' value='True'>Remember<br><a href='Client.asp?action=forgot&id="+contactName[contactName.selectedIndex].value+"' style='margin-left:23px; line-height:20px; border:1px solid #999999; padding: 1 2 1 2px; background:#555555'>Forgot</a>"
		}
	}
	document.Login.Password.focus()
}

function commaCheck(inputbox) {
	if (inputbox.value.search(",")>0) {
		alert("Sorry, please remove commas from the name of the file you want to upload.")
	}
}
function summaryOn(notes,event,cell) {
	if (event.pageY) { //Firefox
		document.getElementById("Summary").style.top=event.pageY-120+"px"
		document.getElementById("Summary").style.left=event.pageX-100+"px"
		//alert(event.pageY+","+event.pageX)
	}
	else { //IE
	    var IEpageY=Number(event.srcElement.offsetParent.offsetParent.offsetTop)+Number(event.srcElement.offsetParent.offsetTop)+Number(event.srcElement.offsetTop)
	    var IEpageX=Number(event.srcElement.offsetParent.offsetParent.offsetLeft)+Number(event.srcElement.offsetParent.offsetLeft)+Number(event.srcElement.offsetLeft)
		document.getElementById("Summary").style.top=IEpageY-100+"px"
		document.getElementById("Summary").style.left=IEpageX-100+"px"
		//alert(event.srcElement.offsetParent.offsetParent.offsetTop+"+"+event.srcElement.offsetParent.offsetTop+"+"+event.srcElement.offsetTop+","+event.srcElement.offsetParent.offsetParent.offsetLeft+"+"+event.srcElement.offsetParent.offsetLeft+"+"+event.srcElement.offsetLeft)
	}
	var summaryHeight=notes.length/40*14+20
	if (summaryHeight<100) {summaryHeight=100}
	document.getElementById("Summary").style.height=+"px"
	var fixedText=notes.replace(/###/g,"&quot;")
	document.getElementById("Summary").innerHTML=fixedText.replace(/##/g,"'")
	document.getElementById("Summary").style.visibility="visible"
}

function summaryOff() {
	document.getElementById("Summary").style.visibility="hidden"
}

function contactLogin(username,word) {
	document.ContactLogin.Username.value=username
	document.ContactLogin.Password.value=word
	document.ContactLogin.submit()
}
function isDate(inputdate) {
	var test=new Date("test")
	var d=new Date(inputdate)
	if (test.toDateString()=="Invalid Date") { //Firefox
		if (d.toDateString()=="Invalid Date") {
			alert("Please enter a date (##/##/##).")
			//inputbox.focus()
			return false
		}
	}
	else { //IE7
		if (d.toDateString().toString()=="NaN") {
			alert("Please enter a date (##/##/##).")
			//inputbox.focus()
			return false
		}
	}
}

function buttonRoll(link) {
	link.parentNode.style.backgroundImage="url(/Buttons/Blank_B.gif)"
}

function buttonRollOff(link) {
	link.parentNode.style.backgroundImage="url(/Buttons/Blank_A.gif)"
}
