//used for hiding form fields in the product form 

function toggleInputs(qrtype){
	//
	
		// Hide everything
		//
		// hide the WPQRStyle
		count=0;
		while(document.getElementById("WPQRStyle_"+count)){
			document.getElementById("WPQRStyle_"+count).style.display="none";
			count++;
		}
		// hide the WPQRName
		count=0;
		while(document.getElementById("WPQRName_"+count)){
			document.getElementById("WPQRName_"+count).style.display="none";
			count++;
		}
		// hide the WPQRJobTitle
		count=0;
		while(document.getElementById("WPQRJobTitle_"+count)){
			document.getElementById("WPQRJobTitle_"+count).style.display="none";
			count++;
		}
		// hide the WPQRBusiness
		count=0;
		while(document.getElementById("WPQRBusiness_"+count)){
			document.getElementById("WPQRBusiness_"+count).style.display="none";
			count++;
		}
		// hide the WPQRWebsite
		count=0;
		while(document.getElementById("WPQRWebsite_"+count)){
			document.getElementById("WPQRWebsite_"+count).style.display="none";
			count++;
		}
		// hide the WPQREmail
		count=0;
		while(document.getElementById("WPQREmail_"+count)){
			document.getElementById("WPQREmail_"+count).style.display="none";
			count++;
		}
		// hide the WPQRAddress
		count=0;
		while(document.getElementById("WPQRAddress_"+count)){
			document.getElementById("WPQRAddress_"+count).style.display="none";
			count++;
		}
		// hide the WPQRTelephone
		count=0;
		while(document.getElementById("WPQRTelephone_"+count)){
			document.getElementById("WPQRTelephone_"+count).style.display="none";
			count++;
		}
		// hide the WPQRInfo
		count=0;
		while(document.getElementById("WPQRInfo_"+count)){
			document.getElementById("WPQRInfo_"+count).style.display="none";
			count++;
		}
		// hide the WPQRImageSize
		count=0;
		while(document.getElementById("WPQRImageSize_"+count)){
			document.getElementById("WPQRImageSize_"+count).style.display="none";
			count++;
		}
		//
		//
	// Now unhide what we need
		// Contact Details Types need most of the fields
		if ((qrtype == "contactdetails_txt") || (qrtype == "contactdetails_me") || (qrtype == "contactdetails_vcard")){
			// UnHide the fields that we  need for an MECARD
			// Unhide the WPQRStyle
			count=0;
			while(document.getElementById("WPQRStyle_"+count)){
				document.getElementById("WPQRStyle_"+count).style.display="block";
				count++;
			}
			// Unhide the WPQRName
			count=0;
			while(document.getElementById("WPQRName_"+count)){
				document.getElementById("WPQRName_"+count).style.display="block";
				count++;
			}
			// Unhide the WPQRJobTitle
			count=0;
			while(document.getElementById("WPQRJobTitle_"+count)){
				document.getElementById("WPQRJobTitle_"+count).style.display="block";
				count++;
			}
			// Unhide the WPQRBusiness
			count=0;
			while(document.getElementById("WPQRBusiness_"+count)){
				document.getElementById("WPQRBusiness_"+count).style.display="block";
				count++;
			}
			// Unhide the WPQRWebsite
			count=0;
			while(document.getElementById("WPQRWebsite_"+count)){
				document.getElementById("WPQRWebsite_"+count).style.display="block";
				count++;
			}
			// Unhide the WPQREmail
			count=0;
			while(document.getElementById("WPQREmail_"+count)){
				document.getElementById("WPQREmail_"+count).style.display="block";
				count++;
			}
			// Unhide the WPQRAddress
			count=0;
			while(document.getElementById("WPQRAddress_"+count)){
				document.getElementById("WPQRAddress_"+count).style.display="block";
				count++;
			}
			// Unhide the WPQRTelephone
			count=0;
			while(document.getElementById("WPQRTelephone_"+count)){
				document.getElementById("WPQRTelephone_"+count).style.display="block";
				count++;
			}
			// Unhide the WPQRInfo
			count=0;
			while(document.getElementById("WPQRInfo_"+count)){
				document.getElementById("WPQRInfo_"+count).style.display="block";
				count++;
			}
			// Unhide the WPQRImageSize
			count=0;
			while(document.getElementById("WPQRImageSize_"+count)){
				document.getElementById("WPQRImageSize_"+count).style.display="block";
				count++;
			}
		}
		// Now unhide what we need
		if (qrtype == "emailaddress")
		{
			// display the fields that we need for email address
			// Unhide the WPQRStyle
			count=0;
			while(document.getElementById("WPQRStyle_"+count)){
				document.getElementById("WPQRStyle_"+count).style.display="block";
				count++;
			}
			// Unhide the WPQREmail
			count=0;
			while(document.getElementById("WPQREmail_"+count)){
				document.getElementById("WPQREmail_"+count).style.display="block";
				count++;
			}
			// Unhide the WPQRImageSize
			count=0;
			while(document.getElementById("WPQRImageSize_"+count)){
				document.getElementById("WPQRImageSize_"+count).style.display="block";
				count++;
			}
		}
		// Now unhide what we need
		if (qrtype == "phone")
		{
			// display the fields that we need for phone
			// Unhide the WPQRStyle
			count=0;
			while(document.getElementById("WPQRStyle_"+count)){
				document.getElementById("WPQRStyle_"+count).style.display="block";
				count++;
			}
			// Unhide the WPQRTelephone
			count=0;
			while(document.getElementById("WPQRTelephone_"+count)){
				document.getElementById("WPQRTelephone_"+count).style.display="block";
				count++;
			}
			// Unhide the WPQRImageSize
			count=0;
			while(document.getElementById("WPQRImageSize_"+count)){
				document.getElementById("WPQRImageSize_"+count).style.display="block";
				count++;
			}
		}
		// Now unhide what we need
		if (qrtype == "sms")
		{
			// display the fields that we need for sms
			// Unhide the WPQRStyle
			count=0;
			while(document.getElementById("WPQRStyle_"+count)){
				document.getElementById("WPQRStyle_"+count).style.display="block";
				count++;
			}
			// Unhide the WPQRTelephone
			count=0;
			while(document.getElementById("WPQRTelephone_"+count)){
				document.getElementById("WPQRTelephone_"+count).style.display="block";
				count++;
			}
			// Unhide the WPQRInfo
			count=0;
			while(document.getElementById("WPQRInfo_"+count)){
				document.getElementById("WPQRInfo_"+count).style.display="block";
				count++;
			}
			// Unhide the WPQRImageSize
			count=0;
			while(document.getElementById("WPQRImageSize_"+count)){
				document.getElementById("WPQRImageSize_"+count).style.display="block";
				count++;
			}
		}
		// Now unhide what we need
		if (qrtype == "text")
		{
			// display the fields that we need for text
			// Unhide the WPQRStyle
			count=0;
			while(document.getElementById("WPQRStyle_"+count)){
				document.getElementById("WPQRStyle_"+count).style.display="block";
				count++;
			}
			// Unhide the WPQRInfo
			count=0;
			while(document.getElementById("WPQRInfo_"+count)){
				document.getElementById("WPQRInfo_"+count).style.display="block";
				count++;
			}
			// Unhide the WPQRImageSize
			count=0;
			while(document.getElementById("WPQRImageSize_"+count)){
				document.getElementById("WPQRImageSize_"+count).style.display="block";
				count++;
			}
		}
		// Now unhide what we need
		if (qrtype == "website")
		{
			// display the fields that we need for website
			// Unhide the WPQRStyle
			count=0;
			while(document.getElementById("WPQRStyle_"+count)){
				document.getElementById("WPQRStyle_"+count).style.display="block";
				count++;
			}
			// Unhide the WPQRWebsite
			count=0;
			while(document.getElementById("WPQRWebsite_"+count)){
				document.getElementById("WPQRWebsite_"+count).style.display="block";
				count++;
			}
			// Unhide the WPQRImageSize
			count=0;
			while(document.getElementById("WPQRImageSize_"+count)){
				document.getElementById("WPQRImageSize_"+count).style.display="block";
				count++;
			}
		}

		
		


}

// copy the email address into the contact email address
// only do this if the contact email address is empty
function copyEmail(){
	//
	if ((document.getElementById("WPQRContactEmail").value.length==0) ||(document.getElementById("WPQRContactEmail").value==null)) 
	{
		document.getElementById("WPQRContactEmail").value = document.getElementById("WPQREmail").value;
	}
}

