






function sendMyFeedback(){
	var sErrors = "";
	var bValid = true;   
	var WebsiteComments = window.frames['_iframe-FeedbackBox'].document.forms['CommentCard'].elements['comments'].value;
    var WebsiteContent = "";
        if (window.frames['_iframe-FeedbackBox'].document.forms['CommentCard'].elements['c1'].checked == true) {WebsiteContent = "1"};
        if (window.frames['_iframe-FeedbackBox'].document.forms['CommentCard'].elements['c2'].checked == true) {WebsiteContent = "2"};
        if (window.frames['_iframe-FeedbackBox'].document.forms['CommentCard'].elements['c3'].checked == true) {WebsiteContent = "3"};
        if (window.frames['_iframe-FeedbackBox'].document.forms['CommentCard'].elements['c4'].checked == true) {WebsiteContent = "4"};
        if (window.frames['_iframe-FeedbackBox'].document.forms['CommentCard'].elements['c5'].checked == true) {WebsiteContent = "5"};
    var WebsiteDesign = "";
        if (window.frames['_iframe-FeedbackBox'].document.forms['CommentCard'].elements['d1'].checked == true) {WebsiteDesign = "1"};
        if (window.frames['_iframe-FeedbackBox'].document.forms['CommentCard'].elements['d2'].checked == true) {WebsiteDesign = "2"};
        if (window.frames['_iframe-FeedbackBox'].document.forms['CommentCard'].elements['d3'].checked == true) {WebsiteDesign = "3"};
        if (window.frames['_iframe-FeedbackBox'].document.forms['CommentCard'].elements['d4'].checked == true) {WebsiteDesign = "4"};
        if (window.frames['_iframe-FeedbackBox'].document.forms['CommentCard'].elements['d5'].checked == true) {WebsiteDesign = "5"};
    var WebsiteUsability = "";
        if (window.frames['_iframe-FeedbackBox'].document.forms['CommentCard'].elements['u1'].checked == true) {WebsiteUsability = "1"};
        if (window.frames['_iframe-FeedbackBox'].document.forms['CommentCard'].elements['u2'].checked == true) {WebsiteUsability = "2"};
        if (window.frames['_iframe-FeedbackBox'].document.forms['CommentCard'].elements['u3'].checked == true) {WebsiteUsability = "3"};
        if (window.frames['_iframe-FeedbackBox'].document.forms['CommentCard'].elements['u4'].checked == true) {WebsiteUsability = "4"};
        if (window.frames['_iframe-FeedbackBox'].document.forms['CommentCard'].elements['u5'].checked == true) {WebsiteUsability = "5"};
    var WebsiteOverall = "";
        if (window.frames['_iframe-FeedbackBox'].document.forms['CommentCard'].elements['o1'].checked == true) {WebsiteOverall = "1"};
        if (window.frames['_iframe-FeedbackBox'].document.forms['CommentCard'].elements['o2'].checked == true) {WebsiteOverall = "2"};
        if (window.frames['_iframe-FeedbackBox'].document.forms['CommentCard'].elements['o3'].checked == true) {WebsiteOverall = "3"};
        if (window.frames['_iframe-FeedbackBox'].document.forms['CommentCard'].elements['o4'].checked == true) {WebsiteOverall = "4"};
        if (window.frames['_iframe-FeedbackBox'].document.forms['CommentCard'].elements['o5'].checked == true) {WebsiteOverall = "5"};
    var WebsiteName = window.frames['_iframe-FeedbackBox'].document.forms['CommentCard'].elements['fullname'].value;
    var WebsiteEmail = window.frames['_iframe-FeedbackBox'].document.forms['CommentCard'].elements['email'].value;
        
        
	if(WebsiteComments.length == 0 || WebsiteComments == "Please enter your comments about this website. (1000 character limit.)"){sErrors = sErrors + "Please tell us what you think of our site\n"; bValid = false;}
	if(WebsiteContent.length == 0){sErrors = sErrors + "Please rate the content of our site\n"; bValid = false;}
	if(WebsiteDesign.length == 0){sErrors = sErrors + "Please rate the design of our site\n"; bValid = false;}
	if(WebsiteUsability.length == 0){sErrors = sErrors + "Please rate the usability of our site\n"; bValid = false;}
	if(WebsiteOverall.length == 0){sErrors = sErrors + "Please rate the our site overall\n"; bValid = false;}
	if(WebsiteName.length == 0 || WebsiteName == "Full name"){sErrors = sErrors + "Please tell us your name\n"; bValid = false;}
	if(WebsiteEmail.length == 0 || WebsiteEmail == "Email address"){sErrors = sErrors + "Please tell us your email address\n"; bValid = false;}
	

	    if(bValid == false)
	    {
		    alert(sErrors);
	    }
	    else {
	    	    
	    document.getElementById("FeedbackBox").style.display = "none";
	    document.getElementById("interVeil").style.display = "none";
	    alert("Many thanks for your feedback. We will use your response to better our service.");
        // send Email
        var message = "";
          message += "<p>A visitor to your site has made the following comments:</p>";
          message += "<p>" + WebsiteComments + "</p>";
          message += "<p>Content rating: " + WebsiteContent + "<br/>";
          message += "<p>Design rating: " + WebsiteDesign + "<br/>";
          message += "<p>Usability rating: " + WebsiteUsability + "<br/>";
          message += "<p>Overall rating: " + WebsiteOverall + "<br/>";
          message += "<p>Name: " + WebsiteName + "<br/>";
          message += "<p>Email: " + WebsiteEmail + "<br/>";
          message += "</p>";
           
          //send email to sales
          SendMessage ("info@fpmailing.co.uk", "clare@fpmailing.co.uk", "dan@bagshots.com", "dan@bagshots.com", "Website feedback", message, "", "");
	    }
	}


function sendMyRegister(){
	var sErrors = "";
	var bValid = true;   
	var WebsiteName = window.frames['_iframe-RegisterBox'].document.forms['CommentCard'].elements['fullname'].value;
    var WebsiteCompany = window.frames['_iframe-RegisterBox'].document.forms['CommentCard'].elements['company'].value;
    var WebsitePostcode = window.frames['_iframe-RegisterBox'].document.forms['CommentCard'].elements['postcode'].value;
    var WebsiteTel = window.frames['_iframe-RegisterBox'].document.forms['CommentCard'].elements['telephone'].value;
    var WebsiteEmail = window.frames['_iframe-RegisterBox'].document.forms['CommentCard'].elements['email'].value;   
        
	if(WebsiteName.length == 0 || WebsiteName == "Full name"){sErrors = sErrors + "Please tell us what your full name\n"; bValid = false;}
	if(WebsiteCompany.length == 0 || WebsiteCompany == "Company name"){sErrors = sErrors + "Please tell us your company name\n"; bValid = false;}
	if(WebsitePostcode.length == 0 || WebsitePostcode == "Postcode"){sErrors = sErrors + "Please tell us your postcode\n"; bValid = false;}
	if(WebsiteTel.length == 0 || WebsiteTel == "Telephone number"){sErrors = sErrors + "Please tell us your telephone number\n"; bValid = false;}
	if(WebsiteEmail.length == 0 || WebsiteEmail == "Email address"){sErrors = sErrors + "Please tell us your email address\n"; bValid = false;}
	

	    if(bValid == false)
	    {
		    alert(sErrors);
	    }
	    else {
	    	    
	    document.getElementById("RegisterBox").style.display = "none";
	    document.getElementById("interVeil").style.display = "none";

        SaveRegister (0, WebsiteName, WebsiteCompany, WebsitePostcode, WebsiteTel, WebsiteEmail)
	    }
	}

function SaveRegister (LeadID, WebsiteName, WebsiteCompany, WebsitePostcode, WebsiteTel, WebsiteEmail){
    var Enq = "";
    Enq += "&LeadID=" + LeadID;
    Enq += "&Name=" + WebsiteName;
    Enq += "&CompanyName=" + WebsiteCompany;
    Enq += "&Postcode=" + WebsitePostcode;
    Enq += "&Tel=" + WebsiteTel;
    Enq += "&Email=" + WebsiteEmail;

    ajaxOptions = {
        method: "post",
        parameters: Enq,
        onSuccess: function(transport){
            var data = transport.responseText.evalJSON();
                var message = "";
                  message += "<p>To use the francotyp.se online store you will need to use the following details:</p>";
                  message += "<p>u: " + WebsiteEmail + "<br/>";
                  message += "p: " + data.Password + "</p>";
                SendMessage ("registrations@francotyp.se", WebsiteEmail, "", "", "Website registration", message, "", "");
                alert("An email has been sent with your log in details.")
        }.bind(this),
        onFailure: function(){
            alert("There was a problem saving the registration");
        }.bind(this),
        onComplete: function(){
        }.bind(this)
    };
    new Ajax.Request("/AjaxCalls/SaveRegistration.aspx", ajaxOptions);
}



var newson = 0;
    function shownews(ID) {
        if (newson == ID) {
            $("MoreNews").fade();
            newson = 0;
        } else {
        if (newson != 0) {
        $("NewsImage_"+newson).fade();
        }
        newson = ID;
        $("NewsImage_"+newson).appear();
        
		$("MoreNews").update($("NewsDesc_"+newson).innerHTML);
		$("MoreNews").appear();
		
		}
        }
function GetNews() {
     new at.bartelme.newsticker();
     $("newsticker").appear()
}


function Testimonials() {
   NextTestimonials();
   setTimeout('Testimonials()',5000);
}
var Teston = 0;
function NextTestimonials() {
        if (Teston != 0) {
        $("Testimonial_"+Teston).fade();
        }
        Teston += 1;
        if ($("Testimonial_"+Teston)) {Teston = Teston} else {Teston = 1} 
        $("Testimonial_"+Teston).appear();
		}
function getOptimail() {
   NextOptimail();
   setTimeout('getOptimail()',5000);
}
var Optimail = 0;
function NextOptimail() {
        if (Optimail != 0) {
        $("Optimail_"+Optimail).fade();
        }
        Optimail += 1;
        if ($("Optimail_"+Optimail)) {Optimail = Optimail} else {Optimail = 1} 
        $("Optimail_"+Optimail).appear();
		}

function SendMessage (from, to, cc, bcc, subject, message, attachments, path){
    var Email = "";
    Email += "&from=" + from;
    Email += "&to=" + to;
    Email += "&CC=" + cc;
    Email += "&BCC=" + bcc;
    Email += "&subject=" + subject;
    Email += "&message=" + message;
    Email += "&attachments=" + attachments;
    Email += "&attachmentsPath=" + path;
    ajaxOptions = {
        method: "post",
        parameters: Email,
        onSuccess: function(transport){
        }.bind(this),
        onFailure: function(){
            alert("There was a problem sending the email");
        }.bind(this),
        onComplete: function(){
        }.bind(this)
    };
    new Ajax.Request("/AjaxCalls/Email.aspx", ajaxOptions);
}

function sendMyBrochure(){
	var sErrors = "";
	var bValid = true;
	var name = $("QuickName").getValue();
	var tel = $("QuickTelephone").getValue();
	var postcode = $("QuickPostcode").getValue();
	
	
	if($("QuickName").getValue().length == 0 || name == "Name"){sErrors = sErrors + "Please enter a contact name\n"; bValid = false;}
	if($("QuickTelephone").getValue().length == 0 || tel == "Telephone"){sErrors = sErrors + "Please enter a telephone number\n"; bValid = false;}
	if($("QuickPostcode").getValue().length == 0){sErrors = sErrors + "Please enter your address\n"; bValid = false;}
	    if(bValid == false)
	    {
		    alert(sErrors);
	    }
	    else {
	    
	      var message = "";
                
          var Company = "";
          if ($("QuickCompany2").getValue().length > 0) {
                Company = $("QuickCompany2").getValue();
          } else {
                Company = $("QuickCompany").getValue();
          } ;  
                  
          message += "<p>Estimated postage " + $("Post").getValue() + "<p>";
          message += "<p>Name " + name + "<p>";
          message += "<p>Telephone Number " + tel + "<p>";
          message += "<p>" + Company + "<br/>";
          message += $("QuickAddress1").getValue() + "<br/>";
          message += $("QuickAddress2").getValue() + "<br/>";
          message += $("QuickTown").getValue() + "<br/>";
          message += $("QuickPostcode").getValue() + "</p>";
           
          //send email to sales
          
          SendMessage ("enquiries@fpmailing.co.uk", "clare@fpmailing.co.uk", "dan@bagshots.com", "dan@bagshots.com", "Send a brochure request", message, "", "")
          window.location = "/enquirycomplete.asp"
	    
	    }
	    }
	    
	    
function sendInfoRequest(){
	var sErrors = "";
	var bValid = true;
	var MyMail = document.getElementById("MyMail");
	var Optimail30 = document.getElementById("Optimail30");
	var Optimail = document.getElementById("Optimail");
	var Ultimail = document.getElementById("Ultimail");
	var UltimailDX = document.getElementById("UltimailDX");
	var CentorMail = document.getElementById("CentorMail");
	var Scales = document.getElementById("Scales");
	var Folders = document.getElementById("Folders");
	var CleanMail = document.getElementById("CleanMail");

	var company = document.getElementById("company");
	var name = document.getElementById("name");
	var position = document.getElementById("position");
	var tel = document.getElementById("tel");
	var Post = document.getElementById("Post");

	var AddressLine1 = document.getElementById("AddressLine1");
	var AddressLine2 = document.getElementById("AddressLine2");
	var City = document.getElementById("City");
	var postcode = document.getElementById("postcode");
	
    if(MyMail.checked == false && 
		Optimail30.checked == false && 
		
		Ultimail.checked == false &&
		UltimailDX.checked == false &&
		CentorMail.checked == false &&
		Scales.checked == false &&
		Folders.checked == false &&
		CleanMail.checked == false
	)
	{sErrors = "Please select a product\n"; bValid = false;}


    if(company.value.length == 0 || company.value == "Company name"){sErrors = sErrors + "Please input your company name\n"; bValid = false;}
	if(name.value.length == 0 || name.value == "Contact name"){sErrors = sErrors + "Please input a contact name\n"; bValid = false;}
	if(position.value.length == 0 || position.value == "Position"){sErrors = sErrors + "Please input the contact's position\n"; bValid = false;}
	if(tel.value.length == 0 || tel.value == "Telephone number"){sErrors = sErrors + "Please input the contact's telephone number\n"; bValid = false;}
	if(Post.value.length == 0){sErrors = sErrors + "Please input the month/week post estimate\n"; bValid = false;}

	if(AddressLine1.value.length == 0 || AddressLine1.value == "Address Line 1"){sErrors = sErrors + "Please enter the first line of your address\n"; bValid = false;}
	if(City.value.length == 0 || City.value == "Town"){sErrors = sErrors + "Please enter your town\n"; bValid = false;}
	if(postcode.value.length == 0 || postcode.value == "Postcode"){sErrors = sErrors + "Please enter your postcode\n"; bValid = false;}
	
	    if(bValid == false)
	    {
		    alert(sErrors);
	    }
	    else {
	        
	        document.getElementById("Form").action = "scripts/sendmail3.asp";
	        document.getElementById("Form").submit();
	    }
	    }
	    
	    
	function sendOfferRequest(){
	var sErrors = "";
	var bValid = true;
	var email = document.getElementById("OffersEmail");


	if(email.value.length == 0 || email.value == "Please enter your email"){sErrors = sErrors + "Please enter an email address\n"; bValid = false;}
	    if(bValid == false)
	    {
		    alert(sErrors);
	    }
	    else {
	    document.getElementById("offercommand").value = "SendOffers";
	    document.getElementById("OfferRequest").submit();
	    }
	    }
	
	function chooseAddress(Company, Address, Address1, Address2, Town){
	var p = document.getElementById("QuickPostcode").value;
	    document.getElementById("EmailBox").style.display = "none";
	    document.getElementById("interVeil").style.display = "none";
	    document.getElementById("QuickFind").style.display = "none";
	    document.getElementById("QuickPostcode").style.display = "none";
	    document.getElementById("QuickPostcode").value = p;    
	    document.getElementById("QuickCompany").value = Company;
	    document.getElementById("QuickAddress1").value = Address1;
	    document.getElementById("QuickAddress2").value = Address2;
	    document.getElementById("QuickTown").value = Town;
	    document.getElementById("QuickAddress").innerHTML = Address;
	    document.getElementById("button-full").style.display = "block";
	}
	
	function chooseAddress3(Company, Address, Address1, Address2, Town){
	var p = document.getElementById("QuickPostcode3").value;
	    document.getElementById("EmailBox").style.display = "none";
	    document.getElementById("interVeil").style.display = "none";
	    document.getElementById("NewPostcode2").value = p;    
	    document.getElementById("NewCompanyName3").value = Company;
	    document.getElementById("NewAddress12").value = Address1;
	    document.getElementById("NewAddress22").value = Address2;
	    document.getElementById("NewAddress32").value = "";
	    document.getElementById("NewTown2").value = Town;
	}
	
	function chooseAddress4(AddressKey, OrganisationKey, PostcodeType, Company, Address, Address1, Address2, Town){
	var p = document.getElementById("Incode").value;
	    document.getElementById("EmailBox").style.display = "none";
	    document.getElementById("interVeil").style.display = "none";
	    document.getElementById("postcode").value = p.toUpperCase();    
	    document.getElementById("company").value = Company;
	    document.getElementById("Address").value = Address;
	    document.getElementById("AddressLine1").value = Address1;
	    document.getElementById("AddressLine2").value = Address2;
	    document.getElementById("City").value = Town;
	    document.getElementById("AddressKey").value = AddressKey;
	    document.getElementById("OrganisationKey").value = OrganisationKey;
	    document.getElementById("PostcodeType").value = PostcodeType;
	    document.getElementById("PostcodeType").value = PostcodeType;

        document.getElementById("newaddress").style.display = "block";
	    
	}
	
	function chooseAddress2(Company, Address, Address1, Address2, Town){
	var p = document.getElementById("QuickPostcode2").value;
	    document.getElementById("EmailBox").style.display = "none";
	    document.getElementById("interVeil").style.display = "none";
	    document.getElementById("NewPostcode").value = p;    
	    document.getElementById("NewCompanyName2").value = Company;
	    document.getElementById("NewAddress1").value = Address1;
	    document.getElementById("NewAddress2").value = Address2;
	    document.getElementById("NewAddress3").value = "";
	    document.getElementById("NewTown").value = Town;
	}
	
	function chooseAddress1(Company, Address, Address1, Address2, Town){
	var p = document.getElementById("QuickPostcode").value;
	    document.getElementById("EmailBox").style.display = "none";
	    document.getElementById("interVeil").style.display = "none";
	    document.getElementById("CurrentPostcode").value = p;    
	    document.getElementById("CurrentCompanyName").value = Company;
	    document.getElementById("CurrentAddress1").value = Address1;
	    document.getElementById("CurrentAddress2").value = Address2;
	    document.getElementById("CurrentAddress3").value = "";
	    document.getElementById("CurrentTown").value = Town;
	}
	
	
function validateChangeCompanyDetails()
	{
		var valid = true;
		var errors = "";
		var panel = document.getElementById("status").value;
		
		if (panel == 0) {valid = false;errors += "Please select the change you wish to make\n";}
		
		var contactName = document.getElementById("fullname");
		var emailAddress = document.getElementById("email");
		var contactTelephone = document.getElementById("telephone");
		
		
		var serial = document.getElementById("serialnumber");
		var model = document.getElementById("machine-type");
		var CurrentCompanyName = "";
		var CurrentCompanyAddress1 = "";
		var CurrentCompanyAddress2 = "";
		var CurrentCompanyAddress3 = "";
		var CurrentCompanyTown = "";
		var CurrentCompanyPostcode = "";
	    var NewCompanyName = "";
		var NewCompanyAddress1 = "";
		var NewCompanyAddress2 = "";
		var NewCompanyAddress3 = "";
		var NewCompanyTown = "";
		var NewCompanyPostcode = "";
		var NewAdvert = false;
		if ( document.getElementById("a1").selected == true) {NewAdvert = true};
		
		
		
		var Cover = document.getElementById("service-contract");
		var Scale = false;
		if ( document.getElementById("machine-scale").value == 1) {Scale = true};
		
		switch(panel)
		{
			case "1":
			    CurrentCompanyName = document.getElementById("CompanyName");
			    CurrentCompanyPostcode = document.getElementById("Postcode");
			    NewCompanyName = document.getElementById("NewCompanyName1");
			    if(CurrentCompanyName.value.length == 0 || CurrentCompanyName.value == "Current company name"){valid = false;errors += "Please enter the current company name\n";}
			    if(CurrentCompanyPostcode.value.length == 0 || CurrentCompanyPostcode.value == "Current company postcode"){valid = false;errors += "Please enter the current company postcode\n";}
				if(NewCompanyName.value.length == 0 || NewCompanyName.value == "New company name"){valid = false;errors += "Please enter the new company name\n";}
				if(serial.value.length == 0 || serial.value == "Serial number"){valid = false;errors += "Please enter your serial no.\n";}
				if(model.value.length == 0){valid = false;errors += "Please select your machine model.\n";}
				if(contactName.value.length == 0 || contactName.value == "Full name"){valid = false;errors += "Please enter a contact name\n";}
				if(emailAddress.value.length == 0 || emailAddress.value == "Email address"){valid = false;errors += "Please enter an email address\n";}
				if(contactTelephone.value.length == 0 || contactTelephone.value == "Telephone number"){valid = false;errors += "Please enter a contact telephone no.\n";}
			break;
			case "2":
			    CurrentCompanyName = document.getElementById("CurrentCompanyName");
		        CurrentCompanyAddress1 = document.getElementById("CurrentAddress1");
		        CurrentCompanyAddress2 =document.getElementById("CurrentAddress2");
        		CurrentCompanyTown = document.getElementById("CurrentTown");
			    CurrentCompanyPostcode = document.getElementById("CurrentPostcode");
			    NewCompanyName = document.getElementById("NewCompanyName2");
		        NewCompanyAddress1 = document.getElementById("NewAddress1");
		        NewCompanyAddress2 =document.getElementById("NewAddress2");
        		NewCompanyTown = document.getElementById("NewTown");
			    NewCompanyPostcode = document.getElementById("NewPostcode");
			    
			    if(CurrentCompanyName.value.length == 0 || CurrentCompanyName.value == "Company name"){valid = false;errors += "Please enter the current company name\n";}
			    if(CurrentCompanyAddress1.value.length == 0 || CurrentCompanyAddress1.value == "Address line 1"){valid = false;errors += "Please enter the current company address\n";}
			    if(CurrentCompanyAddress2.value.length == 0 || CurrentCompanyAddress2.value == "Address line 2"){valid = false;errors += "Please enter the current company address\n";}
			    if(CurrentCompanyTown.value.length == 0 || CurrentCompanyTown.value == "Town"){valid = false;errors += "Please enter the current company town\n";}
			    if(CurrentCompanyPostcode.value.length == 0 || CurrentCompanyPostcode.value == "POSTCODE"){valid = false;errors += "Please enter the current company postcode\n";}
			    
			    if(NewCompanyName.value.length == 0 || NewCompanyName.value == "Company name"){valid = false;errors += "Please enter the new company name\n";}
			    if(NewCompanyAddress1.value.length == 0 || NewCompanyAddress1.value == "Address line 1"){valid = false;errors += "Please enter the new company address\n";}
			    if(NewCompanyAddress2.value.length == 0 || NewCompanyAddress2.value == "Address line 2"){valid = false;errors += "Please enter the new company address\n";}
			    if(NewCompanyTown.value.length == 0 || NewCompanyTown.value == "Town"){valid = false;errors += "Please enter the current new town\n";}
			    if(NewCompanyPostcode.value.length == 0 || NewCompanyPostcode.value == "POSTCODE"){valid = false;errors += "Please enter the new company postcode\n";}
			    
				if(serial.value.length == 0 || serial.value == "Serial number"){valid = false;errors += "Please enter your serial no.\n";}
				if(model.value.length == 0){valid = false;errors += "Please select your machine model.\n";}
				if(Cover.value.length == 0){valid = false;errors += "Please select your machine service contract.\n";}
				
				if(contactName.value.length == 0 || contactName.value == "Full name"){valid = false;errors += "Please enter a contact name\n";}
				if(emailAddress.value.length == 0 || emailAddress.value == "Email address"){valid = false;errors += "Please enter an email address\n";}
				if(contactTelephone.value.length == 0 || contactTelephone.value == "Telephone number"){valid = false;errors += "Please enter a contact telephone no.\n";}
			break;
			case "3":
			    CurrentCompanyName = document.getElementById("CurrentCompanyName");
		        CurrentCompanyAddress1 = document.getElementById("CurrentAddress1");
		        CurrentCompanyAddress2 =document.getElementById("CurrentAddress2");
        		CurrentCompanyTown = document.getElementById("CurrentTown");
			    CurrentCompanyPostcode = document.getElementById("CurrentPostcode");
			    NewCompanyName = document.getElementById("NewCompanyName2");
		        NewCompanyAddress1 = document.getElementById("NewAddress1");
		        NewCompanyAddress2 =document.getElementById("NewAddress2");
        		NewCompanyTown = document.getElementById("NewTown");
			    NewCompanyPostcode = document.getElementById("NewPostcode");
			    
			    if(CurrentCompanyName.value.length == 0 || CurrentCompanyName.value == "Company name"){valid = false;errors += "Please enter the current company name\n";}
			    if(CurrentCompanyAddress1.value.length == 0 || CurrentCompanyAddress1.value == "Address line 1"){valid = false;errors += "Please enter the current company address\n";}
			    if(CurrentCompanyAddress2.value.length == 0 || CurrentCompanyAddress2.value == "Address line 2"){valid = false;errors += "Please enter the current company address\n";}
			    if(CurrentCompanyTown.value.length == 0 || CurrentCompanyTown.value == "Town"){valid = false;errors += "Please enter the current company town\n";}
			    if(CurrentCompanyPostcode.value.length == 0 || CurrentCompanyPostcode.value == "POSTCODE"){valid = false;errors += "Please enter the current company postcode\n";}
			    
			    if(NewCompanyName.value.length == 0 || NewCompanyName.value == "Company name"){valid = false;errors += "Please enter the new company name\n";}
			    if(NewCompanyAddress1.value.length == 0 || NewCompanyAddress1.value == "Address line 1"){valid = false;errors += "Please enter the new company address\n";}
			    if(NewCompanyAddress2.value.length == 0 || NewCompanyAddress2.value == "Address line 2"){valid = false;errors += "Please enter the new company address\n";}
			    if(NewCompanyTown.value.length == 0 || NewCompanyTown.value == "Town"){valid = false;errors += "Please enter the current new town\n";}
			    if(NewCompanyPostcode.value.length == 0 || NewCompanyPostcode.value == "POSTCODE"){valid = false;errors += "Please enter the new company postcode\n";}
			    
				if(serial.value.length == 0 || serial.value == "Serial number"){valid = false;errors += "Please enter your serial no.\n";}
				if(model.value.length == 0){valid = false;errors += "Please select your machine model.\n";}
				if(Cover.value.length == 0){valid = false;errors += "Please select your machine service contract.\n";}
				
				if(contactName.value.length == 0 || contactName.value == "Full name"){valid = false;errors += "Please enter a contact name\n";}
				if(emailAddress.value.length == 0 || emailAddress.value == "Email address"){valid = false;errors += "Please enter an email address\n";}
				if(contactTelephone.value.length == 0 || contactTelephone.value == "Telephone number"){valid = false;errors += "Please enter a contact telephone no.\n";}
			break;
			case "4":
			    NewCompanyName = document.getElementById("NewCompanyName3");
		        NewCompanyAddress1 = document.getElementById("NewAddress12");
		        NewCompanyAddress2 =document.getElementById("NewAddress22");
        		NewCompanyTown = document.getElementById("NewTown2");
			    NewCompanyPostcode = document.getElementById("NewPostcode2");
			    
			    if(NewCompanyName.value.length == 0 || NewCompanyName.value == "Company name"){valid = false;errors += "Please enter the new company name\n";}
			    if(NewCompanyAddress1.value.length == 0 || NewCompanyAddress1.value == "Address line 1"){valid = false;errors += "Please enter the new company address\n";}
			    if(NewCompanyAddress2.value.length == 0 || NewCompanyAddress2.value == "Address line 2"){valid = false;errors += "Please enter the new company address\n";}
			    if(NewCompanyTown.value.length == 0 || NewCompanyTown.value == "Town"){valid = false;errors += "Please enter the current new town\n";}
			    if(NewCompanyPostcode.value.length == 0 || NewCompanyPostcode.value == "POSTCODE"){valid = false;errors += "Please enter the new company postcode\n";}
			    
				if(serial.value.length == 0 || serial.value == "Serial number"){valid = false;errors += "Please enter your serial no.\n";}
				if(model.value.length == 0){valid = false;errors += "Please select your machine model.\n";}
				if(Cover.value.length == 0){valid = false;errors += "Please select your machine service contract.\n";}
				
				if(contactName.value.length == 0 || contactName.value == "Full name"){valid = false;errors += "Please enter a contact name\n";}
				if(emailAddress.value.length == 0 || emailAddress.value == "Email address"){valid = false;errors += "Please enter an email address\n";}
				if(contactTelephone.value.length == 0 || contactTelephone.value == "Telephone number"){valid = false;errors += "Please enter a contact telephone no.\n";}
			break;
		}
        var Charge = 0;
		if(valid == true){
		var Question = "";
		switch(panel)
		{
			case "1":
			    Charge = 20;
				Question = "Thank you for confirming your Change of Company Name.\nWe will now do the rest and your new Royal Mail Licence will be sent to your company within 10 working days from the Date of Change entered.\nThe discounted online cost of £"+Charge+" will be invoiced to you within 5 working days. Please click the \"OK\" button to confirm your acceptance of this charge.";
			break;
			case "2":
			    Charge = 0;
			    if (NewCompanyTown.value != CurrentCompanyTown.value || NewAdvert == true) {
			        Charge = 60;
			    }
			    if (model.value == "T1000" && Charge == 60 && Cover.value == "Fully Comprehensive") {
			        Charge = 80;
			    }
			    if (model.value == "optimail" && Charge == 60 && Cover.value == "Fully Comprehensive") {
			        Charge = 80;
			    }
			    if (model.value == "T1000" && Charge == 60 && Cover.value == "Mandatory") {
			        Charge = 185;
			    }
			    if (model.value == "optimail" && Charge == 60 && Cover.value == "Mandatory") {
			        Charge = 185;
			    }
				Question = "Thank you for confirming your Change of Company Name.\nWe will now do the rest and your new Royal Mail Licence will be sent to your company within 10 working days from the Date of Change entered.\nThe discounted online cost of £"+Charge+" will be invoiced to you within 5 working days. Please click the \"OK\" button to confirm your acceptance of this charge.";
			break;
			case "3":	     
			    Charge = 0;
			    if (NewCompanyTown.value != CurrentCompanyTown.value || NewAdvert == true) {
			        Charge = 60;
			    }
			    if (model.value == "T1000" && Charge == 60 && Cover.value == "Fully Comprehensive") {
			        Charge = 80;
			    }
			    if (model.value == "optimail" && Charge == 60 && Cover.value == "Fully Comprehensive") {
			        Charge = 80;
			    }
			    if (model.value == "T1000" && Charge == 60 && Cover.value == "Mandatory") {
			        Charge = 185;
			    }
			    if (model.value == "optimail" && Charge == 60 && Cover.value == "Mandatory") {
			        Charge = 185;
			    }
				Question = "Thank you for confirming your Change of Company Name.\nWe will now do the rest and your new Royal Mail Licence will be sent to your company within 10 working days from the Date of Change entered.\nThe discounted online cost of £"+Charge+" will be invoiced to you within 5 working days. Please click the \"OK\" button to confirm your acceptance of this charge.";
			break;
			case "4":
		        switch(Cover.value)
		        {
			        case "Mandatory":
			            Charge = 118 + 85 + 60;
				    break;
			        case "Fully Comprehensive":
		                    switch(model.value)
		                    {
			                    case "mymail":
			                        if (Scale == true) {Charge = 158 + 85;} else {Charge = 95 + 85;}
				                break;
			                    case "optimail":
			                        Charge = 179 + 85;
				                break;
				                case "T1000":
			                        Charge = 179 + 85;
				                break;
			                    case "optimail 30":
			                        if (Scale == true) {Charge = 265.00 + 85;} else {Charge = 179.00 + 85;}
				                break;
				                case "ultimail 65":
			                        if (Scale == true) {Charge = 377.00 + 85;} else {Charge = 240.00 + 85;}
				                break;
				                case "ultimail 95":
			                        if (Scale == true) {Charge = 464.00 + 85;} else {Charge = 342.00 + 85;}
				                break;
				                case "centormail":
			                        Charge = 0;
				                break;
		                    }
				    break;
		        }
		        if ( Charge == 0 ) {
		        Question = "Thank you for contacting FP with your New Company details.\n\nWithin 3 days, you will receive your new FP Teleset and Maintenance Agreement. Once completed, please return to our Head Office address which will be on your covering Letter. Once we receive your signed Agreement, we will contact you to organise setting up your new FP machine.\n\nSomeone will contact you shortly about the cost of setting up your new FP Machine.\n\nPlease Note: The above, can take up to 15 working days.";
			    } else {
				Question = "Thank you for contacting FP with your New Company details.\n\nWithin 3 days, you will receive your new FP Teleset and Maintenance Agreement. Once completed, please return to our Head Office address which will be on your covering Letter. Once we receive your signed Agreement, we will contact you to organise setting up your new FP machine.\n\nThe discounted online cost of £"+Charge+" will be invoiced to you once we have successfully set up your new FP Machine.\n\nPlease Note: The above, can take up to 15 working days.";
			    };
			break;
		}
		var answer = confirm(Question);
        if (answer){
		    document.getElementById("change-command").value = "insertrequest";
		    document.getElementById("change-form").submit();
	    }
	    else{
		    document.getElementById("change-command").value = "insertrequestFAIL";
		    document.getElementById("change-form").submit();
	    }

		
		

		}
		else{alert(errors);}
	}
	
	
 function clearMe(formfield){
  if (formfield.defaultValue==formfield.value){
   formfield.value = ""}

  }
 function returnMe(formfield){
   if (formfield.value==""){
   formfield.value = formfield.defaultValue}
  }

function getaddress(){
		var Postcode = document.getElementById("QuickPostcode").value;
		
		if (Postcode != "Postcode"){
		emailwindow=dhtmlmodal.open('EmailBox', 'iframe', 'modalfiles/addressfinder.asp?Postcode=' + Postcode, '', 'width=450px,height=450px,center=1,resize=0,scrolling=no')

        emailwindow.onclose=function(){ //Define custom code to run when window is closed
	    var theform=this.contentDoc.forms[0] //Access first form inside iframe just for your reference
	    var theemail=this.contentDoc.getElementById("emailfield") //Access form field with id="emailfield" inside iframe
	        if (theemail.value.indexOf("@")==-1){ //crude check for invalid email
		        alert("Please enter a valid email address")
		        return false //cancel closing of modal window
	        }
	        else{ //else if this is a valid email
		        document.getElementById("youremail").innerHTML=theemail.value //Assign the email to a span on the page
		        return true //allow closing of window
	        }
    }}
	}
	
function getcontactaddress(){
		var Postcode = document.getElementById("Incode").value;
		
		if (Postcode != "Postcode"){
		emailwindow=dhtmlmodal.open('EmailBox', 'iframe', 'modalfiles/addressfinder4.asp?Postcode=' + Postcode, '', 'width=450px,height=450px,center=1,resize=0,scrolling=no')

        emailwindow.onclose=function(){ //Define custom code to run when window is closed
	    var theform=this.contentDoc.forms[0] //Access first form inside iframe just for your reference
	    var theemail=this.contentDoc.getElementById("emailfield") //Access form field with id="emailfield" inside iframe
	        if (theemail.value.indexOf("@")==-1){ //crude check for invalid email
		        alert("Please enter a valid email address")
		        return false //cancel closing of modal window
	        }
	        else{ //else if this is a valid email
		        document.getElementById("youremail").innerHTML=theemail.value //Assign the email to a span on the page
		        return true //allow closing of window
	        }
    }}
	}
	
function getnewaddress2(){
		var Postcode = document.getElementById("QuickPostcode3").value;
		if (Postcode != "Postcode lookup"){
		emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/modalfiles/addressfinder3.asp?Postcode=' + Postcode, '', 'width=558px,height=565px,center=1,resize=0,scrolling=0')
    }
	}
function getnewaddress(){
		var Postcode = document.getElementById("QuickPostcode2").value;
		if (Postcode != "Postcode lookup"){
		emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/modalfiles/addressfinder2.asp?Postcode=' + Postcode, '', 'width=558px,height=565px,center=1,resize=0,scrolling=0')
    }
	}
function getexistingaddress(){
		var Postcode = document.getElementById("QuickPostcode").value;
		if (Postcode != "Postcode lookup"){
		emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/modalfiles/addressfinder1.asp?Postcode=' + Postcode, '', 'width=558px,height=565px,center=1,resize=0,scrolling=0')
    }
	}	
	
function GetFeedback(){	
		emailwindow=dhtmlmodal.open('FeedbackBox', 'iframe', '/modalfiles/Feedback.asp', '', 'width=450px,height=500px,center=1,resize=0,scrolling=0')
}
function GetAddressChanger(){	
		emailwindow=dhtmlmodal.open('FeedbackBox', 'iframe', '/modalfiles/Support_Change.asp', '', 'width=600px,height=565px,center=1,resize=1,scrolling=0')
}


	function sendMyAddress(){
	
	var sErrors = "";
	var bValid = true;   
	
    	var QuickCompany = window.frames['_iframe-EmailBox'].document.forms['MyAddress'].elements['MyCompanyName'].value;
        var QuickAddress1 = window.frames['_iframe-EmailBox'].document.forms['MyAddress'].elements['MyAddress1'].value;
        var QuickAddress2 = window.frames['_iframe-EmailBox'].document.forms['MyAddress'].elements['MyAddress2'].value;
        var QuickTown = window.frames['_iframe-EmailBox'].document.forms['MyAddress'].elements['MyTown'].value;
        var QuickPostcode = window.frames['_iframe-EmailBox'].document.forms['MyAddress'].elements['MyPostcode'].value;
	    var Address = ""
	    
	    if(QuickCompany == "Company Name"){QuickCompany = ""}
	
	    
	    if (QuickCompany.length > 0) {Address = Address + QuickCompany + ", "}
	    if (QuickAddress1.length > 0) {Address = Address + QuickAddress1 + ", "}
	    if (QuickAddress2.length > 0) {Address = Address + QuickAddress2 + ", "}
	    if (QuickTown.length > 0) {Address = Address + QuickTown + ", "}
	    if (QuickPostcode.length > 0) {Address = Address + QuickPostcode + ", "}
	    
	    if (Address.length > 0) {  Address = Address.substring(0,(Address.length - 2));}
	    
	  
	    
	if(QuickAddress1.length == 0 || QuickAddress1 == "Address"){sErrors = sErrors + "Please enter your house number and street\n"; bValid = false;}
	if(QuickTown.length == 0 || QuickTown == "Town/City"){sErrors = sErrors + "Please enter your town or city\n"; bValid = false;}
	if(QuickPostcode.length == 0 || QuickPostcode == "Postcode"){sErrors = sErrors + "Please enter your postcode\n"; bValid = false;}
	    if(bValid == false)
	    {
		    alert(sErrors);
	    }
	    else {
	    	    
	    document.getElementById("EmailBox").style.display = "none";
	    document.getElementById("interVeil").style.display = "none";
	    document.getElementById("QuickFind").style.display = "none";
	    document.getElementById("QuickPostcode").style.display = "none";
	        
	    document.getElementById("QuickCompany").value = QuickCompany;
	    document.getElementById("QuickAddress1").value = QuickAddress1;
	    document.getElementById("QuickAddress2").value = QuickAddress2;
	    document.getElementById("QuickTown").value = QuickTown;
	    document.getElementById("QuickPostcode").value = QuickPostcode;   
	    
	    document.getElementById("QuickAddress").innerHTML = Address;
	    document.getElementById("button-faded").style.display = "none";
	    document.getElementById("button-full").style.display = "block";
	    }
	    
	    
	    

	}
	
	








function openImagePopUp(imageURL)
{
	var imageWindow = document.open('imagepopup.asp?img=' + imageURL, 'imagePopUp', 'left=20,top=20,width=800,height=600,toolbar=0,resizable=0');
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf('#')!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
var bType;
var bleft;
var bleft2;
var bleft3;
var bleft4;
var bleft5;
var btop;
var blnMenuOn = false;
function browserType ()
{
if (navigator.userAgent.indexOf('Opera')!=-1 && document.getElementById)
return 'OP'; // Opera
if (navigator.userAgent.indexOf('Safari')!=-1)
return 'SA'; // Safari
if (document.all)
return 'IE'; // Internet Explorer
if (document.layers)
return 'NN'; //Netscape 4
if (!document.all && document.getElementById)
return 'MO'; // Mozilla (Netscape 6+, etc)
}
function setLayerDisplay (pstrID, pstrVisibility)
{
if (document.getElementById(pstrID)) {
if (bType == "IE")
eval("document.all." + pstrID + ".style.display='" + pstrVisibility + "'"); 
if (bType == "NN")
eval("document." + pstrID + ".display='" + pstrVisibility + "'"); 
if (bType == "MO" || bType == "OP" || bType == "SA") 
eval("document.getElementById('" + pstrID + "').style.display='" + pstrVisibility + "'"); 
}}
function setLayerVisibility (pstrID, pstrVisibility)
{
if (bType == "IE")
eval("document.all." + pstrID + ".style.visibility='" + pstrVisibility + "'"); 
if (bType == "NN")
eval("document." + pstrID + ".visibility='" + pstrVisibility + "'"); 
if (bType == "MO" || bType == "OP" || bType == "SA") 
eval("document.getElementById('" + pstrID + "').style.visibility='" + pstrVisibility + "'"); 
}



function setPosition (pstrID, pstrPOS)
{
if (bType == "IE")
eval("document.all." + pstrID + ".style.left='" + pstrPOS + "'"); 
if (bType == "NN")
eval("document." + pstrID + ".left='" + pstrPOS + "'"); 
if (bType == "MO" || bType == "OP" || bType == "SA") 
eval("document.getElementById('" + pstrID + "').style.left='" + pstrPOS + "'"); 
}
var a;
a = '';
var b;
b = '';
var c;
c = '';
function loadcontent()
{
document.getElementById("newcontent").innerHTML = document.getElementById("content").innerHTML
document.getElementById("content").innerHTML = ""
}
function doMenuClose ()
{
if(a.length > 1)
{
setLayerDisplay(a, 'none');
}
if(b.length > 1)
{
setLayerDisplay(b, 'none');
}
if(c.length > 1)
{
setLayerDisplay(c, 'none');
}
}
function doMenuCloseB ()
{
if(b.length > 1)
{
setLayerVisibility(b, 'hidden');
}
if(c.length > 1)
{
setLayerVisibility(c, 'hidden');
}
}
function doMenuCloseC ()
{
if(c.length > 1)
{
setLayerVisibility(c, 'hidden');
}
}


function doMenuOn (pstrSubID)
{
if(a.length > 1)
{
setLayerDisplay(a, 'none');
}
if(b.length > 1)
{
setLayerDisplay(b, 'none');
}
if(c.length > 1)
{
setLayerDisplay(c, 'none');
}
a = pstrSubID;
setLayerDisplay(pstrSubID, 'block');
}


function doMenuOnB (pstrSubID)
{
if(b.length > 1)
{
setLayerDisplay(b, 'none');
}
if(c.length > 1)
{
setLayerDisplay(c, 'none');
}
b = pstrSubID;
setLayerDisplay(pstrSubID, 'block');
}



function doMenuOnC (pstrID, pstrSubID)
{
if(c.length > 1)
{
setLayerVisibility(c, 'hidden');
}
c = pstrSubID;
setPosition(c, bleft5);
setLayerVisibility(pstrSubID, 'visible');
}
function offLayer (pstrLayer)
{
if (pstrLayer == 'Layer1')
{
if(a.length > 1)
{
setLayerVisibility(a, 'hidden');
}
if(b.length > 1)
{
setLayerVisibility(b, 'hidden');
}
if(c.length > 1)
{
setLayerVisibility(c, 'hidden');
}
}
}
function windowchange()
{
if (bType == 'IE')
{
bleft = document.body.clientWidth;
if (bleft <= 782)
{
bleft = 782;
}
bleft = bleft / 2 - 180;
bleft2 = bleft - 201;
setLayerVisibility('date', 'hidden');
setLayerVisibility('header', 'hidden');
setLayerVisibility('breadcrumbs', 'hidden');
eval('document.all.date.style.top=12');
eval('document.all.header.style.top=37');
eval('document.all.breadcrumbs.style.top=171');
eval('document.all.date.style.left=' + bleft2);
eval('document.all.header.style.left=' + bleft2 + 400);
eval('document.all.breadcrumbs.style.left=' + bleft2);
setLayerVisibility('date', 'visible');
setLayerVisibility('header', 'visible');
setLayerVisibility('breadcrumbs', 'visible');
}

if (bType == "NN")
	{
	bleft = window.innerWidth;
	if (bleft <= 782)
		{
		bleft = 782;
		}
	bleft = bleft / 2 - 224;
	bleft2 = bleft - 148;
	bleft3 = bleft2 + 184;
	bleft4 = bleft3 + 184;
	bleft5 = bleft4 + 184;

setLayerVisibility('date', 'hidden');
setLayerVisibility('header', 'hidden');
setLayerVisibility('breadcrumbs', 'hidden');
eval('document.date.left=' + bleft2);
eval('document.header.left=' + bleft2 + 400);
eval('document.breadcrumbs.left=' + bleft2);
setLayerVisibility('date', 'visible');
setLayerVisibility('header', 'visible');
setLayerVisibility('breadcrumbs', 'visible');
}
if (bType == "MO")
	{
	bleft = window.innerWidth;
	if (bleft <= 798)
		{
			bleft = 798;
		}
	bleft = bleft / 2 - 233;
	bleft2 = bleft - 158;
	bleft3 = bleft2 + 184;
	bleft4 = bleft3 + 184;
	bleft5 = bleft4 + 184;
setLayerVisibility('date', 'hidden');
setLayerVisibility('header', 'hidden');
setLayerVisibility('breadcrumbs', 'hidden');
eval("document.getElementById('date').style.left=" + bleft2);
eval("document.getElementById('header').style.left=" + bleft2 + 400);
eval("document.getElementById('breadcrumbs').style.left=" + bleft2);
setLayerVisibility('date', 'visible');
setLayerVisibility('header', 'visible');
setLayerVisibility('breadcrumbs', 'visible');
	}
if (bType == "SA")
	{
	bleft = window.innerWidth;
	if (bleft <= 798)
		{
			bleft = 798;
		}
	bleft = bleft / 2 - 223;
	bleft2 = bleft - 158;
	bleft3 = bleft2 + 184;
	bleft4 = bleft3 + 184;
	bleft5 = bleft4 + 184;
setLayerVisibility('date', 'hidden');
setLayerVisibility('header', 'hidden');
setLayerVisibility('breadcrumbs', 'hidden');
eval("document.getElementById('date').style.left=" + bleft2);
eval("document.getElementById('header').style.left=" + bleft2 + 400);
eval("document.getElementById('breadcrumbs').style.left=" + bleft2);
setLayerVisibility('date', 'visible');
setLayerVisibility('header', 'visible');
setLayerVisibility('breadcrumbs', 'visible');
	}
if (bType == "OP")
	{
	bleft = window.innerWidth;
	if (bleft <= 782)
		{
		bleft = 782;
		}
	bleft = bleft / 2 - 224;
	bleft2 = bleft - 148;
	bleft3 = bleft2 + 184;
	bleft4 = bleft3 + 184;
	bleft5 = bleft4 + 184;
setLayerVisibility('date', 'hidden');
setLayerVisibility('header', 'hidden');
setLayerVisibility('breadcrumbs', 'hidden');
eval("document.getElementById('date').style.left=" + bleft2);
eval("document.getElementById('header').style.left=" + bleft2 + 400);
eval("document.getElementById('breadcrumbs').style.left=" + bleft2);
setLayerVisibility('date', 'visible');
setLayerVisibility('header', 'visible');
setLayerVisibility('breadcrumbs', 'visible');
	}
}

function PostcodeCheck(Postcode, Match) {
  var re = new RegExp(Match);
  if (Postcode.match(re)) {
    return true;
  } else {
    return false;
  }
}

function checkcode() {
 var a = document.getElementById("Form");
 a.action = ""
 a.submit();
}
function sendRateMail() {
 var a = document.getElementById("Form");
 a.action = "/scripts/sendmailrate.asp"
 a.submit();
}



function checkagree() {
	var tt = document.getElementById("checker");
	if (tt.checked) {
		var tt = document.getElementById("continue");
		tt.disabled = false;
	} else {var tt = document.getElementById("continue");tt.disabled = true;}
}

function GetFranchise() {
var postcode = document.getElementById("Postcode").value
if (postcode == "P21 8IP") {
  document.getElementById("Franchise").innerHTML = "<p><b>You didn't think it was going to be that simple.... did you?<br><br>Your next clue is SUB DOMAIN</b></p>"
 } else 


	var tstring = "";
	postcode = '' + postcode;
	splitstring = postcode.split(" ");
	for(i = 0; i < splitstring.length; i++)
	tstring += splitstring[i];
	postcode = tstring;


var message = "<p></p><p>email supplies@fpmailing.co.uk for further assistance.</p><p></p>";


 postcode = postcode.substr(0, 3);
 postcode = postcode.toUpperCase();

   if ( PostcodeCheck(postcode, "AB[0-9]") ||  PostcodeCheck(postcode, "DD[0-9]") ||  PostcodeCheck(postcode, "DG[0-9]") ||  PostcodeCheck(postcode, "EH[0-9]") ||  PostcodeCheck(postcode, "FK[0-9]") ||  PostcodeCheck(postcode, "G[0-9][0-9]") ||  PostcodeCheck(postcode, "HS[0-9]") ||  PostcodeCheck(postcode, "IV[0-9]") ||  PostcodeCheck(postcode, "KA[0-9]") ||  PostcodeCheck(postcode, "KW[0-9]")||  PostcodeCheck(postcode, "KY[0-9]") ||  PostcodeCheck(postcode, "ML[0-9]") ||  PostcodeCheck(postcode, "PA[0-9]") ||  PostcodeCheck(postcode, "PH[0-9]") ||  PostcodeCheck(postcode, "TD[0-9]") ||  PostcodeCheck(postcode, "ZE[0-9]")) {
  message = "<p><b>NCS Office Systems (Scotland) Ltd</b><br>Glasgow<br>65 Rodney Street<br>Glasgow<br>G4 9SQ<br><br>Tel: 0141 353 0000<br>Fax: 0141 353 0011<br>Service: 0870 050 2233<br><br>Edinburgh<br>2nd Floor<br>44 Melville Street<br>Edinburgh<br>EH3 7HF<br><br><p>Tel: 0131 225 5505<br>Fax: 0131 225 5255</p>"
 } else 
if (PostcodeCheck(postcode, "BB[0-9]") || PostcodeCheck(postcode, "BD[0-9]") || PostcodeCheck(postcode, "BL[0-9]") || PostcodeCheck(postcode, "FY[0-9]") || PostcodeCheck(postcode, "HD[0-9]") || PostcodeCheck(postcode, "HX[0-9]") || PostcodeCheck(postcode, "L[0-9][0-9]") || PostcodeCheck(postcode, "LA[0-9]") || PostcodeCheck(postcode, "OL[0-9]") || PostcodeCheck(postcode, "PR[0-9]") || PostcodeCheck(postcode, "WA[0-9]") || PostcodeCheck(postcode, "WN[0-9]") || PostcodeCheck(postcode, "CA[0-9]") || PostcodeCheck(postcode, "DH[0-9]") || PostcodeCheck(postcode, "DL[0-9]") || PostcodeCheck(postcode, "DN[0-9]") || PostcodeCheck(postcode, "HG[0-9]") || PostcodeCheck(postcode, "HU[0-9]") || PostcodeCheck(postcode, "LN[0-9]") || PostcodeCheck(postcode, "LS[0-9]") || PostcodeCheck(postcode, "NE[0-9]") || PostcodeCheck(postcode, "S[0-9][0-9]") || PostcodeCheck(postcode, "SR[0-9]") || PostcodeCheck(postcode, "TS[0-9]") || PostcodeCheck(postcode, "WF[0-9]") || PostcodeCheck(postcode, "YO[0-9]") || PostcodeCheck(postcode, "CH[0-9]") || PostcodeCheck(postcode, "CW[0-9]") || PostcodeCheck(postcode, "DE[0-9]") || PostcodeCheck(postcode, "LL[0-9]") || PostcodeCheck(postcode, "M[0-9][0-9]") || PostcodeCheck(postcode, "SK[0-9]") || PostcodeCheck(postcode, "ST[0-9]") || PostcodeCheck(postcode, "SY[0-9]")) {
  message = "<p>FP Mailing (North West) Ltd<br>Southerly 7<br>Waterfold Business Park<br>Bury<br>Manchester<br>BL9 7BR<br><br>Tel: 0161 797 7778<br>  Fax: 0161 797 7797<br>Email: enquiries@fpmailingnorthwest.co.uk<br><a href=\"http://www.themailingroom.com\" target=\"_blank\">www.themailingroom.com</a></p>"
 } else
if ( PostcodeCheck(postcode, "B[0-9][0-9]") || PostcodeCheck(postcode, "CV[0-9]") || PostcodeCheck(postcode, "DY[0-9]") || PostcodeCheck(postcode, "LE[0-9]") || PostcodeCheck(postcode, "NG[0-9]") || PostcodeCheck(postcode, "TF[0-9]") || PostcodeCheck(postcode, "WR[0-9]") || PostcodeCheck(postcode, "WS[0-9]") || PostcodeCheck(postcode, "WV[0-9]")) {
  message = "<p><b>FP Mailing Midlands</b><br>The Barn<br>Little Hyde Hall<br>Hatfield Heath Road<br>Sawbridgeworth<br>CM21 9HX<br><br>Tel: 0844 264 0011<br>Fax: 0844 257 1270<br>Email: sales@fpmailingmidlands.co.uk<br><a href=\"http://www.fpmailingmidlands.co.uk\" target=\"_blank\">www.fpmailingmidlands.co.uk</a></p>"
 } else 
if (PostcodeCheck(postcode, "AL[0-9]") || PostcodeCheck(postcode, "HA[0-9]") || PostcodeCheck(postcode, "HP[0-9]") || PostcodeCheck(postcode, "LU[0-9]") || PostcodeCheck(postcode, "OX[0-9]") || PostcodeCheck(postcode, "SL[0-9]") || PostcodeCheck(postcode, "WD[0-9]") || PostcodeCheck(postcode, "BA[0-9]") || PostcodeCheck(postcode, "BS[0-9]") || PostcodeCheck(postcode, "CF[0-9]") || PostcodeCheck(postcode, "GL[0-9]") || PostcodeCheck(postcode, "HR[0-9]") || PostcodeCheck(postcode, "LD[0-9]") || PostcodeCheck(postcode, "NP[0-9]") || PostcodeCheck(postcode, "SA[0-9]") || PostcodeCheck(postcode, "GU[0-9]") || PostcodeCheck(postcode, "KT[0-9]") || PostcodeCheck(postcode, "NW[0-9]") || PostcodeCheck(postcode, "PO[0-9]") || PostcodeCheck(postcode, "TW[0-9]") || PostcodeCheck(postcode, "W[0-9][0-9]")) {
  message = "<p><b>FP Mailing (Southwest) Ltd</b><br>40 Alexandra Road<br>Windsor<br>Berkshire<br>SL4 1HU<br><br>Tel: 01753 621868<br>Fax: 01753 862566<br>Mob: 07970 846868<br>Email: sales@fpsouthwest.com</p>"
 } else 
if (  PostcodeCheck(postcode, "BH[0-9]") || PostcodeCheck(postcode, "DT[0-9]") || PostcodeCheck(postcode, "EX[0-9]") || PostcodeCheck(postcode, "PL[0-9]") || PostcodeCheck(postcode, "RG[0-9]") || PostcodeCheck(postcode, "SN[0-9]") || PostcodeCheck(postcode, "SO[0-9]") || PostcodeCheck(postcode, "SP[0-9]") || PostcodeCheck(postcode, "TA[0-9]") || PostcodeCheck(postcode, "TQ[0-9]") || PostcodeCheck(postcode, "TR[0-9]")) {
  message = "<p><b>FP - IMS Southern Ltd</b><br>Unit 4<br>Saturn House<br>Calleva Park<br>Aldermaston<br>RG7 8HA<br><br>Tel: 0118 982 0988 <br>Fax: 0118 982 0924<br>Email: info@ims-franking.co.uk<br><a href=\"http://www.ims-franking.co.uk\" target=\"_blank\">www.ims-franking.co.uk</a></p>"
 } else
if (PostcodeCheck(postcode, "EN[0-9]") || PostcodeCheck(postcode, "EC[0-9]") || PostcodeCheck(postcode, "EN[0-9]") || PostcodeCheck(postcode, "N[0-9][0-9]") || PostcodeCheck(postcode, "SG[0-9]") || PostcodeCheck(postcode, "WC[0-9]") || PostcodeCheck(postcode, "E[0-9][0-9]") || PostcodeCheck(postcode, "SE[0-9]") || PostcodeCheck(postcode, "EC[0-9]")) {
  message = "<p><b>FP Mailing Premier Ltd</b><br>Premier House<br>Great Queen Street<br>Dartford<br>Kent<br>DA1 1TJ<br><br>Tel: 0844 567 9010<br>Fax: 0844 567 9020<br>Email: enquiries@fpmailingcity.co.uk<br><a href=\"http://www.themailingroom.com\" target=\"_blank\">www.themailingroom.com</a></p>"
 } else
if (PostcodeCheck(postcode, "BN[0-9]") || PostcodeCheck(postcode, "BR[0-9]") || PostcodeCheck(postcode, "CR[0-9]") || PostcodeCheck(postcode, "CT[0-9]") || PostcodeCheck(postcode, "DA[0-9]") || PostcodeCheck(postcode, "ME[0-9]") || PostcodeCheck(postcode, "RH[0-9]") || PostcodeCheck(postcode, "SM[0-9]") || PostcodeCheck(postcode, "SW[0-9]") || PostcodeCheck(postcode, "TN[0-9]")) {
  message = "<p><b>FP Mailing (South)</b><br>Unit 15, Swan Business Park<br>Sandpit Road<br>Dartford<br>Kent<br>DA1 5ED<br><br>Tel: 01322 288890<br>Fax: 01322 288866<br>Email: enquiries@fpmailingcity.co.uk<br><a href=\"http://www.themailingroom.com\" target=\"_blank\">www.themailingroom.com</a></p>"
 } else
if (PostcodeCheck(postcode, "BT[0-9]")) {
  message = "<p>Copytext<br>4 Union Buildings<br>Union Place<br>Dungannon<br>Co Tyrone<br>N. Ireland<br>BT70 1DL<br><br>Tel: 028 87753939<br>Fax: 028 87753929<br>Email: phughes@copytextni.co.uk</p>"
 } else
if (PostcodeCheck(postcode, "CB[0-9]") || PostcodeCheck(postcode, "CM[0-9]") || PostcodeCheck(postcode, "CO[0-9]") || PostcodeCheck(postcode, "IG[0-9]") || PostcodeCheck(postcode, "IP[0-9]") || PostcodeCheck(postcode, "MK[0-9]") || PostcodeCheck(postcode, "NN[0-9]") || PostcodeCheck(postcode, "NR[0-9]") || PostcodeCheck(postcode, "PE[0-9]") || PostcodeCheck(postcode, "RM[0-9]") || PostcodeCheck(postcode, "SS[0-9]")  ) {
  message = "<p>FP Mailing (SouthEast) Ltd<br>Regus House<br>Victor Way<br>Admirals Park<br>Crossways<br>Dartford<br>Kent<br>DA2 6QD<br><br>Tel: 0844 880 2388<br>Fax: 0844 880 2505<br>Email: info@fpsystemsuk.com</p>"
 }
emailwindow=dhtmlmodal.open('RegisterBox', 'iframe', 'modalfiles/consumables.asp?message='+message, '', 'width=260px,height=380px,center=1,resize=0,scrolling=0')
 

};
var sTarget;
var sInput;
sInput = ""
sTarget = ""
function doPostcode(ID)
	{
	if (ID == "Outcode") {sInput = "Outcode";sTarget = "calender";}
	var d = document.getElementById('frm').Outcode.value;
	var e = document.getElementById('frm').Incode.value;
  	document.getElementById('frm1').action = "diary.asp?Outcode=" + d + "&Incode=" + e;
  	document.getElementById('frm1').target = "HDiary";
	document.getElementById('frm1').submit();
	}

function Loading()
	{
	sInput = "Outcode";sTarget = "calender";
	document.getElementById('frm1').action = "loading.asp"
	document.getElementById('frm1').target = "HDiary";
	document.getElementById('frm1').submit();
	}
var theInterval;
function doLoadCalender(newData) {
    if( theInterval ) { clearInterval(theInterval); }
    var d = document.getElementById(sTarget);
		d.style.display = 'none';
	d.innerHTML = newData;
		d.style.display = 'block';
}
function doSelect(dateSelected)
	{
	var d = document.getElementById(sInput);
	d.value = dateSelected;
	var d = document.getElementById(sTarget);
	d.style.display = 'none';
	}
	
sfHover = function()
{
	var sfEls = document.getElementById("levelzero").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++)
	{
		sfEls[i].onmouseover = function()
		{
			this.className += " sfhover";
		}
		sfEls[i].onmouseout = function()
		{
			this.className = this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);






function computesize(form)
{
letter_first_sav = form.letters_first.value;
letter_second_sav = form.letters_second.value;

large_first_sav = form.large_first.value;
large_second_sav = form.large_second.value;
totalletters = parseInt(letter_first_sav) + parseInt(letter_second_sav) + parseInt(large_first_sav) + parseInt(large_second_sav)
packet_100first = form.pack_100_first.value;
packet_100second = form.pack_100_second.value;
packet_250first = form.pack_250_first.value;
packet_250second = form.pack_250_second.value;
packet_500first = form.pack_500_first.value;
packet_500second = form.pack_500_second.value;
packet_750first = form.pack_750_first.value;
packet_750second = form.pack_750_second.value;
packet_1000first = form.pack_1000_first.value;
packet_1000second = form.pack_1000_second.value;

letter_first_sav = ((letter_first_sav * 2) /100 );
letter_second_sav = ((letter_second_sav * 2) /100 );
large_first_sav = ((large_first_sav * 4) /100 );
large_second_sav = ((large_second_sav * 4) /100 );

packet_100first_sav = ((packet_100first * 6) /100 );
packet_100second_sav = ((packet_100second * 5) /100 );
packet_250first_sav = ((packet_250first * 7) /100 );
packet_250second_sav = ((packet_250second * 6) /100 );
packet_500first_sav = ((packet_500first * 15) /100 );
packet_500second_sav = ((packet_500second * 13) /100 );
packet_750first_sav = ((packet_750first * 20) /100 );
packet_750second_sav = ((packet_750second * 16) /100 );
packet_1000first_sav = ((packet_1000first * 24) /100 );
packet_1000second_sav = ((packet_1000second * 19) /100 );





total_week_sav = (letter_first_sav + letter_second_sav + large_first_sav + large_second_sav + packet_100first_sav + packet_100second_sav + packet_250first_sav + packet_250second_sav + packet_500first_sav + packet_500second_sav + packet_750first_sav + packet_750second_sav + packet_1000first_sav + packet_1000second_sav );

total_week_sav = (total_week_sav * 100);

total_week_sav = Math.round(total_week_sav);

total_week_sav = (total_week_sav /100);


total_year_sav = (total_week_sav * 52);
total_year_sav = (total_year_sav * 100);

total_year_sav = Math.round(total_year_sav);

total_year_sav = (total_year_sav / 100);

results=window.open("","results","width=450,height=400")

results.document.write ("<center><font color='#666666'><h2>The Results of Your Survey</h2></center><p>In addition to all the benefits of using a franking machine, convenience, advertising, security, speed through the post, control, corporate professional image etc etc you would also make a saving of</p><p><font color='#993333'>£" + total_week_sav + " per week</font></p>");
results.document.write ("<p><font color='#993333'>or £" + total_year_sav + " per year</font></p>" );


if (totalletters <= 300)
     results.document.write ("<p><b> We recommend based purely on your postal volumes our world class mymail</b></p><a href=javascript:opener.location='index.asp';self.close()>Get more details of this solution and start saving now</a>");

if (totalletters > 300)
     results.document.write ("<br /><br /><b>In our experience of companies with your mail volume you will not only benefit from correct FP Franking Machine but also by maximizing the savings available from Royal Mail or DX. Please <a href=javascript:opener.location='information.asp';self.close()>click to receive further information</a>.</b><br /><br />");



results.document.write ("<center><a href='javascript:window.close();'>Close Window</a></center>");

}









function RateChangeInstructions (Movie, Width, Height) {
Width = parseInt(Width) + 10;
Height = parseInt(Height) + 10;

	window.open("RateChangeShow.asp?MovieSrc=" + Movie + "&Height=&Width=","ratechange","width=" + Width + ",height=" + Height)
}





function DiscCheck () {
	var tt = document.getElementById("iddcheck");
	if (tt.checked) {
		var tt = document.getElementById("continue");
		tt.disabled = false;
		var dd = document.getElementById("DiscDate")
		var currentTime = new Date()
		var month = currentTime.getMonth() + 1
		var day = currentTime.getDate()
		var year = currentTime.getFullYear()
		dd.innerHTML = day  + "/" + month + "/" + year;
	} else {
		var tt = document.getElementById("continue");
		tt.disabled = true;
		var dd = document.getElementById("DiscDate")
		dd.innerHTML = "";
	}
}


function SubmitIDD () {
	window.open("/images/ReturnsForm.pdf")
}


function checkPin () {
	document.getElementById("Form").action = "secure/teleset/loginfail.asp";
	document.getElementById("Form").submit();
}






function CancelDownload () {
	var tt = document.getElementById("Terms");
	if (bType == "IE")
	tt.style.display='none'; 
	if (bType == "NN")
	tt.display='none'; 
	if (bType == "MO" || bType == "OP") 
	tt.style.display='none'; 
}

function DownloadCheck () {
	var tt = document.getElementById("iddcheck");
	if (tt.checked) {
		var aa = document.getElementById("AddressKey");
		var bb = document.getElementById("company");
		var cc = document.getElementById("tel");		
		var dd = document.getElementById("name");
		var errr = ""
		if (aa.value.length == 0) {errr = errr + "Please enter an Address\n";}
		if (bb.value.length == 0) {errr = errr + "Please enter a Company Name\n";}
		if (cc.value.length == 0) {errr = errr + "Please enter a Telephone Number\n";}
		if (dd.value.length == 0) {errr = errr + "Please enter a Contact Name\n";}
		if (errr != "") {
			var tt = document.getElementById("iddcheck");
			tt.checked = false;
			alert (errr);
		} else {
			var tt = document.getElementById("iddcontinue");
			tt.disabled = false;
		}
	}
}
function SubmitDownload () {
	window.open("/HelpCentre/Karat_demo.zip");
	var tt = document.getElementById("frm");
	tt.submit();
}
function SubmitDownload2 () {
	window.open("/HelpCentre/Infoprint12.zip");
	var tt = document.getElementById("frm");
	tt.submit();
}
function GetDownload () {
	var tt = document.getElementById("Terms");
	if (bType == "IE"){
		bleft = document.body.clientWidth;
		if (bleft <= 762)
			{
			bleft = 762;
			}
		bleft = bleft / 2 - 160;
		tt.style.left = bleft;
		tt.style.display='inline';}
	if (bType == "NN") {
		bleft = window.innerWidth;
		if (bleft <= 762)
			{
			bleft = 762;
			}
		bleft = bleft / 2 - 360;
		setPosition ('Terms', bleft)
		tt.display='inline';}
	if (bType == "MO" || bType == "OP") {
		bleft = window.innerWidth;
		if (bleft <= 762)
			{
			bleft = 762;
			}
		bleft = bleft / 2 - 160;
		setPosition ('Terms', bleft)
		tt.style.display='inline';}
}

    function PaperlessOpen() {
		emailwindow=dhtmlmodal.open('RegisterBox', 'iframe', '/modalfiles/paperless.asp', '', 'width=300px,height=280px,center=1,resize=0,scrolling=0')
        }

        
    function searchwebsite() {
        $("Searchform").action = "search.asp";
		$("Searchform").submit();
        } 
        
        function validateLoginForm(){
        var LoginPin = window.frames['_iframe-LoginBox'].document.forms['CommentCard'].elements['LoginPin'].value;
        var LoginPostcode = window.frames['_iframe-LoginBox'].document.forms['CommentCard'].elements['LoginPostcode'].value;
        
		if(LoginPin.length == 0 || LoginPostcode.length == 0){
			alert("There is a problem with your login details:\nYour username and password are required.");
		}
		else {
		    $("LoginPin").value = LoginPin;
		    $("LoginPostcode").value = LoginPostcode;
		    $("LoginForm").submit();
		}
	
		


	}

	function logout(){
		document.getElementById("Command").value = "LogOut";
		document.getElementById("LoginForm").submit();
	}
	function nextSlide(){
		$("franking_machines_1").fade();
		$("franking_machines_2").appear();
	}
    function loginOpen() {
        emailwindow=dhtmlmodal.open('LoginBox', 'iframe', '/modalfiles/login.asp', '', 'width=300px,height=180px,center=1,resize=0,scrolling=0')
        }
    function clearLogin() {
		$("login-panel").hide();
        } 
    function RegisterOpen() {
        emailwindow=dhtmlmodal.open('RegisterBox', 'iframe', '/modalfiles/Register.asp', '', 'width=260px,height=230px,center=1,resize=0,scrolling=0')
        }
        
        
    function closeQuestionaire(){
        if (document.getElementById("FeedbackBox")) {document.getElementById("FeedbackBox").style.display = "none";}
        if (document.getElementById("LoginBox")) {document.getElementById("LoginBox").style.display = "none";}
        if (document.getElementById("RegisterBox")) {document.getElementById("RegisterBox").style.display = "none";}
	    
	    document.getElementById("interVeil").style.display = "none";
	}
    function closeAddress3(){
        if (document.getElementById("EmailBox")) {document.getElementById("EmailBox").style.display = "none";}	
        document.getElementById("interVeil").style.display = "none";    
	}
