function popText(URL,w,h){
	popup = window.open(URL,"linkpopup","toolbar=yes,scrollbars=yes,width=" + w + ",height=" + h + ",directories=no,status=yes,resizable=no,location=no,menubar=yes");
	if(popup==null) {alert("Could not open window!\n\nDisable popup blockers to allow a new window to open, then login again.");}
	else{
		popup.moveTo(100,0);
	  	popup.focus();
	}
}

function checkContactForm(){
	msg = "";
	if(document.contactForm.My_Full_Name.value=="") { msg=msg+"Full Name\n"; }
	if(document.contactForm.My_Grad_Year.value=="") { msg=msg+"Graduation Year\n"; }
	if(document.contactForm.My_Email_Address.value=="") { msg=msg+"Email Address\n"; }
	if(document.contactForm.add1.value=="") { msg=msg+"Address Line 1\n"; }
	if(document.contactForm.City.value=="") { msg=msg+"City\n"; }
	if(document.contactForm.State.value=="") { msg=msg+"State\n"; }
	if(document.contactForm.Zip.value=="") { msg=msg+"Zip\n"; }
	if(document.contactForm.Country.value=="") { msg=msg+"Country\n"; }
	if(msg==""){
		return true;
	}
	else{
		msg = "Please fill in all required fields:\n\n"+msg;
		alert(msg);
		return false;
	}
}

function checkValue(whichForm,whichItem,whichSecondItem,whichThirdItem)
	{
	//alert("document." + whichForm + "." + whichItem + ".value");
	//alert("document." + whichForm + "." + whichSecondItem + ".value");
	//alert("document." + whichForm + "." + whichThirdItem + ".value");
	if(whichForm=="dues")
		{
		temp=eval("document." + whichForm + "." + whichItem + ".value");	
		if(temp !="")
			{
			var dues_amt
			dues_amt = 0;
			if(document.dues.ForLife.checked)
				{
				dues_amt=dues_amt + 300;
				}
			if(document.dues.SeniorForLife.checked)
				{
				dues_amt=dues_amt + 150;
				}
			if(dues_amt == 0)
				{
				document.dues.amount.value=dues_amt + 15;
				}
			else
				{
				document.dues.amount.value=dues_amt;			
				}									
			}
		else
			{
			alert("Please include your graduation year when paying dues.");
			return false;						
			}
		}		
	if(whichForm=="classfund")
		{
		var generalfund;
		var scholarshipfund;
		generalfund = eval(document.classfund.generalfund.checked);
		scholarshipfund = eval(document.classfund.scholarshipfund.checked);
		temp=eval("document." + whichForm + "." + whichItem + ".value");	
		temp1=eval("document." + whichForm + "." + whichSecondItem + ".value");	
		temp2=eval("document." + whichForm + "." + whichThirdItem + ".value");	
		if(((generalfund == true) || (scholarshipfund == true)) &! ((generalfund == true) && (scholarshipfund == true)))
			{
			if(generalfund == true)
				{
				temp3="General"
				}
			if(scholarshipfund == true)
				{
				temp3="Scholarship"
				}
			}
		else
			{
			temp3=""
			}
		if(temp!="" && temp1 !="" && temp2 != "" && temp3 != "")
			{
			document.classfund.item_name.value="Your Class "+temp3+" Fund";
			document.classfund.amount.value=eval(document.classfund.os3.value);
			}
		else
			{
			alert("Please include your graduation year, name, one fund type and amount when posting money to class funds.");
			return false;			
			}
		}
	return true;
	}

function alertLifeTime(){
	if(document.dues.ForLife.checked){
	if(confirm("If you check the Life-Time Membership box, you will be charged $300 and will never have to pay dues again!\n\nWould you like to continue?")){
		document.dues.ForLife.checked = true;
	}
	else{
		document.dues.ForLife.checked = false;
	}
	}
}

function alertSeniorLifeTime(){
	if(document.dues.SeniorForLife.checked){
	if(confirm("If you check the Senior Life-Time Membership box, you will be charged $150 and will never have to pay dues again!\n\nWould you like to continue?")){
		document.dues.SeniorForLife.checked = true;
	}
	else{
		document.dues.SeniorForLife.checked = false;
	}
	}
}


function changePrice(whichForm,whichItem,whichValue){
	//alert(whichForm + " " + whichItem + " " + whichValue);
	if(whichForm=="sweatShirt"){
		if(whichValue=="X-Large"){
			temp=eval("document." + whichForm + "." + whichItem + ".value=28");
		}
		if(whichValue=="X-X-Large"){
			temp=eval("document." + whichForm + "." + whichItem + ".value=32");
		}
	}
	if(whichForm=="jacket"){
		if((whichValue=="Small") || (whichValue=="Medium") || (whichValue=="Large") || (whichValue=="X-Large")){
			temp=eval("document." + whichForm + "." + whichItem + ".value=80");
		}
		if(whichValue=="X-X-Large"){
			temp=eval("document." + whichForm + "." + whichItem + ".value=90");
		}
		if(whichValue=="X-X-X-Large"){
			temp=eval("document." + whichForm + "." + whichItem + ".value=95");
		}
	}
	//z=eval("document." + whichForm + "." + whichItem + ".value");
}


function init(){
	MM_preloadImages('images/contact_roll.gif','images/add-update_roll.gif','images/shop_roll.gif','images/volunteer_roll.gif');
}

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 addCosts() {
	var formArray = ["Dues","Pin","Mug","Cap","Note_Cards","Book","T","XL_Sweat","XXL_Sweat","SXL_Jacket","XXL_Jacket","XXXL_Jacket","Windshirt"];
	var costArray = [15,5,8,18,10,15,15,18,32,80,90,95,55];
	var tot = 0;
	for(var i = 0; i < formArray.length ; i++){
		if(isNaN(parseInt(eval("orderForm." + formArray[i] + "_Num.value")))==false){
			whatToDo = "orderForm." + formArray[i] + "_Cost.value = parseInt(orderForm." + formArray[i] + "_Num.value)*" + costArray[i];
			eval(whatToDo);
		}
		else{
			whatToDo = "orderForm." + formArray[i] + "_Cost.value = parseInt(0)";
			eval(whatToDo);
		}
		whatToDo = "tot = tot + parseInt(orderForm." + formArray[i] + "_Cost.value)";
		eval(whatToDo);
		
	}
	orderForm.Total_Cost.value=tot;
}