// JavaScript Document
//auto clear form on click
		function doClear(theText) {
			if (theText.value == theText.defaultValue) {
			theText.value = ""
			}
		}	
//contact us validation
		function echeck(str) {
			var at="@"
			var dot="."
			var lat=str.indexOf(at)
			var lstr=str.length
			var ldot=str.indexOf(dot)
			if (str.indexOf(at)==-1){
				alert("Your email address appears to be invalid")
			return false
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
			alert("Your email address appears to be invalid")
			return false
		}
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
			alert("Your email address appears to be invalid")
			return false
		}
		if (str.indexOf(at,(lat+1))!=-1){
			alert("Your email address appears to be invalid")
			return false
		}
		if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
			alert("Your email address appears to be invalid")
			return false
		}
		if (str.indexOf(dot,(lat+2))==-1){
			alert("Your email address appears to be invalid")
			return false
		}
		if (str.indexOf(" ")!=-1){
			alert("Your email address appears to be invalid")
			return false
		}
		return true				
		}
		function ValidateForm(){
		if ((document.paragonContact.name.value==null)||(document.paragonContact.name.value=="Please enter your name")){
			alert("Please enter your name")
			document.paragonContact.name.focus()
			return false
		}		
		if ((document.paragonContact.name.value==null)||(document.paragonContact.name.value=="")){
			alert("Please enter your name")
			document.paragonContact.name.focus()
			return false
		}		
		if ((document.paragonContact.email.value==null)||(document.paragonContact.email.value=="")){
			alert("Please enter your email address")
			document.paragonContact.email.focus()
			return false
		}
		if ((document.paragonContact.comments.value==null)||(document.paragonContact.comments.value=="")){
			alert("Please enter your comments")
			document.paragonContact.comments.focus()
			return false
		}
		if ((document.paragonContact.comments.value==null)||(document.paragonContact.comments.value=="Please enter your comments:")){
			alert("Please enter your comments")
			document.paragonContact.comments.focus()
			return false
		}		
		if (echeck(document.paragonContact.email.value)==false){
			document.paragonContact.email.value=""
			document.paragonContact.email.focus()
			return false
		}
			alert("Thank you, your enquiry has been sent")
			return true
		}
		
//validate instant quote
		function ValidateFormIQ(){
		if ((document.instantQuote.fullName.value==null)||(document.instantQuote.fullName.value=="Please enter your full name")){
			alert("Please enter your name")
			document.instantQuote.fullName.focus()
			return false
		}		
		if ((document.instantQuote.fullName.value==null)||(document.instantQuote.fullName.value=="")){
			alert("Please enter your name")
			document.instantQuote.fullName.focus()
			return false
		}		
		if ((document.instantQuote.emailAdd.value==null)||(document.instantQuote.emailAdd.value=="")){
			alert("Please enter your email address")
			document.instantQuote.emailAdd.focus()
			return false
		}
		if (echeck(document.instantQuote.emailAdd.value)==false){
			document.instantQuote.emailAdd.value=""
			document.instantQuote.emailAdd.focus()
			return false
		}		
		if ((document.instantQuote.phone.value==null)||(document.instantQuote.phone.value=="")){
			alert("Please enter your phone number")
			document.instantQuote.phone.focus()
			return false
		}
		if ((document.instantQuote.phone.value==null)||(document.instantQuote.phone.value=="Please enter your phone number")){
			alert("Please enter your phone number")
			document.instantQuote.phone.focus()
			return false
		}		
		if ((document.instantQuote.product.value==null)||(document.instantQuote.product.value=="")){
			alert("Please enter your product of interest")
			document.instantQuote.product.focus()
			return false
		}				
			alert("Thank you, your request has been received, we will contact you within 24 hours.")
			return true
		}
//quick contact validation		
		function ValidateFormQC(){
		if ((document.paragonContact.email.value==null)||(document.paragonContact.email.value=="")){
			alert("Please enter your email address")
			document.paragonContact.email.focus()
			return false
		}
		if ((document.paragonContact.comments.value==null)||(document.paragonContact.comments.value=="")){
			alert("Please enter your comments")
			document.paragonContact.comments.focus()
			return false
		}
		if ((document.paragonContact.comments.value==null)||(document.paragonContact.comments.value=="Please enter your comments:")){
			alert("Please enter your comments")
			document.paragonContact.comments.focus()
			return false
		}		
		if (echeck(document.paragonContact.email.value)==false){
			document.paragonContact.email.value=""
			document.paragonContact.email.focus()
			return false
		}
			alert("Thank you, your enquiry has been sent")
			return true
		}		
//refer friend validation
		function ValidateFormRF(){
		if ((document.referFriend.FriendsEmail.value==null)||(document.referFriend.FriendsEmail.value=="")){
			alert("Please enter your email address")
			return false
		}
		if ((document.referFriend.yourName.value==null)||(document.referFriend.yourName.value=="")){
			alert("Please enter your name")
			return false
		}
		if ((document.referFriend.yourName.value==null)||(document.referFriend.yourName.value=="Please enter your name:")){
			alert("Please enter your name")
			return false
		}		
		if (echeck(document.referFriend.FriendsEmail.value)==false){
			document.referFriend.FriendsEmail.value=""
			return false
		}
			alert("Your referral was sent successfully")
			return true
		}
//newsletter signup validation
		function ValidateFormNL(){
		if ((document.newsletterSignupForm.email_address.value==null)||(document.newsletterSignupForm.email_address.value=="")){
			alert("Please enter your email address")
			return false
		}
		if (echeck(document.newsletterSignupForm.email_address.value)==false){
			document.newsletterSignupForm.email_address.value=""
			document.newsletterSignupForm.email_address.focus()
			return false
		}		
			alert("You have successfully subscribed to our newsletter")
			return true
		}
//brochure request validation
		function ValidateFormBR(){
		if ((document.requestBrochureForm.brochure_product_number.value==null)||(document.requestBrochureForm.brochure_product_number.value=="Product number (eg CLC4040)...")){
			alert("Please enter a product number")
			document.requestBrochureForm.brochure_product_number.focus()			
			return false
		}			
		if ((document.requestBrochureForm.brochure_product_number.value==null)||(document.requestBrochureForm.brochure_product_number.value=="")){
			alert("Please enter a product number")
			return false
		}
		if (echeck(document.requestBrochureForm.requestBrochureFormEmail.value)==false){
			document.requestBrochureForm.requestBrochureFormEmail.value=""
			document.requestBrochureForm.requestBrochureFormEmail.focus()
			return false
		}			
			alert("Your brochure request was successful")
			return true
		}
//Order Toner Validation
		function ValidateFormToner(){
		if ((document.paragonContact.name.value==null)||(document.paragonContact.name.value=="Please enter your name")){
			alert("Please enter your name")
			document.paragonContact.name.focus()
			return false
		}		
		if ((document.paragonContact.name.value==null)||(document.paragonContact.name.value=="")){
			alert("Please enter your name")
			document.paragonContact.name.focus()
			return false
		}		
		if ((document.paragonContact.companyName.value==null)||(document.paragonContact.companyName.value=="Please enter your company name")){
			alert("Please enter your company name")
			document.paragonContact.companyName.focus()
			return false
		}		
		if ((document.paragonContact.companyName.value==null)||(document.paragonContact.companyName.value=="")){
			alert("Please enter your company name")
			document.paragonContact.companyName.focus()
			return false
		}			
		if ((document.paragonContact.email.value==null)||(document.paragonContact.email.value=="")){
			alert("Please enter your email address")
			document.paragonContact.email.focus()
			return false
		}
		if ((document.paragonContact.model.value==null)||(document.paragonContact.model.value=="Please enter your Model no.")){
			alert("Please enter your model number")
			document.paragonContact.model.focus()
			return false
		}		
		if ((document.paragonContact.model.value==null)||(document.paragonContact.model.value=="")){
			alert("Please enter your model number")
			document.paragonContact.model.focus()
			return false
		}				
		if ((document.paragonContact.serial.value==null)||(document.paragonContact.serial.value=="Please enter your Serial no.")){
			alert("Please enter your serial number")
			document.paragonContact.serial.focus()
			return false
		}		
		if ((document.paragonContact.serial.value==null)||(document.paragonContact.serial.value=="")){
			alert("Please enter your serial number")
			document.paragonContact.serial.focus()
			return false
		}		
		if ((document.paragonContact.location.value==null)||(document.paragonContact.location.value=="Please enter your Location")){
			alert("Please enter your location")
			document.paragonContact.location.focus()
			return false
		}		
		if ((document.paragonContact.location.value==null)||(document.paragonContact.location.value=="")){
			alert("Please enter your location")
			document.paragonContact.location.focus()
			return false
		}				
		if ((document.paragonContact.symptom.value==null)||(document.paragonContact.symptom.value=="Please enter the fault symptoms:")){
			alert("Please enter the fault symptom")
			document.paragonContact.symptom.focus()
			return false
		}		
		if ((document.paragonContact.symptom.value==null)||(document.paragonContact.symptom.value=="")){
			alert("Please enter the fault symptom")
			document.paragonContact.symptom.focus()
			return false
		}			
		if ((document.paragonContact.requirements.value==null)||(document.paragonContact.requirements.value=="")){
			alert("Please enter your toner requirements")
			document.paragonContact.requirements.focus()
			return false
		}
		if ((document.paragonContact.requirements.value==null)||(document.paragonContact.requirements.value=="Please enter your Toner Requirements:")){
			alert("Please enter your toner requirements")
			document.paragonContact.requirements.focus()
			return false
		}		
		if (echeck(document.paragonContact.email.value)==false){
			document.paragonContact.email.value=""
			document.paragonContact.email.focus()
			return false
		}
			alert("Thank you, your order was placed successfully we will contact you soon")
			return true
		}
//Service call validation
		function ValidateFormSC(){
		if ((document.paragonSC.name.value==null)||(document.paragonSC.name.value=="Please enter your name")){
			alert("Please enter your name")
			document.paragonSC.name.focus()
			return false
		}		
		if ((document.paragonSC.name.value==null)||(document.paragonSC.name.value=="")){
			alert("Please enter your name")
			document.paragonSC.name.focus()
			return false
		}		
		if ((document.paragonSC.companyName.value==null)||(document.paragonSC.companyName.value=="Please enter your company name")){
			alert("Please enter your company name")
			document.paragonSC.companyName.focus()
			return false
		}		
		if ((document.paragonSC.companyName.value==null)||(document.paragonSC.companyName.value=="")){
			alert("Please enter your company name")
			document.paragonSC.companyName.focus()
			return false
		}			
		if ((document.paragonSC.email.value==null)||(document.paragonSC.email.value=="")){
			alert("Please enter your email address")
			document.paragonSC.email.focus()
			return false
		}
		if ((document.paragonSC.model.value==null)||(document.paragonSC.model.value=="Please enter your Model no.")){
			alert("Please enter your model number")
			document.paragonSC.model.focus()
			return false
		}		
		if ((document.paragonSC.model.value==null)||(document.paragonSC.model.value=="")){
			alert("Please enter your model number")
			document.paragonSC.model.focus()
			return false
		}				
		if ((document.paragonSC.serial.value==null)||(document.paragonSC.serial.value=="Please enter your Serial no.")){
			alert("Please enter your serial number")
			document.paragonSC.serial.focus()
			return false
		}		
		if ((document.paragonSC.serial.value==null)||(document.paragonSC.serial.value=="")){
			alert("Please enter your serial number")
			document.paragonSC.serial.focus()
			return false
		}		
		if ((document.paragonSC.location.value==null)||(document.paragonSC.location.value=="Please enter your Location")){
			alert("Please enter your location")
			document.paragonSC.location.focus()
			return false
		}		
		if ((document.paragonSC.location.value==null)||(document.paragonSC.location.value=="")){
			alert("Please enter your location")
			document.paragonSC.location.focus()
			return false
		}				
		if ((document.paragonSC.symptom.value==null)||(document.paragonSC.symptom.value=="Please enter the fault symptoms:")){
			alert("Please enter the fault symptom")
			document.paragonSC.symptom.focus()
			return false
		}		
		if ((document.paragonSC.symptom.value==null)||(document.paragonSC.symptom.value=="")){
			alert("Please enter the fault symptom")
			document.paragonSC.symptom.focus()
			return false
		}			
		if (echeck(document.paragonSC.email.value)==false){
			document.paragonSC.email.value=""
			document.paragonSC.email.focus()
			return false
		}
			alert("Thank you, your service call has been logged, we will contact you shortly")
			return true
		}		
//equote validation
		function ValidateFormEQ(){
		if ((document.paragonEQ.name.value==null)||(document.paragonEQ.name.value=="Please enter your name")){
			alert("Please enter your name")
			document.paragonEQ.name.focus()
			return false
		}		
			if ((document.paragonEQ.name.value==null)||(document.paragonEQ.name.value=="")){
				alert("Please enter your name")
				document.paragonEQ.name.focus()
				return false
			}		
		if ((document.paragonEQ.companyName.value==null)||(document.paragonEQ.companyName.value=="Please enter your company name")){
			alert("Please enter your company name")
			document.paragonEQ.companyName.focus()
			return false
		}		
			if ((document.paragonEQ.companyName.value==null)||(document.paragonEQ.companyName.value=="")){
				alert("Please enter your company name")
				document.paragonEQ.companyName.focus()
				return false
			}					
		if ((document.paragonEQ.email.value==null)||(document.paragonEQ.email.value=="")){
			alert("Please enter your email address")
			document.paragonEQ.email.focus()
			return false
		}				
			if (echeck(document.paragonEQ.email.value)==false){
				document.paragonEQ.email.value=""
				document.paragonEQ.email.focus()
				return false
			}			
		if ((document.paragonEQ.phone.value==null)||(document.paragonEQ.phone.value=="Please enter your phone no.")){
			alert("Please enter your contact phone number")
			document.paragonEQ.phone.focus()
			return false
		}							
			if ((document.paragonEQ.phone.value==null)||(document.paragonEQ.phone.value=="")){
				alert("Please enter your contact phone number")
				document.paragonEQ.phone.focus()
				return false
			}													
			alert("Thank you, your quote has been requested, we will contact you shortly")
			return true
		}		