function BookmarkThisPage(wloc, wtit, msg)
{	
	if(navigator.appName == "Microsoft Internet Explorer"){
		document.write('<a href="javascript:window.external.AddFavorite(\''+wloc+'\',\''+wtit+'\');">'+msg+'</a>'); 
	}else if ((navigator.appname == "Microsoft Internet Explorer") && (navigator.appVersion.indexOf("Mac") != -1)){
		document.write('<a href="javascript:window.external.AddFavorite(BMurl, BMtitle);">Bookmark This Page</a>'); 
	}else if ((navigator.appname != "Microsoft Internet Explorer") && (navigator.appVersion.indexOf("Mac") != -1)){
		msg+= '<br/><font size="-4">Press (CMD-D) to Add</font>';
 		document.write(msg);
	}else{
		msg += '<br/><font size="-4">Press (CTRL-D) to Add</font>';
	document.write(msg);
	}						
}

function hitslink()
{
var ns_data,ns_hp,ns_tz,ns_rf,ns_sr,ns_img,ns_pageName;
// The pageName variable can be customized if needed
ns_pageName=location.pathname;

document.cookie='__support_check=1';ns_hp='http';
ns_rf=document.referrer;ns_sr=window.location.search;
ns_tz=new Date();if(location.href.substr(0,6).toLowerCase()=='https:')
ns_hp='https';ns_data='&an='+escape(navigator.appName)+ 
'&sr='+escape(ns_sr)+'&ck='+document.cookie.length+
'&rf='+escape(ns_rf)+'&sl='+escape(navigator.systemLanguage)+
'&av='+escape(navigator.appVersion)+'&l='+escape(navigator.language)+
'&pf='+escape(navigator.platform)+'&pg='+escape(ns_pageName);
ns_data=ns_data+'&cd='+
screen.colorDepth+'&rs='+escape(screen.width+ ' x '+screen.height)+
'&tz='+ns_tz.getTimezoneOffset()+'&je='+ navigator.javaEnabled();
ns_img=new Image();ns_img.src=ns_hp+'://counter.hitslink.com/statistics.asp'+
'?v=1&s=1&acct=mmtusa'+ns_data+'&tks='+ns_tz.getTime();	
}

function bt(id,after) 
{ 
eval(id+'.filters.blendTrans.stop();'); 
eval(id+'.filters.blendTrans.Apply();'); 
eval(id+'.src="'+after+'";'); 
eval(id+'.filters.blendTrans.Play();'); 
} 

function confirmRemoval()
{
	if (confirm('You are about to remove an entry. Continue?')) {return true;}else{return false;}
}


function validateSU(myForm)
{
	
	re=/^(\D{4,15}\d{2,4})$/
	validUserName=re.exec(myForm.username.value)
	if (!validUserName)
	{
		alert("User name must consist of 4 to 15 letters and 2 to 4 digits. Space is not allowed.")
		myForm.username.focus()
		myForm.username.select()
		return false
	}

	re=/^(\w{8,15})$/
	validPassword=re.exec(myForm.password.value)
	if (!validPassword)
	{
		alert("Password must be 8 to 15 character long; can contain only letters, numbers and underscore character. Space is not allowed.")
		myForm.password.focus()
		myForm.password.select()
		return false
	}
	
	if (myForm.password.value!=myForm.verify.value)
	{
		alert("Password and Verify fields must match")
		myForm.verify.focus()
		myForm.verify.select()
		return false
	}
	
	return true
}

function validateUserName(myForm)
{
	re=/^(\D{4,15}\d{2,4})$/
	validUserName=re.exec(myForm.username.value)
	if (!validUserName)
	{
		alert("User name must consist of 4 to 15 letters and 2 to 4 digits. Space is not allowed.")
		myForm.username.focus()
		myForm.username.select()
		return false
	}
	return true
}

function validateMediaType(myForm)
{
	if (myForm.mediatypeid.value==0)
	{
		alert("Please choose a media type.")
		myForm.mediatypeid.focus()
		myForm.mediatypeid.select()
		return false
	}
	return true
}

function validatePassword(myForm)
{
	
	re=/^(\w{8,15})$/
	validPassword=re.exec(myForm.password.value)
	if (!validPassword)
	{
		alert("Password must be 8 to 15 character long; can contain only letters, numbers and underscore character. Space is not allowed.")
		myForm.password.focus()
		myForm.password.select()
		return false
	}
	
	if (myForm.password.value!=myForm.verify.value)
	{
		alert("Password and Verify fields must match")
		myForm.verify.focus()
		myForm.verify.select()
		return false
	}
	
	return true
}

function isValidEmail(email)
{	
	re=/^.+\@.+\..+$/
	validEmail=re.exec(email)
	if (validEmail) return true;
	return false;
}

function isValidPhone(phone)
{	
	re=/^((\+\d{1,3}(-| )?\(?\d\)?(-| )?\d{1,3})|(\(?\d{2,3}\)?))(-| )?(\d{3,4})(-| )?(\d{4})(( x| ext)\d{1,5}){0,1}$/
	validPhone=re.exec(phone)
	if (validPhone) return true;
	return false;
}

function validateTellAFriend(myForm)
{
	
	if (myForm.name.value=="")
	{
		alert("Please enter your name.")
		myForm.name.focus()
		myForm.name.select()
		return false
	}	
	
	if (!isValidEmail(myForm.youremail.value))
	{
		alert("The email address you entered is not valid. Please try again")
		myForm.youremail.focus()
		myForm.youremail.select()
		return false
	}
	


if (!isValidEmail(myForm.friendemail.value))
	{
		alert("The email address you entered is not valid. Please try again")
		myForm.friendemail.focus()
		myForm.friendemail.select()
		return false
	}

return true;
}

function validateDrawings(myForm)
{
	
	if (myForm.name.value=="")
	{
		alert("Please enter your name.")
		myForm.name.focus()
		myForm.name.select()
		return false
	}	
	
	if (!isValidPhone(myForm.phone.value))
	{
		alert("Please enter your 10 digit phone number. ")
		myForm.phone.focus()
		myForm.phone.select()
		return false
	}

	if (!isValidEmail(myForm.email.value))
	{
		alert("The email address you entered is not valid. Please try again")
		myForm.email.focus()
		myForm.email.select()
		return false
	}
	
return true;
}

function validateSampleRequest(myForm)
{
	
	if (myForm.name.value=="")
	{
		alert("Please enter your name.")
		myForm.name.focus()
		myForm.name.select()
		return false
	}	
	
	if (myForm.homephone.value=="" && myForm.workphone.value=="" && myForm.cellphone.value=="")
	{
		alert("Please enter home, work or cell phone number.")
		myForm.homephone.focus()
		myForm.homephone.select()
		return false
	}	

	if (!isValidPhone(myForm.homephone.value) && !isValidPhone(myForm.cellphone.value) && !isValidPhone(myForm.workphone.value))
	{
		alert("Please enter a VALID phone number. ")
		myForm.homephone.focus()
		myForm.homephone.select()
		return false
	}

	if (!isValidEmail(myForm.email.value))
	{
		alert("The email address you entered is not valid. Please try again")
		myForm.email.focus()
		myForm.email.select()
		return false
	}

	if (myForm.customertype.value=="")
	{
		alert("Are you a student or parent. Please check one.")
		myForm.customertype.focus()
		return false		
	}

	if (myForm.customertype.value=="Student" && myForm.parentname.value=="")
	{
		alert("Please enter parent's name.")
		myForm.parentname.focus()
		myForm.parentname.select()
		return false
	}	

return true;
}

function validatePriceQuote(myForm)
{
	
	if (myForm.name.value=="")
	{
		alert("Please enter your name.")
		myForm.name.focus()
		myForm.name.select()
		return false
	}	
	
	if (myForm.phone.value=="")
	{
		alert("Please enter your phone number.")
		myForm.phone.focus()
		myForm.phone.select()
		return false
	}	

	if (!isValidEmail(myForm.email.value))
	{
		alert("The email address you entered is not valid. Please try again")
		myForm.email.focus()
		myForm.email.select()
		return false
	}

	if (myForm.address.value=="")
	{
		alert("Please enter your address.")
		myForm.address.focus()
		myForm.address.select()
		return false
	}	

return true;
}

function validateSubscription(myForm)
{
	
	re=/^(\D{4,15}\d{2,4})$/
	validUserName=re.exec(myForm.username.value)
	if (!validUserName)
	{
		alert("User name must consist of 4 to 15 letters and 2 to 4 digits. Space is not allowed.")
		myForm.username.focus()
		myForm.username.select()
		return false
	}

	re=/^(\w{8,15})$/
	validPassword=re.exec(myForm.password.value)
	if (!validPassword)
	{
		alert("Password must be 8 to 15 character long; can contain only letters, numbers and underscore character. Space is not allowed.")
		myForm.password.focus()
		myForm.password.select()
		return false
	}
	
	if (myForm.password.value!=myForm.verify.value)
	{
		alert("Password and Verify fields must match")
		myForm.verify.focus()
		myForm.verify.select()
		return false
	}
	
	return true
}

function validateCheckOut(myForm)
{
	if (myForm.shipping_firstname.value=="")
	{
		alert("You must enter your first name in the shipping info section.")
		myForm.shipping_firstname.focus()
		myForm.shipping_firstname.select()
		return false
	}

	if (myForm.shipping_lastname.value=="")
	{
		alert("You must enter your last name in the shipping info section.")
		myForm.shipping_lastname.focus()
		myForm.shipping_lastname.select()
		return false
	}

	if (myForm.shipping_addressline1.value=="")
	{
		alert("Please complete your address information in the shipping section.")
		myForm.shipping_addressline1.focus()
		myForm.shipping_addressline1.select()
		return false
	}

	if (myForm.shipping_city.value=="")
	{
		alert("Please enter your city in the shipping info section.")
		myForm.shipping_city.focus()
		myForm.shipping_city.select()
		return false
	}

	if (myForm.shipping_state.value=="")
	{
		alert("Please enter your state/province in the shipping info section.")
		myForm.shipping_state.focus()
		myForm.shipping_state.select()
		return false
	}

	if (myForm.shipping_zip.value=="")
	{
		alert("Please enter your zip code in the shipping info section.")
		myForm.shipping_zip.focus()
		myForm.shipping_zip.select()
		return false
	}

	if (myForm.billingaddress[1].checked)
	{
		
		if (myForm.billing_firstname.value=="")
		{
			alert("You must enter your first name in the billing info section.")
			myForm.billing_firstname.focus()
			myForm.billing_firstname.select()
			return false
		}
	
		if (myForm.billing_lastname.value=="")
		{
			alert("You must enter your last name in the billing info section.")
			myForm.billing_lastname.focus()
			myForm.billing_lastname.select()
			return false
		}
	
		if (myForm.billing_addressline1.value=="")
		{
			alert("Please complete your address information in the billing section.")
			myForm.billing_addressline1.focus()
			myForm.billing_addressline1.select()
			return false
		}
	
		if (myForm.billing_city.value=="")
		{
			alert("Please enter your city in the billing info section.")
			myForm.billing_city.focus()
			myForm.billing_city.select()
			return false
		}
	
		if (myForm.billing_state.value=="")
		{
			alert("Please enter your state/province in the billing info section.")
			myForm.billing_state.focus()
			myForm.billing_state.select()
			return false
		}
		
		if (myForm.billing_zip.value=="")
		{
			alert("Please enter your zip code in the billing info section.")
			myForm.billing_zip.focus()
			myForm.billing_zip.select()
			return false
		}
	}

	if (myForm.cardnumber.value=="")
	{
		alert("Please enter your credit card number.")
		myForm.cardnumber.focus()
		myForm.cardnumber.select()
		return false
	}

	return true;
}