if (document.images) {
		preloadImages = new Array();
		for(var i=0; i<36; i++){
			preloadImages[i] = new Image();
		}
		preloadImages[0].src = "images/whatwecandoforyou.gif";
		preloadImages[1].src = "images/featuredstyles.gif";
		preloadImages[2].src = "images/whatsnew.gif";
		preloadImages[3].src = "images/bestsellers.gif";
		preloadImages[4].src = "images/stylesearch.gif";
		preloadImages[5].src = "images/priceguide.gif";
		preloadImages[6].src = "images/requestavirtualsample.gif";
		preloadImages[7].src = "images/requestanactualsample.gif";
		preloadImages[8].src = "images/artworkspecifications.gif";
		preloadImages[9].src = "images/uploadartwork.gif";
		preloadImages[10].src = "images/contactus.gif";
		preloadImages[11].src = "images/visitourblog.gif";
		preloadImages[12].src = "images/findadistributor.gif";
		preloadImages[13].src = "images/menubar.gif";
		preloadImages[14].src = "images/footer.gif";
		preloadImages[15].src = "images/loudcreative.gif";
		preloadImages[16].src = "images/header.jpg";
		preloadImages[17].src = "images/topmenushadow.gif";
		preloadImages[18].src = "images/24hourchallenge.gif";
		preloadImages[19].src = "images/24hourchallengeover.gif";
		preloadImages[20].src = "images/quickshipitems.gif";
		preloadImages[21].src = "images/quickshipitemsover.gif";
		preloadImages[22].src = "images/styleguide.gif";
		preloadImages[23].src = "images/styleguideover.gif";
		preloadImages[24].src = "images/decorations.gif";
		preloadImages[25].src = "images/decorationsover.gif";
		preloadImages[26].src = "images/usefultools.gif";
		preloadImages[27].src = "images/usefultoolsover.gif";
		preloadImages[28].src = "images/casestudies.gif";
		preloadImages[29].src = "images/casestudiesover.gif";
		preloadImages[30].src = "images/topcontactus.gif";
		preloadImages[31].src = "images/topcontactusover.gif";	
		preloadImages[32].src = "images/shoppingcart.gif";	
		preloadImages[33].src = "images/shoppingcartover.gif";	
		preloadImages[34].src = "images/rebrandshoppingcart.gif";	
		preloadImages[35].src = "images/rebrandshoppingcartover.gif";
}


function handleOver(num) { 
 if (document.images){
	 document['menu'+num].src= "images/mouseover.gif?"+num;
 }
}

function handleOut(nums) {
 if (document.images){
	 document['menu'+nums].src="images/mouseout.gif?"+nums;
 }
}
function subHandleout(tag)
{
	if(document.images)
	{
		switch (tag)
		{
			case 1:
				document['subMenu'+tag].src='images/24hourchallenge.gif';
				break;
			case 2:
				document['subMenu'+tag].src='images/quickshipitems.gif';
				break;
			case 3:
				document['subMenu'+tag].src='images/styleguide.gif';
				document.getElementById('styleguide').style.visibility='hidden';
				break;
			case 4:
				document['subMenu'+tag].src='images/decorations.gif';
				document.getElementById('decorations').style.visibility='hidden';
				break;
			case 5:
				document['subMenu'+tag].src='images/usefultools.gif';
				document.getElementById('usefultools').style.visibility='hidden';
				break;
			case 6:
				document['subMenu'+tag].src='images/casestudies.gif';
				break;
			case 7:
				document['subMenu'+tag].src='images/topcontactus.gif';
				document.getElementById('contact').style.visibility='hidden';
				break;
			case 8:
				document['subMenu'+tag].src='images/shoppingcart.gif';
				break;
			case 9:
				document['subMenu'+tag].src='images/rebrandshoppingcart.gif';
				break;
			}
	}
}
function subHandleover(tag)
{
	if(document.images)
	{
		switch (tag)
		{
			case 1:
				document['subMenu'+tag].src='images/24hourchallengeover.gif';
				break;
			case 2:
				document['subMenu'+tag].src='images/quickshipitemsover.gif';
				break;
			case 3:
				document['subMenu'+tag].src='images/styleguideover.gif';
				document.getElementById('styleguide').style.visibility='visible';
				break;
			case 4:
				document['subMenu'+tag].src='images/decorationsover.gif';
				document.getElementById('decorations').style.visibility='visible';
				break;
			case 5:
				document['subMenu'+tag].src='images/usefultoolsover.gif';
				document.getElementById('usefultools').style.visibility='visible';
				break;
			case 6:
				document['subMenu'+tag].src='images/casestudiesover.gif';
				break;
			case 7:
				document['subMenu'+tag].src='images/topcontactusover.gif';
				document.getElementById('contact').style.visibility='visible';
				break;
			case 8:
				document['subMenu'+tag].src='images/shoppingcartover.gif';
				break;
			case 9:
				document['subMenu'+tag].src='images/rebrandshoppingcartover.gif';
				break;
		}
	}

}
function isValidEmail(str) {

if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(str)){
return (true);
}
 


}
function fileUpload(str){
document.theOne.fileName.value=str
}
function uploadComplete(){
document.theOne.uploadDone.value=1	
}

function contactFormToPGG()
{
	document.someForm.go.src="images/submitbuttonclick.gif";
	if(!document.someForm.name.value)
	{
		alert("Please provide a Name");
	}
	else if(!isValidEmail(document.someForm.email.value) && !document.someForm.phone.value && !document.someForm.cell.value)
	{
		alert("Please provide a form of Contact");
	}
	else
	{
		for(i=9;document.someForm.elements[i].name=="recipient";i++)
		{
			if(document.someForm.elements[i].checked)
			{
				document.theOne.emailTO.value=document.someForm.elements[i].value;
			}
		}
		document.theOne.name.value=document.someForm.name.value;
		document.theOne.email.value=document.someForm.email.value;
		document.theOne.security_code.value=document.someForm.security_code.value;
		document.theOne.content.value="";
		document.theOne.content.value+="Contact Name: "+document.someForm.name.value+"\n";
		document.theOne.content.value+="Company: "+document.someForm.company.value+"\n";
		document.theOne.content.value+="Email Address: "+document.someForm.email.value+"\n";
		document.theOne.content.value+="Office Number: "+document.someForm.phone.value+"\n";
		document.theOne.content.value+="Cell Number: "+document.someForm.cell.value+"\n";
		document.theOne.content.value+="Mailing Address: "+document.someForm.address.value+"\n";
		document.theOne.content.value+="City: "+document.someForm.city.value+"\n";
		document.theOne.content.value+="State: "+document.someForm.state.value+"\n";
		document.theOne.content.value+="Zip: "+document.someForm.zip.value+"\n";
		document.theOne.content.value+="ASI/PPAI/Sage No: "+document.someForm.asippaisageno.value+"\n";
		document.theOne.content.value+="Notes: "+document.someForm.notes.value;
		document.theOne.submit();
	}

}
function uploadartFormToPGG()
{
	document.someForm.go.src="images/submitbuttonclick.gif"
	if(document.someForm.noflash.value || document.theOne.uploadDone.value==1){
	if(!document.someForm.name.value)
	{
		alert("Please provide a Name")
	}
	else if(!isValidEmail(document.someForm.email.value))
	{
		alert("Please provide an Email")
	}
	else
	{
		document.theOne.name.value=document.someForm.name.value
		document.theOne.email.value=document.someForm.email.value
		document.theOne.security_code.value=document.someForm.security_code.value
		document.theOne.content.value=""
		document.theOne.content.value+="Contact Name: "+document.someForm.name.value+"\n"
		document.theOne.content.value+="Company: "+document.someForm.company.value+"\n"
		document.theOne.content.value+="Email Address: "+document.someForm.email.value+"\n"
		document.theOne.content.value+="PO Number: "+document.someForm.PO.value+"\n"
		document.theOne.content.value+="Notes: "+document.someForm.notes.value
		document.theOne.submit()
	}}
	else
	{
		alert("A file must be uploaded:\n Please select a file to upload or wait for the uploader to finish")
	}

}
function artuploadFormToPGG()
{
	document.someForm.go.src="images/submitbuttonclick.gif"
	if(!document.someForm.name.value)
	{
		alert("Please provide a Name")
	}
	else if(!isValidEmail(document.someForm.email.value))
	{
		alert("Please provide an Email")
	}
	else
	{
		document.theOne.name.value=document.someForm.name.value
		document.theOne.email.value=document.someForm.email.value
		document.theOne.content.value=""	
		document.theOne.content.value+="Contact Name: "+document.someForm.name.value+"\n"
		document.theOne.content.value+="Company: "+document.someForm.company.value+"\n"
		document.theOne.content.value+="Email Address: "+document.someForm.email.value+"\n"
		document.theOne.content.value+="PO Number: "+document.someForm.PO.value+"\n"
		document.theOne.content.value+="Notes: "+document.someForm.notes.value
		document.theOne.submit()
	}

}
function hourToPGG()
{
	document.someForm.go.src="http://www.theplatformgroupgallery.com/images/submitbuttonclick.gif"
	if(!document.someForm.name.value)
	{
		alert("Please provide a Name")
	}
	else if(!isValidEmail(document.someForm.email.value) && !document.someForm.phone.value && !document.someForm.cell.value)
	{
		alert("Please provide a form of Contact")
	}
	else
	{
		document.theOne.name.value=document.someForm.name.value
		document.theOne.email.value=document.someForm.email.value
		document.theOne.security_code.value=document.someForm.security_code.value
		document.theOne.content.value=""	
		document.theOne.content.value+="Contact Name: "+document.someForm.name.value+"\n"
		document.theOne.content.value+="Company: "+document.someForm.company.value+"\n"
		document.theOne.content.value+="Email Address: "+document.someForm.email.value+"\n"
		document.theOne.content.value+="Office Number: "+document.someForm.phone.value+"\n"
		document.theOne.content.value+="Cell Number: "+document.someForm.cell.value+"\n"
		document.theOne.content.value+="Quantity: "+document.someForm.quantity.value+"\n"
		document.theOne.content.value+="Printing # of Colors: "+document.someForm.colors.value+"\n"
		document.theOne.content.value+="Type of Collateral That Item Will Hold: "+document.someForm.citem.value
		document.theOne.content.value+=". \nEstimated Size of Item: "+document.someForm.size.value+"\n"		
		document.theOne.content.value+="Notes: "+document.someForm.notes.value
		document.theOne.submit()
	}

}
function virtualsampleFormToPGG()
{
	document.someForm.go.src="images/submitbuttonclick.gif"
	if(document.someForm.noflash.value==1 || document.theOne.uploadDone.value==1){
	if(!document.someForm.name.value)
	{
		alert("Please provide a Name")
	}
	else if(!isValidEmail(document.someForm.email.value))
	{
		alert("Please provide an Email")
	}
	else
	{
		document.theOne.name.value=document.someForm.name.value
		document.theOne.email.value=document.someForm.email.value
		document.theOne.security_code.value=document.someForm.security_code.value
		document.theOne.content.value=""
		document.theOne.content.value+="Contact Name: "+document.someForm.name.value+"\n"
		document.theOne.content.value+="Company: "+document.someForm.company.value+"\n"
		document.theOne.content.value+="Email Address: "+document.someForm.email.value+"\n"
		document.theOne.content.value+="Item Name: "+document.someForm.itemname.value+"\n"
		document.theOne.content.value+="Notes: "+document.someForm.notes.value
		document.theOne.submit()
	}}
	else
	{
		alert("A file must be uploaded:\n Please select a file to upload or wait for the uploader to finish")
	}

}
function joinMailingFormToPGG()
{
	if(!document.someForm.name.value)
	{
		alert("Please provide a Name")
	}
	else if(!isValidEmail(document.someForm.email.value) )
	{
		alert("Please provide an Email")
	}
	else
	{
		document.theOne.name.value=document.someForm.name.value
		document.theOne.email.value=document.someForm.email.value
		document.theOne.content.value=""	
		document.theOne.content.value+="Contact Name: "+document.someForm.name.value+"\n"
		document.theOne.content.value+="Company: "+document.someForm.company.value+"\n"
		document.theOne.content.value+="Email Address: "+document.someForm.email.value+"\n"
		document.theOne.content.value+="Phone Number: "+document.someForm.phone.value+"\n"
		document.theOne.content.value+="Mailing Address: "+document.someForm.address.value+"\n"
		document.theOne.content.value+="City: "+document.someForm.city.value+"\n"
		document.theOne.content.value+="State: "+document.someForm.state.value+"\n"
		document.theOne.content.value+="Zip: "+document.someForm.zip.value
		document.theOne.submit()
	}

}
function sampleToPGG()
{
	if(!document.someForm.name.value)
	{
		alert("Please provide a Name");
		return false;
	}
	else if(!isValidEmail(document.someForm.email.value) && !document.someForm.phone.value )
	{
		alert("Please provide a form of contact");
		return false;
	}
	else if(!document.someForm.address.value || !document.someForm.city.value || !document.someForm.zip.value)
	{
		alert("Please provide a complete address");
		return false;
	}
	/*else
	{
		document.theOne.name.value=document.someForm.name.value;
		document.theOne.email.value=document.someForm.email.value;
		document.theOne.security_code.value=document.someForm.security_code.value;
		document.theOne.content.value="";
		document.theOne.content.value+="Contact Name: "+document.someForm.name.value+"\n"
		document.theOne.content.value+="Company: "+document.someForm.company.value+"\n";
		document.theOne.content.value+="Email Address: "+document.someForm.email.value+"\n";
		document.theOne.content.value+="Phone Number: "+document.someForm.phone.value+"\n";
		document.theOne.content.value+="Shipping Address: "+document.someForm.address.value+"\n";
		document.theOne.content.value+="City: "+document.someForm.city.value+"\n";
		document.theOne.content.value+="State: "+document.someForm.state.value+"\n";
		document.theOne.content.value+="Zip: "+document.someForm.zip.value+"\n";
		document.theOne.content.value+="ASI/PPAI/Sage No: "+document.someForm.asippaisageno.value+"\n";
		document.theOne.content.value+="Notes: "+document.someForm.notes.value+"\n";
		document.theOne.content.value+="Item1: "+document.theOne.item1.value+"\n";
		document.theOne.content.value+="Item2: "+document.theOne.item2.value+"\n";
		document.theOne.content.value+="Item3: "+document.theOne.item3.value+"\n";
		document.theOne.submit();
	}*/
	return true;
}
function clearText()
{
	document.someForm.clear.src="images/clearbuttonclick.gif";
	for(i=0;i<document.someForm.elements.length;i++)
	{
		if(document.someForm.elements[i].name!="clear" && document.someForm.elements[i].name!="go")
		document.someForm.elements[i].value=""
	}
}
function setState(form) {
	var pos = form.options[form.selectedIndex].value;
	if (pos != "") {
		var url = "FindAPromotionalDistributor.php?ST=" + pos;
		window.location = url;
	} else {
		var url = "FindAPromotionalDistributor.php";
		window.location = url;
	}
}
function submitOver()
{
	document.someForm.go.src="images/submitbuttonover.gif"
}
function submitOut()
{
	document.someForm.go.src="images/submitbutton.gif"
}
function clearOver()
{
	document.someForm.clear.src="images/clearbuttonover.gif"
}
function clearOut()
{
	document.someForm.clear.src="images/clearbutton.gif"
}
function descSearch()
{
	window.location ="StyleSearch.php?descSearch="+encodeURIComponent(document.someForm.desc.value);

}
function dimSearch()
{
	window.location ="StyleSearch.php?dh="+encodeURIComponent(document.someForm.dh.value)+"&dw="+encodeURIComponent(document.someForm.dw.value)+"&dd="+encodeURIComponent(document.someForm.dd.value);

}
function gotoDetail(num)
{
	window.location ="StyleDetail.php?id="+num;

}

