

//***************/
//timeout script
//***************/
 
// Global variables
StartTime = new Date();
StartMils = Date.parse(StartTime.toLocaleString());
TimeOutMils = StartMils + (60000 * 30);
ThresholdMils = 60000 * 10;
 
function CountDown()
{
clearTimeout('timerLoop');
CurrentTime = new Date();
CurrentMils = Date.parse(CurrentTime.toLocaleString());
RemainingMils = TimeOutMils - CurrentMils;
 
if(RemainingMils < ThresholdMils)
window.alert('Your session will soon end, due to inactivity.  It you would like to keep your session active, visit another page.');
else
timerLoop = setTimeout('CountDown()', 10000);
}
 
//***********************/
//Packing pages scripts
//***********************/

function myPopup1() {
window.open("Alexandria.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup2() {
window.open("anoka.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup3() {
window.open("applpack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup4() {
window.open("aurora.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup5() {
window.open("bempack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup6() {
window.open("bovey.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup7() {
window.open("blainepack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup8() {
window.open("brookpack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup9() {
window.open("chanpack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup10() {
window.open("buffpack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup11() {
window.open("ClearLakeClrWatrBecker.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup12() {
window.open("deer.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup13() {
window.open("delpack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup14() {
window.open("duluth.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup15() {
window.open("embpack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup16() {
window.open("elkpack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup17() {
window.open("faripack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}

function myPopup18() {
window.open("grapidspack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup19() {
window.open("hibbing.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup20() {
window.open("hillcity.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup21() {
window.open("hopkpack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup22() {
window.open("hugopack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup23() {
window.open("hutchpack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup24() {
window.open("inverpack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup25() {
window.open("lawrence.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup26() {
window.open("mankpack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup27() {
window.open("nash.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup28() {
window.open("montbiglakepack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup29() {
window.open("newbrightpack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup30() {
window.open("nostpaul.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup31() {
window.open("owatpack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup32() {
window.open("prapids.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup33() {
window.open("pengilly.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup34() {
window.open("priorlake.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup35() {
window.open("rosepack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup36() {
window.open("royalpack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup37() {
window.open("saukpack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup38() {
window.open("stmike.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup39() {
window.open("rosepack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup40() {
window.open("stpaulmidpack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup41() {
window.open("shakpack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup42() {
window.open("silverpack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup43() {
window.open("sostpaul.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup44() {
window.open("twoh.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup45() {
window.open("winpack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup46() {
window.open("woodpack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup47() {
window.open("zimpack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup48() {
window.open("stilpack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function myPopup49() {
window.open("minpack.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function tshirts() {
window.open("tshirts.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function solidCaps() {
window.open("solid caps.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function polos() {
window.open("polos.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function camoCaps() {
window.open("camo caps.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
function hoodies() {
window.open("hoodies.html", "myWindow", "status = 1, height = 550, width = 350, resizable = 0")
}
// mouse over tabs

//Mouseover Tabs Menu: By http://www.dynamicdrive.com
//** Aug 4th, 08': Script creation date

var mouseovertabsmenu={

disappeardelay: 250, //set delay in miliseconds before sub menu disappears onmouseout
ajaxloadingmsg: 'Loading Sub Menu Contents...', //Message to show inside sub menu while fetching contents

///////No need to edit beyond here//////////////////////

tabsmenutree:{},

initializetabs:function(tabsmenuid, submenuid, tabcontentsLength, disappearBool){
	var tabmenu=document.getElementById(tabsmenuid)
	var tablinks=tabmenu.getElementsByTagName("a")
	var submenu=document.getElementById(submenuid)
	var selected=null, tablinks_count=0
	for (var i=0; i<tablinks.length; i++){
		tablinks[i]._parentid=tabsmenuid
		var relattr=tablinks[i].getAttribute("rel")
		if (/^gotsubmenu/i.test(relattr) && tablinks_count<tabcontentsLength){ //if "rel" attribute starts with="gotsubmenu" and a tab content exists for this tab based on its order
			tablinks[i]._pos=tablinks_count //remember position of this tab relative to its active peers
			if (relattr.indexOf("[selected]")!=-1){
				selected=tablinks_count
			}
			this.addEvent(tablinks[i], function(){
				var tabsmenutree=mouseovertabsmenu.tabsmenutree[this._parentid]
				mouseovertabsmenu.clearhidetimer(tabsmenutree.submenu.hidetimer)
				mouseovertabsmenu.showsubmenu(this)
			}, "mouseover")
			tablinks_count++
			this.tabsmenutree[tabsmenuid].tabs.push(tablinks[i]) //add this tab to tab collection
		}
		else{ //else for regular tab links (with no "rel" attribute)
			this.addEvent(tablinks[i], function(){
				mouseovertabsmenu.hidesubmenu(this._parentid)
			}, "mouseover")
		}
	}
	this.addEvent(submenu, function(e){
		mouseovertabsmenu.clearhidetimer(this.hidetimer)
	}, "mouseover")
	if (disappearBool==true){
		this.addEvent(submenu, function(e){ //hide submenu contents when mouse rolls out of submenu DIV
			if (!mouseovertabsmenu.isContained(this, e)){
				var cursubmenuobj=this
				this.hidetimer=setTimeout(function(){mouseovertabsmenu.hidesubmenu(cursubmenuobj._parentid)}, mouseovertabsmenu.disappeardelay)
			}
		}, "mouseout")
	}
	var urlselected=this.urlparamselect(tabsmenuid)
	//return position of selected tab (relative to its peers), or null
	return typeof urlselected=="number"? urlselected : document.getElementById(urlselected)? document.getElementById(urlselected)._pos : selected
},

ajaxload:function(tabsmenuid, submenuid, disappearBool, url){
	var page_request = false
	if (window.ActiveXObject){ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
		try {
		page_request = new ActiveXObject("Msxml2.XMLHTTP")
		} 
		catch (e){
			try{
			page_request = new ActiveXObject("Microsoft.XMLHTTP")
			}
			catch (e){}
		}
	}
	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
		page_request = new XMLHttpRequest()
	else
		return false
	var tabsmenutree=this.tabsmenutree[tabsmenuid]
	tabsmenutree.submenu.innerHTML=this.ajaxloadingmsg
	var ajaxfriendlyurl=url.replace(/^http:\/\/[^\/]+\//i, "http://"+window.location.hostname+"/") 
	page_request.onreadystatechange=function(){
		mouseovertabsmenu.ajaxpopulate(page_request, tabsmenuid, submenuid, disappearBool, ajaxfriendlyurl)
	}
	var bustcache=(ajaxfriendlyurl.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
	page_request.open('GET', ajaxfriendlyurl+bustcache, true)
	page_request.send(null)
},

ajaxpopulate:function(page_request, tabsmenuid, submenuid, disappearBool, url){
	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
		var tabsmenutree=this.tabsmenutree[tabsmenuid]
		tabsmenutree.submenu.innerHTML=page_request.responseText
		var innerdivs=tabsmenutree.submenu.getElementsByTagName("div")
		for (var i=0; i<innerdivs.length; i++){
			if (/tabsmenucontent/i.test(innerdivs[i].className)){
				tabsmenutree.submenu_divs.push(innerdivs[i])
			}
		}
		var selected=this.initializetabs(tabsmenuid, submenuid, tabsmenutree.submenu_divs.length, disappearBool)
		if (selected!=null && selected<tabsmenutree.submenu_divs.length){
			innerdivs[selected].style.display="block"
			this.css(tabsmenutree.tabs[selected], "selected", "add")
			tabsmenutree.submenu._prevselected=selected
		}
	}
},

showsubmenu:function(linkobj){
	var tabsmenutree=this.tabsmenutree[linkobj._parentid]
	this.hidesubmenu(linkobj._parentid)
	var selected=parseInt(linkobj._pos)
	tabsmenutree.submenu_divs[selected].style.display="block"
	this.css(tabsmenutree.tabs[selected], "selected", "add")
	tabsmenutree.submenu._prevselected=selected
},

hidesubmenu:function(tabsmenuid){
	var tabsmenutree=this.tabsmenutree[tabsmenuid]
	var prevselectedindex=tabsmenutree.submenu._prevselected
	if (typeof prevselectedindex!="undefined"){
		tabsmenutree.submenu_divs[prevselectedindex].style.display="none"
		this.css(tabsmenutree.tabs[prevselectedindex], "selected", "remove")
	}
},

clearhidetimer:function(timerid){
	if (timerid)
		clearTimeout(timerid)
},

css:function(el, targetclass, action){
	var needle=new RegExp("(^|\\s+)"+targetclass+"($|\\s+)", "ig")
	if (action=="check")
		return needle.test(el.className)
	else if (action=="remove")
		el.className=el.className.replace(needle, "")
	else if (action=="add" && !needle.test(el.className))
		el.className+=" "+targetclass
},

isContained:function(m, e){
	var e=window.event || e
	var c=e.relatedTarget || ((e.type=="mouseover")? e.fromElement : e.toElement)
	while (c && c!=m)try {c=c.parentNode} catch(e){c=m}
	if (c==m)
		return true
	else
		return false
},

urlparamselect:function(tabsmenuid){
	var result=window.location.search.match(new RegExp(tabsmenuid+"=(\\w+)", "i")) //check for "?tabsmenuid=id_or_pos_of_selected_tab" in URL
	var selectedtabstr=RegExp.$1
	return /^\d+$/.test(selectedtabstr)? parseInt(selectedtabstr) : selectedtabstr //return position or ID of selected tab (or null if niether found)
},


addEvent:function(target, functionref, tasktype){
	if (target.addEventListener)
		target.addEventListener(tasktype, functionref, false);
	else if (target.attachEvent)
		target.attachEvent('on'+tasktype, function(){return functionref.call(target, window.event)});
},

init:function(tabsmenuid, submenuid, disappearBool){
	this.tabsmenutree[tabsmenuid]={} 
	this.tabsmenutree[tabsmenuid].tabs=[] //array referencing the active tab links in this menu (ones with a "rel=gotsubmenu" attr)
	this.tabsmenutree[tabsmenuid].submenu=null //reference submenu DIV for this menu
	this.tabsmenutree[tabsmenuid].submenu_divs=[] //array referencing the submenu contents (external DIVs with class="tabsmenucontent")
	var submenu=document.getElementById(submenuid)
	submenu._parentid=tabsmenuid
	this.tabsmenutree[tabsmenuid].submenu=submenu //remember this DIV as menu's submenu container
	var remoteurl=submenu.getElementsByTagName("a")[0].getAttribute("href")
	this.ajaxload(tabsmenuid, submenuid, disappearBool, remoteurl)
}

}

document.write('<style type="text/css">\n.tabsmenucontent{display:none}\n</style>')



function validate(shirts){


var name = document.shirts.name.value;
var address = document.shirts.address.value;
var city = document.shirts.city.value;
var state = document.shirts.state.value;
var zip = document.shirts.zip.value;
var email = document.shirts.email.value;
var phone = document.shirts.phone.value;
var paypal = document.shirts.paypal.value;
var check = document.shirts.check.value;
var errors = [];

 if (name=="") {
  errors[errors.length] = "Please enter a name.";
 }
 if (email=="") {
  errors[errors.length] = "Please enter an email address.";
 }
 if (address=="") {
  errors[errors.length] = "Please enter an address.";
 }
 if (city=="") {
  errors[errors.length] = "Please enter a city.";
 }
 if (state=="") {
  errors[errors.length] = "Please enter a state.";
 }
 if (zip=="") {
  errors[errors.length] = "Please enter a zip code.";
 }
 if (phone=="") {
  errors[errors.length] = "Please enter a phone number.";
 }
 if (paypal=="" && check=="") {
  errors[errors.length] = "Please enter a payment method.";
 }
 if (errors.length > 0) {

  reportErrors(errors);
  return false;
 }
  return true;
}
function reportErrors(errors){
 var msg = "Form is incomplete...\n";
 for (var i = 0; i<errors.length; i++) {
 var numError = i + 1;
  msg += "\n" + numError + ". " + errors[i];
}
 alert(msg);
}


