// JavaScript Document
function validateForm(){
	// SET UP ERROR MESSAGE
	var errorMsg = "The following error(s) exist, please rectify and try again.<br/><br/>";
	// INITIALISE ERROR COUNTER
	var hasErrors = 0;
	// CREATE REG EX EXPRESSIONS
	var re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
	var tre = /\d+/;
	var validCode = /^\d{5,}$/;
	var alphaNumeric = /[^\sa-zA-Z0-9!@$%&\\()'",.?_-]/;	
	var letters = /[a-zA-Z]{3,}/;
	
	// FUNCTION TO VALIDATE COMPANY ENTERED - NOT MANDATORY
	if(document.quoteForm.company.value != "") {
			// Check for number and type of characters entered
			if (!letters.test(document.quoteForm.company.value)){
					hasErrors ++;
					errorMsg += "&bull; Company - Invalid characters entered, letters and numbers only.<br/>";		
					document.quoteForm.company.value = "";
					document.quoteForm.company.focus();
					document.quoteForm.company.select();
			}
	}
	
	// FUNCTION TO VALIDATE USER NAME ENTERED - MANDATORY
	if(document.quoteForm.name.value == "") {
			hasErrors ++;
			errorMsg += "&bull; Name - Please enter a Contact Name.<br/>";
			document.quoteForm.name.focus();
			document.quoteForm.name.select();
	} else {
			// Check for number and type of characters entered
			if (!letters.test(document.quoteForm.name.value)){
					hasErrors ++;
					errorMsg += "&bull; Name - Invalid characters entered, letters and numbers only.<br/>";		
					document.quoteForm.name.value = "";
					document.quoteForm.name.focus();
					document.quoteForm.name.select();
			}
	}
	
	// FUNCTION TO VALIDATE TELEPHONE NUMBER ENTERED - MANDATORY
	if(document.quoteForm.phone.value == "") {
			hasErrors ++;
			errorMsg += "&bull; Phone - Please enter a contact Phone Number.<br/>";
			document.quoteForm.phone.select();
	} else {
			// Check for number and type of characters entered
			if (!tre.test(document.quoteForm.phone.value)){
					hasErrors ++;
					errorMsg += "&bull; Phone - Invalid characters entered, numbers only.<br/>";
					document.quoteForm.phone.select();
			}
	}
	
	// FUNCTION TO VALIDATE E-MAIL ENTERED - MANDATORY
	if (document.quoteForm.email.value == "") {
			hasErrors ++;
			errorMsg += "&bull; Email - Please enter an Email Address.<br/>";
			document.quoteForm.email.focus();
			document.quoteForm.email.select();
	} else {
			if (!re.test(document.quoteForm.email.value)){
					hasErrors ++;
					errorMsg += "&bull; Email - Please enter a VALID email address.<br/>";
					document.quoteForm.email.value="";
					document.quoteForm.email.focus();
					document.quoteForm.email.select();
			}
	}
	
	// FUNCTION TO VALIDATE DESCRIPTION ENTERED - NOT MANDATORY
	if(document.quoteForm.description.value != "") {
			if (alphaNumeric.test(document.quoteForm.description.value)){
					hasErrors ++;
					errorMsg += "&bull; Description - Invalid characters entered, letters and numbers only.<br/>";
					document.quoteForm.description.value="";
					document.quoteForm.description.focus();
					document.quoteForm.description.select();
			}	
	}
	
	// FUNCTION TO VALIDATE REFERENCE ENTERED - NOT MANDATORY
	if(document.quoteForm.reference.value != "") {
			if (alphaNumeric.test(document.quoteForm.reference.value)){
					hasErrors ++;
					errorMsg += "&bull; Reference - Invalid characters entered, letters and numbers only.<br/>";
					document.quoteForm.reference.value="";
					document.quoteForm.reference.focus();
					document.quoteForm.reference.select();
			}	
	}
	
	// FUNCTION TO VALIDATE SIZE ENTERED - NOT MANDATORY
	if(document.quoteForm.bag_size.value != "") {
			if (alphaNumeric.test(document.quoteForm.bag_size.value)){
					hasErrors ++;
					errorMsg += "&bull; Size - Invalid characters entered, letters and numbers only.<br/>";
					document.quoteForm.bag_size.value="";
					document.quoteForm.bag_size.focus();
					document.quoteForm.bag_size.select();
			}	
	}
	
	// FUNCTION TO VALIDATE PRODUCT ENTERED - NOT MANDATORY
	if(document.quoteForm.product.value != "") {
			if (alphaNumeric.test(document.quoteForm.product.value)){
					hasErrors ++;
					errorMsg += "&bull; Product - Invalid characters entered, letters and numbers only.<br/>";
					document.quoteForm.product.value="";
					document.quoteForm.product.focus();
					document.quoteForm.product.select();
			}	
	}
	
	// FUNCTION TO VALIDATE QUANTITY ENTERED - NOT MANDATORY
	if(document.quoteForm.qty.value == "") {
			hasErrors ++;
			errorMsg += "&bull; Quantity - Please enter a Quantity.<br/>";
			document.quoteForm.qty.focus();
			document.quoteForm.qty.select();
	} else {
			// Check for number and type of characters entered
			if (alphaNumeric.test(document.quoteForm.qty.value)){
					hasErrors ++;
					errorMsg += "&bull; Quantity - Invalid characters entered, letters and numbers only.<br/>";		
					document.quoteForm.qty.value = "";
					document.quoteForm.qty.focus();
					document.quoteForm.qty.select();
			}
	}
	
	// FUNCTION TO VALIDATE BASE COLOUR ENTERED - NOT MANDATORY
	if(document.quoteForm.basecolor.value != "") {
			if (alphaNumeric.test(document.quoteForm.basecolor.value)){
					hasErrors ++;
					errorMsg += "&bull; Base Colour - Invalid characters entered, letters and numbers only.<br/>";
					document.quoteForm.basecolor.value="";
					document.quoteForm.basecolor.focus();
					document.quoteForm.basecolor.select();
			}	
	}
	
	// FUNCTION TO VALIDATE ARTWORK ENTERED - NOT MANDATORY
	if(document.quoteForm.fileatt.value != "") {
			/*if (alphaNumeric.test(document.quoteForm.fileatt.value)){
					hasErrors ++;
					errorMsg += "&bull; Your Artwork - Invalid characters entered, letters and numbers only.<br/>";
					document.quoteForm.fileatt.value="";
					document.quoteForm.fileatt.focus();
					document.quoteForm.fileatt.select();
			}else{*/
				// CHECK FILE EXTENSION
				var fileName = document.quoteForm.fileatt.value;
				var getExt = fileName.split('.'); 				
				var fileExt = (getExt[getExt.length-1]);
				//
				function oc(a){
					var o = {};
					for(var i=0;i<a.length;i++) {
						o[a[i]]='';
					}
					return o;
				}
				//
				if(fileExt in oc(['gif', 'GIF', 'jpg', 'JPG', 'jpeg', 'JPEG', 'png', 'PNG', 'doc', 'DOC', 'eps', 'EPS', 'gz', 'GZ', 'gzip', 'GZIP', 'pdf', 'PDF', 'ai', 'AI', 'tif', 'TIF' , 'tiff', 'TIFF', 'zip', 'ZIP']) ) {
					// FILE FORMAT OK SO DO NOTHING
				}else{
					hasErrors ++;
					errorMsg += "&bull; Your Artwork - Invalid file format (Supported formats include gif, jpg, jpeg, png, doc, pdf, doc, eps, pdf, ai, tif, tiff, zip).<br/>";
					document.quoteForm.fileatt.value="";
					document.quoteForm.fileatt.focus();
					document.quoteForm.fileatt.select();
				}
			/*}*/
	}
	
	// FUNCTION TO VALIDATE NUMBER OF COLOURS TO PRINT ENTERED - NOT MANDATORY
	if(document.quoteForm.colour_no.value != "") {
			if (alphaNumeric.test(document.quoteForm.colour_no.value)){
					hasErrors ++;
					errorMsg += "&bull; Number of Colours to Print - Invalid characters entered, letters and numbers only.<br/>";
					document.quoteForm.colour_no.value="";
					document.quoteForm.colour_no.focus();
					document.quoteForm.colour_no.select();
			}	
	}
	
	// FUNCTION TO VALIDATE ETA ENTERED - NOT MANDATORY
	if(document.quoteForm.del_time.value != "") {
			if (alphaNumeric.test(document.quoteForm.del_time.value)){
					hasErrors ++;
					errorMsg += "&bull; Estimated Delivery Time - Invalid characters entered, letters and numbers only.<br/>";
					document.quoteForm.del_time.value="";
					document.quoteForm.del_time.focus();
					document.quoteForm.del_time.select();
			}	
	}
	
	// FUNCTION TO VALIDATE COMMENTS ENTERED - NOT MANDATORY
	if(document.quoteForm.comments.value != "") {
			if (alphaNumeric.test(document.quoteForm.comments.value)){
					hasErrors ++;
					errorMsg += "&bull; Comments - Invalid characters entered, letters and numbers only.<br/>";
					document.quoteForm.comments.value="";
					document.quoteForm.comments.focus();
					document.quoteForm.comments.select();
			}	
	}
	
	// FUNCTION TO VALIDATE CODE ENTERED - MANDATORY
	if(document.quoteForm.code.value == "") {
		hasErrors ++;
		errorMsg += "&bull; Security Code - Please enter the Security Code.<br/>";
		document.quoteForm.code.value="";
		document.quoteForm.code.focus();
		document.quoteForm.code.select();
	}else if(document.quoteForm.code.value.length < 5) {
		hasErrors ++;
		errorMsg += "&bull; Security Code - Please enter exactly 5 characters.<br/>";
		document.quoteForm.code.value="";
		document.quoteForm.code.focus();
		document.quoteForm.code.select();
	}
	
	// ALL ENTRIES VALIDATED SO SUBMIT FORM
	if(hasErrors < 1) {
		//alert("Submit Form");
		document.quoteForm.submit();
	} else {
		errorMsg += '<br/>';
		document.getElementById('errorMsg').innerHTML = errorMsg;
		document.getElementById('errorMsg').style.display = 'block';
		//alert(errorMsg);	
		return false;
	}

}

/*************************************************************************************************************************************************************************************/

function validateDYOBForm(){
	// SET UP ERROR MESSAGE
	var errorMsg = "The following error(s) exist, please rectify and try again.<br/><br/>";
	// INITIALISE ERROR COUNTER
	var hasErrors = 0;
	// CREATE REG EX EXPRESSIONS
	var re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
	var tre = /^\d{7,}$/;
	var validCode = /^\d{5,}$/;
	var alphaNumeric = /[^\sa-zA-Z0-9!@$%&\\()'",.?_-]/;
	var letters = /[a-zA-Z]{3,}/;
	
	// FUNCTION TO VALIDATE COMPANY ENTERED - NOT MANDATORY
	if(document.dyobForm.company.value != "") {
			// Check for number and type of characters entered
			if (!letters.test(document.dyobForm.company.value)){
					hasErrors ++;
					errorMsg += "&bull; Company - Invalid characters entered, letters and numbers only.<br/>";		
					document.dyobForm.company.value = "";
					document.dyobForm.company.focus();
					document.dyobForm.company.select();
			}
	}
	
	// FUNCTION TO VALIDATE USER NAME ENTERED - MANDATORY
	if(document.dyobForm.name.value == "") {
			hasErrors ++;
			errorMsg += "&bull; Name - Please enter a Contact Name.<br/>";
			document.dyobForm.name.focus();
			document.dyobForm.name.select();
	} else {
			// Check for number and type of characters entered
			if (!letters.test(document.dyobForm.name.value)){
					hasErrors ++;
					errorMsg += "&bull; Name - Invalid characters entered, letters and numbers only.<br/>";		
					document.dyobForm.name.value = "";
					document.dyobForm.name.focus();
					document.dyobForm.name.select();
			}
	}
	
	// FUNCTION TO VALIDATE TELEPHONE NUMBER ENTERED - NOT MANDATORY
	if(document.dyobForm.phone.value == "") {
			hasErrors ++;
			errorMsg += "&bull; Phone - Please enter a contact Phone Number.<br/>";
			document.dyobForm.phone.focus();
			document.dyobForm.phone.select();
	} else {
			// Check for number and type of characters entered
			if (alphaNumeric.test(document.dyobForm.phone.value)){
					hasErrors ++;
					errorMsg += "&bull; Phone - Invalid characters entered, letters and numbers only.<br/>";		
					document.dyobForm.phone.value = "";
					document.dyobForm.phone.focus();
					document.dyobForm.phone.select();
			}
	}
	
	// FUNCTION TO VALIDATE E-MAIL ENTERED - MANDATORY
	if (document.dyobForm.email.value == "") {
			hasErrors ++;
			errorMsg += "&bull; Email - Please enter an Email Address.<br/>";
			document.dyobForm.email.focus();
			document.dyobForm.email.select();
	} else {
			if (!re.test(document.dyobForm.email.value)){
					hasErrors ++;
					errorMsg += "&bull; Email - Please enter a VALID email address.<br/>";
					document.dyobForm.email.value="";
					document.dyobForm.email.focus();
					document.dyobForm.email.select();
			}
	}
	
	// FUNCTION TO VALIDATE MATERIAL ENTERED - NOT MANDATORY
	if(document.dyobForm.material.value != "") {
			if (alphaNumeric.test(document.dyobForm.material.value)){
					hasErrors ++;
					errorMsg += "&bull; Material - Invalid characters entered, letters and numbers only.<br/>";
					document.dyobForm.material.value="";
					document.dyobForm.material.focus();
					document.dyobForm.material.select();
			}	
	}
	
	// FUNCTION TO VALIDATE DESCRIPTION ENTERED - NOT MANDATORY
	if(document.dyobForm.description.value != "") {
			if (alphaNumeric.test(document.dyobForm.description.value)){
					hasErrors ++;
					errorMsg += "&bull; Description - Invalid characters entered, letters and numbers only.<br/>";
					document.dyobForm.description.value="";
					document.dyobForm.description.focus();
					document.dyobForm.description.select();
			}	
	}
	
	// FUNCTION TO VALIDATE REFERENCE ENTERED - NOT MANDATORY
	if(document.dyobForm.reference.value != "") {
			if (alphaNumeric.test(document.dyobForm.reference.value)){
					hasErrors ++;
					errorMsg += "&bull; Reference - Invalid characters entered, letters and numbers only.<br/>";
					document.dyobForm.reference.value="";
					document.dyobForm.reference.focus();
					document.dyobForm.reference.select();
			}	
	}
	
	// FUNCTION TO VALIDATE SIZE ENTERED - NOT MANDATORY
	if(document.dyobForm.bag_size.value != "") {
			if (alphaNumeric.test(document.dyobForm.bag_size.value)){
					hasErrors ++;
					errorMsg += "&bull; Size - Invalid characters entered, letters and numbers only.<br/>";
					document.dyobForm.bag_size.value="";
					document.dyobForm.bag_size.focus();
					document.dyobForm.bag_size.select();
			}	
	}
	
	// FUNCTION TO VALIDATE QUANTITY ENTERED - NOT MANDATORY
	if(document.dyobForm.qty.value == "") {
			hasErrors ++;
			errorMsg += "&bull; Quantity - Please enter a Quantity.<br/>";
			document.dyobForm.qty.focus();
			document.dyobForm.qty.select();
	} else {
			// Check for number and type of characters entered
			if (alphaNumeric.test(document.dyobForm.qty.value)){
					hasErrors ++;
					errorMsg += "&bull; Quantity - Invalid characters entered, letters and numbers only.<br/>";		
					document.dyobForm.qty.value = "";
					document.dyobForm.qty.focus();
					document.dyobForm.qty.select();
			}
	}
	
	// FUNCTION TO VALIDATE BASE COLOUR ENTERED - NOT MANDATORY
	if(document.dyobForm.basecolor.value != "") {
			if (alphaNumeric.test(document.dyobForm.basecolor.value)){
					hasErrors ++;
					errorMsg += "&bull; Base Colour - Invalid characters entered, letters and numbers only.<br/>";
					document.dyobForm.basecolor.value="";
					document.dyobForm.basecolor.focus();
					document.dyobForm.basecolor.select();
			}	
	}
	
	// FUNCTION TO VALIDATE ARTWORK ENTERED - NOT MANDATORY
	if(document.dyobForm.fileatt.value != "") {
			/*if (alphaNumeric.test(document.dyobForm.fileatt.value)){
					hasErrors ++;
					errorMsg += "&bull; Your Artwork - Invalid characters entered, letters and numbers only.<br/>";
					document.dyobForm.fileatt.value="";
					document.dyobForm.fileatt.focus();
					document.dyobForm.fileatt.select();
			}else{*/
				// CHECK FILE EXTENSION
				var fileName = document.dyobForm.fileatt.value;
				var getExt = fileName.split('.'); 				
				var fileExt = (getExt[getExt.length-1]);
				//
				function oc(a){
					var o = {};
					for(var i=0;i<a.length;i++) {
						o[a[i]]='';
					}
					return o;
				}
				//
				if(fileExt in oc(['gif', 'GIF', 'jpg', 'JPG', 'jpeg', 'JPEG', 'png', 'PNG', 'doc', 'DOC', 'eps', 'EPS', 'gz', 'GZ', 'gzip', 'GZIP', 'pdf', 'PDF', 'ai', 'AI', 'tif', 'TIF' , 'tiff', 'TIFF', 'zip', 'ZIP']) ) {
					// FILE FORMAT OK SO DO NOTHING
				}else{
					hasErrors ++;
					errorMsg += "&bull; Your Artwork - Invalid file format (Supported formats include gif, jpg, jpeg, png, doc, pdf, doc, eps, pdf, ai, tif, tiff, zip).<br/>";
					document.dyobForm.fileatt.value="";
					document.dyobForm.fileatt.focus();
					document.dyobForm.fileatt.select();
				}
			/*}*/
	}
	
	// FUNCTION TO VALIDATE NUMBER OF COLOURS TO PRINT ENTERED - NOT MANDATORY
	if(document.dyobForm.colour_no.value != "") {
			if (alphaNumeric.test(document.dyobForm.colour_no.value)){
					hasErrors ++;
					errorMsg += "&bull; Number of Colours to Print - Invalid characters entered, letters and numbers only.<br/>";
					document.dyobForm.colour_no.value="";
					document.dyobForm.colour_no.focus();
					document.dyobForm.colour_no.select();
			}	
	}
	
	// FUNCTION TO VALIDATE ETA ENTERED - NOT MANDATORY
	if(document.dyobForm.del_time.value != "") {
			if (alphaNumeric.test(document.dyobForm.del_time.value)){
					hasErrors ++;
					errorMsg += "&bull; Estimated Delivery Time - Invalid characters entered, letters and numbers only.<br/>";
					document.dyobForm.del_time.value="";
					document.dyobForm.del_time.focus();
					document.dyobForm.del_time.select();
			}	
	}

	// FUNCTION TO VALIDATE COMMENTS ENTERED - NOT MANDATORY
	if(document.dyobForm.comments.value != "") {
			if (alphaNumeric.test(document.dyobForm.comments.value)){
					hasErrors ++;
					errorMsg += "&bull; Comments - Invalid characters entered, letters and numbers only.<br/>";
					document.dyobForm.comments.value="";
					document.dyobForm.comments.focus();
					document.dyobForm.comments.select();
			}	
	}
	
	// FUNCTION TO VALIDATE CODE - MANDATORY
	if(document.dyobForm.code.value == "") {
		hasErrors ++;
		errorMsg += "&bull; Security Code - Please enter the Security Code.<br/>";
		document.dyobForm.code.value="";
		document.dyobForm.code.focus();
		document.dyobForm.code.select();
	}else if(document.dyobForm.code.value.length < 5) {
		hasErrors ++;
		errorMsg += "&bull; Security Code - Please enter exactly 5 characters.<br/>";
		document.dyobForm.code.value="";
		document.dyobForm.code.focus();
		document.dyobForm.code.select();
	}

	// ALL ENTRIES VALIDATED SO SUBMIT FORM
	if(hasErrors < 1) {
		//alert("Submit Form");
		document.dyobForm.submit();
	} else {
		errorMsg += '<br/>';
		document.getElementById('errorMsg').innerHTML = errorMsg;
		document.getElementById('errorMsg').style.display = 'block';
		//alert(errorMsg);	
		return false;
	}
	
}

/*************************************************************************************************************************************************************************************/

function validateContactForm(){
	// SET UP ERROR MESSAGE
	errorMsg = "The following error(s) exist, please rectify and try again.<br/><br/>";
	// INITIALISE ERROR COUNTER
	hasErrors = 0;
	// CREATE REG EX EXPRESSIONS
	var re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
	var tre = /^\d{7,}$/;
	var validCode = /^\d{5,}$/;
	var alphaNumeric = /[^\sa-zA-Z0-9!@$%&\\()'",.?_-]/;
	var letters = /[a-zA-Z]{3,}/;
	
	// FUNCTION TO VALIDATE COMPANY ENTERED - NOT MANDATORY
	if(document.contactForm.company.value != "") {
			// Check for number and type of characters entered
			if (!letters.test(document.contactForm.company.value)){
					hasErrors ++;
					errorMsg += "&bull; Company - Invalid characters entered, letters and numbers only.<br/>";		
					document.contactForm.company.value = "";
					document.contactForm.company.focus();
					document.contactForm.company.select();
			}
	}
	
	// FUNCTION TO VALIDATE USER NAME ENTERED - MANDATORY
	if(document.contactForm.name.value == "") {
			hasErrors ++;
			errorMsg += "&bull; Name - Please enter a Contact Name.<br/>";
			document.contactForm.name.focus();
			document.contactForm.name.select();
	} else {
			// Check for number and type of characters entered
			if (!letters.test(document.contactForm.name.value)){
					hasErrors ++;
					errorMsg += "&bull; Name - Invalid characters entered, letters and numbers only.<br/>";		
					document.contactForm.name.value = "";
					document.contactForm.name.focus();
					document.contactForm.name.select();
			}
	}
	
	// FUNCTION TO VALIDATE TELEPHONE NUMBER ENTERED - NOT MANDATORY
	if(document.contactForm.phone.value != "") {
			if (!tre.test(document.contactForm.phone.value)){
					hasErrors ++;
					errorMsg += "&bull; Phone - Not a recognised phone number, please enter a minimum of 7 NUMBERS only.<br/>";
					document.contactForm.phone.value="";
					document.contactForm.phone.focus();
					document.contactForm.phone.select();
			}	
	}
	
	// FUNCTION TO VALIDATE E-MAIL ENTERED - MANDATORY
	if (document.contactForm.email.value == "") {
			hasErrors ++;
			errorMsg += "&bull; Email - Please enter an Email Address.<br/>";
			document.contactForm.email.focus();
			document.contactForm.email.select();
	} else {
			if (!re.test(document.contactForm.email.value)){
					hasErrors ++;
					errorMsg += "&bull; Email - Please enter a VALID email address.<br/>";
					document.contactForm.email.value="";
					document.contactForm.email.focus();
					document.contactForm.email.select();
			}
	}
	
	// FUNCTION TO VALIDATE COMMENTS ENTERED - NOT MANDATORY
	if(document.contactForm.comments.value != "") {
			if (alphaNumeric.test(document.contactForm.comments.value)){
					hasErrors ++;
					errorMsg += "&bull; Comments - Invalid characters entered, letters and numbers only.<br/>";
					document.contactForm.comments.value="";
					document.contactForm.comments.focus();
					document.contactForm.comments.select();
			}	
	}
	
	// ALL ENTRIES VALIDATED SO SUBMIT FORM
	if(hasErrors < 1) {
		//alert("Submit Form");
		document.contactForm.submit();
	} else {
		errorMsg += '<br/>';
		document.getElementById('errorMsg').innerHTML = errorMsg;
		document.getElementById('errorMsg').style.display = 'block';
		//alert(errorMsg);	
		return false;
	}
	
}

/*************************************************************************************************************************************************************************************/

function resetForm(theForm){
	switch(theForm){
		case 'quoteForm':
			document.quoteForm.company.value='';	
			document.quoteForm.name.value = '';
			document.quoteForm.phone.value = '';
			document.quoteForm.email.value = '';
			document.quoteForm.description.value = '';
			document.quoteForm.reference.value = '';
			document.quoteForm.bag_size.value = '';
			document.quoteForm.product.value = '';
			document.quoteForm.qty.value = '';
			document.quoteForm.basecolor.value = '';
			document.quoteForm.fileatt.value = '';
			document.quoteForm.colour_no.value = '';
			document.quoteForm.del_time.value = '';
			document.quoteForm.comments.value='';	
			document.quoteForm.code.value='';	
			break;
		case 'dyobForm':
			document.dyobForm.company.value='';	
			document.dyobForm.name.value = '';
			document.dyobForm.phone.value = '';
			document.dyobForm.email.value = '';
			document.dyobForm.material.value = '';
			document.dyobForm.description.value = '';
			document.dyobForm.reference.value = '';
			document.dyobForm.bag_size.value = '';
			document.dyobForm.qty.value = '';
			document.dyobForm.basecolor.value = '';
			document.dyobForm.fileatt.value = '';
			document.dyobForm.colour_no.value = '';
			document.dyobForm.del_time.value = '';
			document.dyobForm.comments.value='';	
			document.dyobForm.code.value='';	
			break;
		case 'contactForm':
			document.contactForm.company.value='';	
			document.contactForm.name.value = '';
			document.contactForm.phone.value = '';
			document.contactForm.email.value = '';
			document.contactForm.comments.value='';	
			break;
	}
	document.getElementById('errorMsg').innerHTML = '';
	document.getElementById('errorMsg').style.display = 'none';
}
