


//----------------------------------------------------------------------------------------------------------------------
// MEMBER
//----------------------------------------------------------------------------------------------------------------------
	
	function confirm_reset(delthis) {
		if(confirm("ALERT! Password Reset\nAre you sure you want to reset your password ?\n If you continue an email will be sent to your\nmember email address with the new password."))
		window.location=delthis;
	}

	
	function password_reset(){
	
		var myusername = document.getElementById('user_name').value;
		//alert(myusername);

		if (myusername == "" ) {
			alert("Please add your user name");

		}else{	
		
			confirm_reset('member_reset.aspx?user_name='+myusername);
		}
	}


	function member_login(){
	
		var user_name=document.getElementById('user_name').value;
		var user_password=document.getElementById('user_password').value;
		
		if(user_name=='' || user_password==''){
			
			alert('Please add your details');
			
			return false;
		}else{
			//alert('Submit form');
			document.aspnetForm.submit();
		
		}
	}


	function login(url){
	
		var user_name = document.getElementById('user_name').value; 
		var user_password = document.getElementById('user_password').value;
		var url = escape(url);

		//alert(url);
		
		if(user_name!= "" & user_password!=""){
		
			//alert(user_name+" "+user_password);
			
			window.location = "member.aspx?user_name="+user_name+"&user_password="+user_password;
		}else{

			alert("Alert!:\nAdd your login details");
			return false			
		}
	}




	function checkMember(){


		if(confirm("Alert:\nDo you want to edit your details ?"))

		var emailID=document.aspnetForm.client_email

		if (document.aspnetForm.client_name.value == "" ) {
			alert("Please add your name");
			document.aspnetForm.client_name.focus();
			document.aspnetForm.client_name.style.borderColor="red";
			return false;
		}else{
			document.aspnetForm.client_name.style.borderColor="";
		}




		if (document.aspnetForm.client_address_1.value == "" ) {
			alert("Please add your address");
			document.aspnetForm.client_address_1.focus();
			document.aspnetForm.client_address_1.style.borderColor="red";
			return false;
		}else if(document.aspnetForm.client_address_1.value.length<4){
			alert("Your address appears to be incorrect");
			document.aspnetForm.client_address_1.focus();
			document.aspnetForm.client_address_1.style.borderColor="red";
			return false;
		}else{
			document.aspnetForm.client_address_1.style.borderColor="";
		}

		if (document.aspnetForm.client_town.value == "" ) {
			alert("Please add your town");
			document.aspnetForm.client_town.focus();
			document.aspnetForm.client_town.style.borderColor="red";
			return false;
		}else if(document.aspnetForm.client_town.value.length<4){
			alert("Your town appears to be incorrect");
			document.aspnetForm.client_town.focus();
			document.aspnetForm.client_town.style.borderColor="red";
			return false;
		}else{
			document.aspnetForm.client_town.style.borderColor="";
		}


		if (document.aspnetForm.client_county.value == "" ) {
			alert("Please add your county");
			document.aspnetForm.client_county.focus();
			document.aspnetForm.client_county.style.borderColor="red";
			return false;
		}else if(document.aspnetForm.client_county.value.length<4){
			alert("Your county appears to be incorrect");
			document.aspnetForm.client_county.focus();
			document.aspnetForm.client_county.style.borderColor="red";
			return false;
		}else{
			document.aspnetForm.client_county.style.borderColor="";
		}


		if (document.aspnetForm.client_post_code.value == "" ) {
			alert("Please add your postcode");
			document.aspnetForm.client_post_code.focus();
			document.aspnetForm.client_post_code.style.borderColor="red";
			return false;
		}else if(document.aspnetForm.client_post_code.value.length<5){
			alert("Your post code appears to be incorrect");
			document.aspnetForm.client_post_code.focus();
			document.aspnetForm.client_post_code.style.borderColor="red";
			return false;
		}else{
			document.aspnetForm.client_post_code.style.borderColor="";
		}



		if (document.aspnetForm.client_country.value == "" ) {
			alert("Please add your country");
			document.aspnetForm.client_country.focus();
			document.aspnetForm.client_country.style.borderColor="red";
			return false;
		}else if(document.aspnetForm.client_country.value.length<3){
			alert("Your country appears to be incorrect");
			document.aspnetForm.client_country.focus();
			document.aspnetForm.client_country.style.borderColor="red";
			return false;
		}else{
			document.aspnetForm.client_country.style.borderColor="";
		}


		if (document.aspnetForm.client_telephone.value == 0) {
			alert("Please enter your telephone number.");
			document.aspnetForm.client_telephone.focus();
			document.aspnetForm.client_telephone.style.borderColor="red";
			return false;
		} else if (IsNumeric(document.aspnetForm.client_telephone.value) == false) {
			alert("Please enter a correct telephone number\nNumbers Only No Spaces!");
			document.aspnetForm.client_telephone.focus();
			document.aspnetForm.client_telephone.style.borderColor="red";
			document.aspnetForm.client_telephone.value='';
			return false;
		}


		if ((emailID.value==null)||(emailID.value=="")){
			alert("Please Enter your Email Address")
			emailID.focus()
			emailID.style.borderColor="red";
			return false;
		}
		if (echeck(emailID.value)==false){
			emailID.value=""
			emailID.focus()
			emailID.style.borderColor="red";
			return false;
		}



		document.aspnetForm.submit();


	}


	function register(){

		var emailID=document.aspnetForm.register_email

		if (document.aspnetForm.register_name.value == "" ) {
			alert("Please add your name");
			document.aspnetForm.register_name.focus();
			document.aspnetForm.register_name.style.borderColor="red";
			return false;
		}else{
			document.aspnetForm.register_name.style.borderColor="";
		}


		if ((emailID.value==null)||(emailID.value=="")){
			alert("Please Enter your Email Address")
			emailID.focus()
			emailID.style.borderColor="red";
			return false;
		}
		if (echeck(emailID.value)==false){
			emailID.value=""
			emailID.focus()
			emailID.style.borderColor="red";
			return false;
		}


		if (document.aspnetForm.register_email_confirm.value != emailID.value ) {
			alert("Email addresses do not match!");
			

			document.aspnetForm.register_email_confirm.focus();
			document.aspnetForm.register_email_confirm.style.borderColor="red";
			
			
			document.aspnetForm.register_email.focus();
			emailID.style.borderColor="red";
			return false;
		}

		document.aspnetForm.submit();
	}




//----------------------------------------------------------------------------------------------------------------------
// Cell change on mouseover
//----------------------------------------------------------------------------------------------------------------------

	function cell_over(thisCell) {
	 	thisCell.style.backgroundColor = '#F3F6D7';
		return true;
	}
	
	function cell_out(thisCell) {
		thisCell.style.backgroundColor = '#FFFFFF';
		return true;
	}



//----------------------------------------------------------------------------------------------------------------------
// Yes / No 
//----------------------------------------------------------------------------------------------------------------------

	function confirm_Me(delthis) {
		if(confirm("Are you sure ?"))
		window.location=delthis;
	}



//----------------------------------------------------------------------------------------------------------------------
//Location URL
//----------------------------------------------------------------------------------------------------------------------


	function newLocation(myurl) { 
		var myurl=myurl;
		window.location=myurl;
	} 


//----------------------------------------------------------------------------------------------------------------------
//Front page info divs
//----------------------------------------------------------------------------------------------------------------------

    function displayFrontDiv(div)
    {
    
        var divstyle = new String();
        divstyle = document.getElementById(div).style.display;
        if(divstyle.toLowerCase()=="block" || divstyle == "")
        {
            document.getElementById(div).style.display = "none";
            document.getElementById(div+'Exp').innerHTML="[+]";
        }
        else
        {

		for (i=1;i<=6;i++)
		{
			document.getElementById('infoDiv'+i).style.display = "none";
			document.getElementById('infoDiv'+i+'Exp').innerHTML="[+]";
		}

        document.getElementById(div).style.display = "block";
        document.getElementById(div+'Exp').innerHTML="[-]";
        }
     }



	function displayDiv(div){
		var divstyle = new String();
		divstyle = document.getElementById(div).style.display;
		if(divstyle.toLowerCase()=="block" || divstyle == ""){
		    document.getElementById(div).style.display = "none";
		}else{
			document.getElementById(div).style.display = "block";
		}
	}


	function productTabDiv(tab,id){
		var divstyle = new String();
		div=tab+id;
		divstyle = document.getElementById(div).style.display;

		if(divstyle.toLowerCase()=="block" ){

		}else{

			switch(tab){

			case 'desc':

				document.getElementById('desc'+id).style.display = "block"
				document.getElementById('tech'+id).style.display = "none"
				document.getElementById('rel'+id).style.display = "none"			
				document.getElementById('down'+id).style.display = "none"

			break

			case 'tech':

				document.getElementById('desc'+id).style.display = "none"
				document.getElementById('tech'+id).style.display = "block"
				document.getElementById('rel'+id).style.display = "none"			
				document.getElementById('down'+id).style.display = "none"

			break

			case 'rel':

				document.getElementById('desc'+id).style.display = "none"
				document.getElementById('tech'+id).style.display = "none"
				document.getElementById('rel'+id).style.display = "block"			
				document.getElementById('down'+id).style.display = "none"

			break

			case 'down':

				document.getElementById('desc'+id).style.display = "none"
				document.getElementById('tech'+id).style.display = "none"
				document.getElementById('rel'+id).style.display = "none"			
				document.getElementById('down'+id).style.display = "block"

			break

			}

		}

	}



//----------------------------------------------------------------------------------------------------------------------
//Search Box Functions
//----------------------------------------------------------------------------------------------------------------------

	function search(){
	
		mySearch=document.getElementById('search_input').value;
		myLength=mySearch.length;
		
		if(mySearch==''){
			
			alert('Please add your search');
		
		}else{

			if(myLength<4){
				alert('Please add a longer search');
			}else{

				window.location="search.aspx?category_page=Search&search="+mySearch;
			}
			
		}
	}
	

	function submitenter(myfield,e){
		

		var keycode;
		if (window.event) keycode = window.event.keyCode;
		else if (e) keycode = e.which;
		else return true;

		if (keycode == 13){
			search();
	   		return false;
	   	}
	   	else
	   	return true;
	}


	function ajax_search(){
	
		mySearch=document.getElementById('search_text').value;
		myLength=mySearch.length;
		
		if(mySearch==''){
			
			alert('Please add your search');
		
		}else{

			if(myLength<4){
				alert('Please add a longer search');
			}else{

				window.location="search.aspx?category_page=Search&search="+mySearch;
			}
			
		}
	}


	function jquery_search(){

		mySearch=document.getElementById('fname').value;
		myLength=mySearch.length;
		//alert(myLength);
		
		if(mySearch==''){
			
			alert('Please add your search');
		
		}else{

			if(myLength<4){
				alert('Please add a longer search');
			}else{

				window.location="search.aspx?category_page=Search&search="+mySearch;
			}

		}
	}


	function searchDiv(div){
	
		switch(div){

		case 'ps_div':

			document.getElementById('ps_div').style.display = "block";
			document.getElementById('fs_div').style.display = "none";
			document.getElementById('ns_div').style.display = "none";	
		break

		case 'fs_div':

			document.getElementById('ps_div').style.display = "none";
			document.getElementById('fs_div').style.display = "block";
			document.getElementById('ns_div').style.display = "none";
		break

		case 'ns_div':

			document.getElementById('ps_div').style.display = "none";
			document.getElementById('fs_div').style.display = "none";
			document.getElementById('ns_div').style.display = "block";

		break

		}
	
	}


//----------------------------------------------------------------------------------------------------------------------
//Open Custom Window
//----------------------------------------------------------------------------------------------------------------------

	function open_Custom_Window(page,Dims) {
		OpenWin = this.open(page, "new",Dims )
	}

//----------------------------------------------------------------------------------------------------------------------
//IsNumeric Check
//----------------------------------------------------------------------------------------------------------------------

	function IsNumeric(strString)
	//  check for valid numeric strings	
	{
		var strValidChars = "0123456789.-";
		var strChar;
		var blnResult = true;

		if (strString.length == 0) return false;

			//  test strString consists of valid characters listed above
			for (i = 0; i < strString.length && blnResult == true; i++)
			{
				strChar = strString.charAt(i);
				if (strValidChars.indexOf(strChar) == -1)
				{
					blnResult = false;
				}
			}
		return blnResult;
	}

//----------------------------------------------------------------------------------------------------------------------
//Trim Functions
//----------------------------------------------------------------------------------------------------------------------

	function ltrim(str) { 
		for(var k = 0; k < str.length && isWhitespace(str.charAt(k)); k++);
		return str.substring(k, str.length);
	}
	function rtrim(str) {
		for(var j=str.length-1; j>=0 && isWhitespace(str.charAt(j)) ; j--) ;
		return str.substring(0,j+1);
	}

	function isWhitespace(charToCheck) {
		var whitespaceChars = " \t\n\r\f";
		return (whitespaceChars.indexOf(charToCheck) != -1);
	}


	function trim(str) {
		return ltrim(rtrim(str));
	}


//----------------------------------------------------------------------------------------------------------------------
//Product Page Functions
//----------------------------------------------------------------------------------------------------------------------

	function addProduct(productCode){
	
		//alert(productCode);
		
		productCode =trim(productCode);


		var elem = document.getElementById('aspnetForm').elements; 

		for(var i = 0; i < elem.length; i++) { 
		
			
			if(trim(elem[i].name)==productCode+"-quantity")
			{


				if (IsNumeric(elem[i].value) == false) 
				{

					//alert(elem[i].value);

					alert('Please only use numbers for quantity');
				}else{	
					LoopFormValues(productCode);
				}

			}

		} 


	
	}
	
	function LoopFormValues(productCode) { 
	
		var str= ''; 
		var urlstr ='';
		
		var elem = document.getElementById('aspnetForm').elements; 
		
		str += "<b>Product ID: </b>" + productCode + "&nbsp&nbsp"; 
		str += "<BR>";
		
		for(var i = 0; i < elem.length; i++) { 
		
		
			if (elem[i].name.indexOf(productCode+"-") !=-1)
			{
			
				if(elem[i].value==''){
					
					alert('Please choose all product options');
					urlstr="";
					break;

				}else{

					str += "<b>Type: </b>" + elem[i].type + "&nbsp&nbsp"; 
					str += "<b>Name: </b>" + elem[i].name + "&nbsp;&nbsp;"; 
					str += "<b>Value: </b><i> " + elem[i].value + "</i>&nbsp;&nbsp;"; 
					str += "<BR>";     
					
					var fixname = elem[i].name.replace(productCode+"-",'' );
					urlstr += fixname +"="+elem[i].value+"&";					
					
				}
			
			}

		} 

		//document.getElementById('formElements').innerHTML = str+"<br>"+urlstr; 
		
		if(urlstr>''){
		
			urlstr = urlstr.slice(0, -1)
			urlstr = "product_id="+productCode+"&"+urlstr
			window.location = "basket.aspx?"+urlstr;
		}
		
	}	
	
	
	function page_number(category_id,subcategory_id){
		var selObj = document.getElementById('page_count');
		var selIndex = selObj.selectedIndex;
		//alert(selObj.options[selIndex].value);
		window.location = "product.aspx?category_id="+category_id+"&subcategory_id="+subcategory_id+"&category_page=product&page_number="+selObj.options[selIndex].value;
		
	}
	
	
//----------------------------------------------------------------------------------------------------------------------
//Basket Edit Functions
//----------------------------------------------------------------------------------------------------------------------


	// Empty basket
	function empty_basket(basket_number) {
    		if(confirm("Empty your basket ?"))
		window.location = "basket.aspx?action=delete_basket&clear_basket_number="+basket_number;
	}


	//Edit product quantity
	function editQuantity(product){
	if(confirm("Edit this quantity ?"))
		var elem = document.getElementById('aspnetForm').elements; 
		for(var i = 0; i < elem.length; i++) { 
			if (elem[i].name=="quantity-"+product)
			{
				if (IsNumeric(elem[i].value) == false) 
				{
					alert('Please only use numbers for quantity');
					status=0;
					break;
				}else{
					quantity = elem[i].value;
					var status=1;	
				}
			}
		} 
		
		//alert(status);
		
		if(status ==1){
			window.location = "basket.aspx?action=edit&product="+product+"&new_quantity="+quantity;
		}
	}



	function upQuantity(product,new_quantity){
	//if(confirm("Edit this quantity ?"))
		var elem = document.getElementById('aspnetForm').elements; 
		for(var i = 0; i < elem.length; i++) { 
			if (elem[i].name=="quantity-"+product)
			{
				if (IsNumeric(new_quantity) == false) 
				{
					alert('Please only use numbers for quantity');
					status=0;
					break;
				}else{
					new_quantity = parseInt(elem[i].value)+new_quantity;
					var status=1;	
				}
			}
		} 
		if(status ==1){
		
			//alert(new_quantity);
			window.location = "basket.aspx?action=edit&product="+product+"&new_quantity="+new_quantity;
		}
	}



	function downQuantity(product,new_quantity){
	//if(confirm("Edit this quantity ?"))
		var elem = document.getElementById('aspnetForm').elements; 
		for(var i = 0; i < elem.length; i++) { 
			if (elem[i].name=="quantity-"+product)
			{
				if (IsNumeric(new_quantity) == false) 
				{
					alert('Please only use numbers for quantity');
					status=0;
					break;
				}else{
					new_quantity = parseInt(elem[i].value)-new_quantity;
					var status=1;	
				}
			}
		} 
		if(status ==1){
		
			//alert(new_quantity);
			window.location = "basket.aspx?action=edit&product="+product+"&new_quantity="+new_quantity;
		}
	}




	//Remove Product From Basket
	function deleteProduct(product){
		if(confirm("Remove this product ?"))
		window.location = "basket.aspx?action=delete&product="+product;		
	}
	
	
//----------------------------------------------------------------------------------------------------------------------
//Process Functions
//----------------------------------------------------------------------------------------------------------------------
	
	function process_order(){
			
			var send_str ="";
			send_str+="payment_url="+document.forms[0].payment_url.value+"&";
			send_str+="test_status="+document.forms[0].test_status.value+"&";
			send_str+="callback="+document.forms[0].callback.value+"&";
			send_str+="merchant="+escape(document.forms[0].merchant.value)+"&";
			send_str+="trans_id="+document.forms[0].trans_id.value+"&";
			send_str+="Subject="+document.forms[0].Subject.value+"&";
			send_str+="amount="+document.forms[0].amount.value+"&";
			send_str+="digest="+document.forms[0].digest.value+"&";


			alert(send_str);
		
		//window.location = "accepted.aspx";	
	
	}
	

   function process_order1() { 
    
         document.forms[0].action = "accepted.aspx";
         document.forms[0].submit()      
      
   } 









//----------------------------------------------------------------------------------------------------------------------
//Check email address
//----------------------------------------------------------------------------------------------------------------------	
	
	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("Invalid E-mail Address")
			   return false
			}

			if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
			   alert("Invalid E-mail Address")
			   return false
			}

			if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
			    alert("Invalid E-mail Address")
			    return false
			}

			 if (str.indexOf(at,(lat+1))!=-1){
			    alert("Invalid E-mail Address")
			    return false
			 }

			 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
			    alert("Invalid E-mail Address")
			    return false
			 }

			 if (str.indexOf(dot,(lat+2))==-1){
			    alert("Invalid E-mail Address")
			    return false
			 }

			 if (str.indexOf(" ")!=-1){
			    alert("Invalid E-mail Address")
			    return false
			 }

			 return true
		}	



//----------------------------------------------------------------------------------------------------------------------
//Contact Edit Functions
//----------------------------------------------------------------------------------------------------------------------


	function checkContact(){

		var emailID=document.aspnetForm.contact_email
		var security_code_check=document.aspnetForm.security_code_check


		if (document.aspnetForm.contact_name.value == "" ) {
			alert("Please add your name");
			document.aspnetForm.contact_name.focus();
			document.aspnetForm.contact_name.style.borderColor="red";			
			return false;
		}else{
			document.aspnetForm.contact_name.style.borderColor="";
		}

		if (document.aspnetForm.contact_address.value == "" ) {
			alert("Please add your address");
			document.aspnetForm.contact_address.focus();
			document.aspnetForm.contact_address.style.borderColor="red";
			return false;
		}else{
			document.aspnetForm.contact_address.style.borderColor="";
		}

		if (document.aspnetForm.contact_town.value == "" ) {
			alert("Please add your town");
			document.aspnetForm.contact_town.focus();
			document.aspnetForm.contact_town.style.borderColor="red";
			return false;
		}else{
			document.aspnetForm.contact_town.style.borderColor="";
		}

		if (document.aspnetForm.contact_post_code.value == "" ) {
			alert("Please add your post code");
			document.aspnetForm.contact_post_code.focus();
			document.aspnetForm.contact_post_code.style.borderColor="red";
			return false;
		}else{
			document.aspnetForm.contact_post_code.style.borderColor="";
		}

		if (document.aspnetForm.contact_county.value == "" ) {
			alert("Please add your county");
			document.aspnetForm.contact_county.focus();
			document.aspnetForm.contact_county.style.borderColor="red";
			return false;
		}else{
			document.aspnetForm.contact_county.style.borderColor="";
		}


		if (document.aspnetForm.contact_country.value == "" ) {
			alert("Please add your country");
			document.aspnetForm.contact_country.focus();
			document.aspnetForm.contact_country.style.borderColor="red";
			return false;
		}else{
			document.aspnetForm.contact_country.style.borderColor="";		
		}



		if (document.aspnetForm.contact_telephone.value == 0) {
			alert("Please enter your telephone number.");
			document.aspnetForm.contact_telephone.focus();
			document.aspnetForm.contact_telephone.style.borderColor="red";
			return false;
		} else if (IsNumeric(document.aspnetForm.contact_telephone.value) == false) {
			alert("Please enter a correct telephone number\nNumbers Only No Spaces!");
			document.aspnetForm.contact_telephone.focus();
			document.aspnetForm.contact_telephone.value='';
			document.aspnetForm.contact_telephone.style.borderColor="red";
			return false;
		}
		document.aspnetForm.contact_telephone.style.borderColor="";


		if ((emailID.value==null)||(emailID.value=="")){
			alert("Please Enter your Email Address")
			emailID.focus()
			document.aspnetForm.contact_email.style.borderColor="red";			
			return false;
		}
		if (echeck(emailID.value)==false){
			emailID.value=""
			emailID.focus()
			document.aspnetForm.contact_email.style.borderColor="red";			
			return false;
		}
		document.aspnetForm.contact_email.style.borderColor="";		


		if (document.aspnetForm.contact_confirm_email.value != emailID.value ) {
			alert("Email addresses do not match!");
			document.aspnetForm.contact_confirm_email.focus();
			document.aspnetForm.contact_confirm_email.style.borderColor="red";			
			return false;
		}else{
			document.aspnetForm.contact_confirm_email.style.borderColor="";		
		}


		if (document.aspnetForm.contact_enquiry.value == "" ) {
			alert("Please add your enquiry");
			document.aspnetForm.contact_enquiry.focus();
			document.aspnetForm.contact_enquiry.style.borderColor="red";			
			return false;
		}else{
			document.aspnetForm.contact_enquiry.style.borderColor="";			
		}


		if (document.aspnetForm.security_code.value == 0) {
			alert("Please enter the security code.");
			document.aspnetForm.security_code.focus();
			document.aspnetForm.security_code.style.borderColor="red";				
			return false;
		} else if (IsNumeric(document.aspnetForm.security_code.value) == false) {
			alert("Please enter the correct number\nNumbers Only No Spaces!");
			document.aspnetForm.security_code.focus();
			document.aspnetForm.security_code.value='';
			document.aspnetForm.security_code.style.borderColor="red";
			return false;
		}
		document.aspnetForm.security_code.style.borderColor="";		
		

		if (document.aspnetForm.security_code.value != security_code_check.value ) {
			alert("Security code does not match!");
			document.aspnetForm.security_code.focus();
			return false;
		}


		contactSend();

	}

	
	function contactSend(){
	
		var urlStr = "";
		var myurl = "form_process.aspx?";		
	
		var elem = document.getElementById('aspnetForm').elements; 
		for(var i = 0; i < elem.length; i++) { 

			if (elem[i].name!="__VIEWSTATE" & elem[i].name!="copy_address" & elem[i].name!="search_button" & elem[i].name!="reset" & elem[i].name!="send_contact")
			{
				if(elem[i].name=="customer_email"){
					urlStr += elem[i].name+'='+elem[i].value+'&';
				}else{
					urlStr += elem[i].name+'='+escape(elem[i].value)+'&';
				}
			}

		} 
	
		//alert(urlStr);
		window.location=myurl+urlStr;
	
	}
	
	
	
//----------------------------------------------------------------------------------------------------------------------
//Ring Back Functions
//----------------------------------------------------------------------------------------------------------------------

	function ringback_check(){
	
		var emailID=document.ringbackForm.ringback_email
	
		if (document.ringbackForm.ringback_name.value == "" ) {
			alert("Please add your name");
			document.ringbackForm.ringback_name.focus();
			return false;
		}
		
	
		if (document.ringbackForm.ringback_telephone.value == 0) {
			alert("Please enter your telephone number.");
			document.ringbackForm.ringback_telephone.focus();
			return false;
		} else if (IsNumeric(document.ringbackForm.ringback_telephone.value) == false) {
			alert("Please enter a correct telephone number\nNumbers Only No Spaces!");
			document.ringbackForm.ringback_telephone.focus();
				document.ringbackForm.ringback_telephone.value='';
			return false;
		}
	
		if ((emailID.value==null)||(emailID.value=="")){
			alert("Please Enter your Email Address")
			emailID.focus()
			return false;
		}
		if (echeck(emailID.value)==false){
			emailID.value=""
			emailID.focus()
			return false;
		}
	
	
	
		if (document.ringbackForm.ringback_enquiry.value == "" ) {
			alert("Please add your enquiry");
			document.ringbackForm.ringback_enquiry.focus();
			return false;
		}

	
	
	
	
	
	}

	
//----------------------------------------------------------------------------------------------------------------------
//Customer Edit Functions
//----------------------------------------------------------------------------------------------------------------------	
	function copyAddress(){
		document.aspnetForm.delivery_title.value=document.aspnetForm.customer_title.value;
		document.aspnetForm.delivery_name.value=document.aspnetForm.customer_name.value;
		document.aspnetForm.delivery_address_1.value=document.aspnetForm.customer_address_1.value;
		document.aspnetForm.delivery_address_2.value=document.aspnetForm.customer_address_2.value;
		document.aspnetForm.delivery_address_3.value=document.aspnetForm.customer_address_3.value;
		document.aspnetForm.delivery_town.value=document.aspnetForm.customer_town.value;
		document.aspnetForm.delivery_county.value=document.aspnetForm.customer_county.value;
		document.aspnetForm.delivery_post_code.value=document.aspnetForm.customer_post_code.value;
		document.aspnetForm.delivery_telephone.value=document.aspnetForm.customer_telephone.value;

		for (var i=0; i< document.aspnetForm.length; i++) {
			document.aspnetForm[i].selectedIndex = document.aspnetForm.customer_country.selectedIndex;
		}


	}


	function resetForm(){
	
		for (var i=0; i< document.aspnetForm.length; i++) {
		
			if(document.aspnetForm[i].name !='reset' & document.aspnetForm[i].name !='checkout' &  document.aspnetForm[i].name !='copy_address' &  document.aspnetForm[i].name !='search_button' &  document.aspnetForm[i].name !='send_contact'){
				document.aspnetForm[i].value ="";
			}
		}

	}
	
	

	
	function checkCustomer(){

		var emailID=document.aspnetForm.customer_email

		if (document.aspnetForm.customer_name.value == "" ) {
			alert("Please add your name");
			document.aspnetForm.customer_name.focus();
			document.aspnetForm.customer_name.style.borderColor="red";
			return false;
		}else{
			document.aspnetForm.customer_name.style.borderColor="";
		}

		if (document.aspnetForm.customer_address_1.value == "" ) {
			alert("Please add your address");
			document.aspnetForm.customer_address_1.focus();
			document.aspnetForm.customer_address_1.style.borderColor="red";
			return false;
		}else if(document.aspnetForm.customer_address_1.value.length<4){
			alert("Your address appears to be incorrect");
			document.aspnetForm.customer_address_1.focus();
			document.aspnetForm.customer_address_1.style.borderColor="red";
			return false;
		}else{
			document.aspnetForm.customer_address_1.style.borderColor="";
		}

		if (document.aspnetForm.customer_town.value == "" ) {
			alert("Please add your town");
			document.aspnetForm.customer_town.focus();
			document.aspnetForm.customer_town.style.borderColor="red";
			return false;
		}else if(document.aspnetForm.customer_town.value.length<4){
			alert("Your town appears to be incorrect");
			document.aspnetForm.customer_town.focus();
			document.aspnetForm.customer_town.style.borderColor="red";
			return false;
		}else{
			document.aspnetForm.customer_town.style.borderColor="";
		}


		if (document.aspnetForm.customer_county.value == "" ) {
			alert("Please add your county");
			document.aspnetForm.customer_county.focus();
			document.aspnetForm.customer_county.style.borderColor="red";
			return false;
		}else if(document.aspnetForm.customer_county.value.length<4){
			alert("Your county appears to be incorrect");
			document.aspnetForm.customer_county.focus();
			document.aspnetForm.customer_county.style.borderColor="red";
			return false;
		}else{
			document.aspnetForm.customer_county.style.borderColor="";
		}



		if (document.aspnetForm.customer_post_code.value == "" ) {
			alert("Please add your postcode");
			document.aspnetForm.customer_post_code.focus();
			document.aspnetForm.customer_post_code.style.borderColor="red";
			return false;
		}else if(document.aspnetForm.customer_post_code.value.length<5){
			alert("Your post code appears to be incorrect");
			document.aspnetForm.customer_post_code.focus();
			document.aspnetForm.customer_post_code.style.borderColor="red";
			return false;
		}else{
			document.aspnetForm.customer_post_code.style.borderColor="";
		}



		var selObj = document.getElementById('customer_country');
		var selIndex = selObj.selectedIndex;

		if (selObj.options[selIndex].value == "" ) {
			alert("Please select your country");
			document.aspnetForm.customer_country.focus();
			document.aspnetForm.customer_country.style.borderColor="red";
			return false;
		}else{
			document.aspnetForm.customer_country.style.borderColor="";
		}

		if (document.aspnetForm.customer_telephone.value == 0) {
			alert("Please enter your telephone number.");
			document.aspnetForm.customer_telephone.focus();
			document.aspnetForm.customer_telephone.style.borderColor="red";
			return false;
		} else if (IsNumeric(document.aspnetForm.customer_telephone.value) == false) {
			alert("Please enter a correct telephone number\nNumbers Only No Spaces!");
			document.aspnetForm.customer_telephone.focus();
			document.aspnetForm.customer_telephone.style.borderColor="red";
			document.aspnetForm.customer_telephone.value='';
			return false;
		}



		if ((emailID.value==null)||(emailID.value=="")){
			alert("Please Enter your Email Address")
			emailID.focus()
			emailID.style.borderColor="red";
			return false;
		}
		if (echeck(emailID.value)==false){
			emailID.value=""
			emailID.focus()
			emailID.style.borderColor="red";
			return false;
		}


		if (document.aspnetForm.customer_confirm_email.value != emailID.value ) {
			alert("Email addresses do not match!");
			document.aspnetForm.customer_email.focus();
			emailID.style.borderColor="red";
			return false;
		}


	//Delivery Validations


		if (document.aspnetForm.delivery_name.value == "" ) {
			alert("Please add a delivery name\nOr use the copy from invoice button");
			document.aspnetForm.delivery_name.focus();
			document.aspnetForm.delivery_name.style.borderColor="red";
			return false;
		}else if(document.aspnetForm.delivery_name.value.length<2){
			alert("Your delivery name appears to be incorrect");
			document.aspnetForm.delivery_name.focus();
			document.aspnetForm.delivery_name.style.borderColor="red";
			return false;
		}else{
			document.aspnetForm.delivery_name.style.borderColor="";
		}

		if (document.aspnetForm.delivery_address_1.value == "" ) {
			alert("Please add a delivery address\nOr use the copy from invoice button");
			document.aspnetForm.delivery_address_1.focus();
			document.aspnetForm.delivery_address_1.style.borderColor="red";
			return false;
		}else if(document.aspnetForm.delivery_address_1.value.length<4){
			alert("Your delivery address appears to be incorrect");
			document.aspnetForm.delivery_address_1.focus();
			document.aspnetForm.delivery_address_1.style.borderColor="red";
			return false;
		}else{
			document.aspnetForm.delivery_address_1.style.borderColor="";
		}
		
		
		

		if (document.aspnetForm.delivery_town.value == "" ) {
			alert("Please add a delivery town\nOr use the copy from invoice button");
			document.aspnetForm.delivery_town.focus();
			document.aspnetForm.delivery_town.style.borderColor="red";
			return false;
		}else if(document.aspnetForm.delivery_town.value.length<4){
			alert("Your delivery town appears to be incorrect");
			document.aspnetForm.delivery_town.focus();
			document.aspnetForm.delivery_town.style.borderColor="red";
			return false;
		}else{
			document.aspnetForm.delivery_town.style.borderColor="";
		
		}


		if (document.aspnetForm.delivery_county.value == "" ) {
			alert("Please add a delivery county\nOr use the copy from invoice button");
			document.aspnetForm.delivery_county.focus();
			document.aspnetForm.delivery_county.style.borderColor="red";			
			return false;
		}else if(document.aspnetForm.delivery_county.value.length<4){
			alert("Your delivery county appears to be incorrect");
			document.aspnetForm.delivery_county.focus();
			document.aspnetForm.delivery_county.style.borderColor="red";
			return false;
		}else{
			document.aspnetForm.delivery_county.style.borderColor="";
		}
		
		

		if (document.aspnetForm.delivery_post_code.value == "" ) {
			alert("Please add a delivery postcode\nOr use the copy from invoice button");
			document.aspnetForm.delivery_post_code.focus();
			document.aspnetForm.delivery_post_code.style.borderColor="red";
			return false;
		}else if(document.aspnetForm.delivery_post_code.value.length<5){
			alert("Your delivery post code appears to be incorrect");
			document.aspnetForm.delivery_post_code.focus();
			document.aspnetForm.delivery_post_code.style.borderColor="red";
			return false;
		}


		var delObj = document.getElementById('delivery_country');
		var delIndex = delObj.selectedIndex;

		if (delObj.options[delIndex].value == "" ) {
			//alert(delObj.options[delIndex].value);
			alert("Please select a delivery country\nOr use the copy from invoice button");
			document.aspnetForm.delivery_country.focus();
			document.aspnetForm.delivery_country.style.borderColor="red";
			return false;
		}


		//window.location='checkout.aspx';
		checkOut()
	}
	
	
	
	
	
	
	
	function checkOut () {
	  var myForm = document.createElement("form");
	  myForm.method="post" ;
	  myForm.action ="checkout.aspx" ;




	var elem = document.getElementById('aspnetForm').elements; 
	for(var i = 0; i < elem.length; i++) { 

		if (elem[i].name!="__VIEWSTATE" & elem[i].name!="copy_address" & elem[i].name!="search_button" & elem[i].name!="reset" & elem[i].name!="checkout")
		{

		    var myInput = document.createElement("input") ;
		    myInput.setAttribute("name", elem[i].name) ;
		    myInput.setAttribute("value", elem[i].value);
		    myForm.appendChild(myInput) ;	

		}

	} 

	  document.body.appendChild(myForm) ;
	  myForm.submit() ;
	  document.body.removeChild(myForm) ;
	}

	
	
	
	
	
	
	
	
	function checkOut1(){
	
		var urlStr = "";
		var myurl = "checkout.aspx?";		
	
		var elem = document.getElementById('aspnetForm').elements; 
		for(var i = 0; i < elem.length; i++) { 

			if (elem[i].name!="__VIEWSTATE" & elem[i].name!="copy_address" & elem[i].name!="search_button" & elem[i].name!="reset" & elem[i].name!="checkout")
			{
				if(elem[i].name=="customer_email"){
					urlStr += elem[i].name+'='+elem[i].value+'&';
				}else{
					urlStr += elem[i].name+'='+escape(elem[i].value)+'&';
				}
			}

		} 
	
		//alert(urlStr);
		window.location=myurl+urlStr;
	
	}
	
	
	
	
	
//----------------------------------------------------------------------------------------------------------------------
//Gallery
//----------------------------------------------------------------------------------------------------------------------
	//Highlight image script- By Dynamic Drive
	//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
	//This credit MUST stay intact for use

	function makevisible(cur,which){
		strength=(which==0)? 1 : 0.2

		if (cur.style.MozOpacity)
			cur.style.MozOpacity=strength
		else if (cur.filters)
			cur.filters.alpha.opacity=strength*100
	}	
	
	
	//Highlight image script- By Dynamic Drive
	//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
	//This credit MUST stay intact for use

	function category_Fade(cur,which){
		strength=(which==0)? 1 : 0.8

		if (cur.style.MozOpacity)
			cur.style.MozOpacity=strength
		else if (cur.filters)
			cur.filters.alpha.opacity=strength*100
	}	
