HelpText = new Array;
HelpText['Employer_name'] = "Please enter the name of the company you work for.  This name must not be longer than 30 digits.";
HelpText['GrossNet'] = "Gross amount is before Tax is deducted from your Salary and the Net amount is after Tax has been deducted from your Salary.";
HelpText['Payslip_type'] = "You can view all different types of Payslips on our front page.";
HelpText['personal_details'] = "Enter your Personal Details in the fields below.";
HelpText['payment_method'] = "Specify whether you wish to pay for your account online by credit or debit card, or whether you will settle your account offline by cheque or bank transfer. If you choose to pay by cheque or bank transfer we will email you a pro forma invoice and remittance advice with further instructions, your account will not be activated until we receive your payment.";
HelpText['cardnumber'] = "This is a long number printed on the front of the card.";
HelpText['expiry'] = "Select the month and year that your card expires from the drop-down list.";
HelpText['cvv'] = "Security Number is found at the back side of the card on the signiture strip, Please enter last 3 digits!<br><br><div align='center'><img src='./images/securitycode.jpg'></div><br>See the illustrations above for assistance identifying your card security code.";
HelpText['begin'] = "If your card has a begin, start or valid from date, select the month and year from the drop-down list. This field is not applicable to all cards, if your card does not have a begin date, leave this field blank.";
HelpText['issue'] = "If your card has an issue number, enter it here. This field is not applicable to all cards, if your card does not have an issue number, leave this field blank.";
HelpText['card_owner'] = "If the registered name and address of the card you are using to pay (normally the name and address shown on the card statement) is not the same as those you have entered for the Account Owner above, uncheck this box and enter the card holder's contact details.";
HelpText['NI_details'] = "NI No is your National Insurance Number.  It starts with two letters and six numbers and one letter at the end, for example, XX 999999 Y";
HelpText['payslipDates'] = "For example, if you require 3 monthly payslips from 28th August until 28th October.  Enter 28th August in the From box and 28th October in the Until box, then you will receive 3 payslips dated 28/08/04, 28/09/04, 28/10/04. <br><br>For Example, If you require 3 weekly payslips from 03/12/04 until 17/12/04, Enter 03/12/04 in the from box and 17/12/04 in the until box then you will recieve 3 payslips dated 03/12/04, 10/12/04, 17/12/04.  <br><br>Common monthly pay date is 28th of each month, and common weekly pay day is Friday of each week.";
HelpText['payslips_required'] = "Please select how would you like us to make your payslips Weekly, Monthly or Fortnightly.";
HelpText['GrossSalaryAmount'] = "Please enter a Total Gross Amount that you earned in the Year, you require a P60 for.";
HelpText['contactdetails'] = "<br><br>If you require assistance in filling in this page, Please email <br>info@a1payslipsp60.co.uk.";
HelpText['helptxt'] = "You will find this icon throught the order page, please use it to assist you.";
HelpText['TaxOfficeName'] = "Normally it is local tax office where the business is based.";
HelpText['TaxRefNo'] = "Normally tax office reference number starts with 3 numbers and combinations of letters and numbers, for example, 777/MK2244";
HelpText['AnnualSalaryAmount1'] = "Normally it is local tax office where the business is based.";


<!--
function PopUpHelp(field,yArg,xArg) {
  if (yArg == undefined) { yArg = -10; }
  if (xArg == undefined) { xArg = 20; }
  document.getElementById("helptext").innerHTML = HelpText[field] + HelpText['contactdetails'];
  document.getElementById("helplayer").style.left = GetElementLeft(document.images[field]) + xArg;
  document.getElementById("helplayer").style.top = GetElementTop(document.images[field]) + yArg;
  document.getElementById("helplayer").style.visibility = "visible";
}

function GetElementLeft(eElement)
{
   if (!eElement && this)                    // if argument is invalid
   {                                         // (not specified, is null or is 0)
      eElement = this;                       // and function is a method
   }                                         // identify the element as the method owner

   var DL_bIE = document.all ? true : false; // initialize var to identify IE

   var nLeftPos = eElement.offsetLeft;       // initialize var to store calculations
   var eParElement = eElement.offsetParent;  // identify first offset parent element

   while (eParElement != null)
   {                                         // move up through element hierarchy

      if(DL_bIE)                             // if browser is IE, then...
      {
         if( (eParElement.tagName != "TABLE") && (eParElement.tagName != "BODY") )
         {                                   // if parent is not a table or the body, then...
            nLeftPos += eParElement.clientLeft; // append cell border width to calcs
         }
      }
      else                                   // if browser is Gecko, then...
      {
         if(eParElement.tagName == "TABLE")  // if parent is a table, then...
         {                                   // get its border as a number
            var nParBorder = parseInt(eParElement.border);
            if(isNaN(nParBorder))            // if no valid border attribute, then...
            {                                // check the table's frame attribute
               var nParFrame = eParElement.getAttribute('frame');
               if(nParFrame != null)         // if frame has ANY value, then...
               {
                  nLeftPos += 1;             // append one pixel to counter
               }
            }
            else if(nParBorder > 0)          // if a border width is specified, then...
            {
               nLeftPos += nParBorder;       // append the border width to counter
            }
         }
      }
      nLeftPos += eParElement.offsetLeft;    // append left offset of parent
      eParElement = eParElement.offsetParent; // and move up the element hierarchy
   }                                         // until no more offset parents exist
   return nLeftPos;                          // return the number calculated
}

function GetElementTop(eElement)
{
   if (!eElement && this)                    // if argument is invalid
   {                                         // (not specified, is null or is 0)
      eElement = this;                       // and function is a method
   }                                         // identify the element as the method owner

   var DL_bIE = document.all ? true : false; // initialize var to identify IE

   var nTopPos = eElement.offsetTop;         // initialize var to store calculations
   var eParElement = eElement.offsetParent;  // identify first offset parent element

   while (eParElement != null)
   {                                         // move up through element hierarchy
      if(DL_bIE)                             // if browser is IE, then...
      {
         if( (eParElement.tagName != "TABLE") && (eParElement.tagName != "BODY") )
         {                                   // if parent a table cell, then...
            nTopPos += eParElement.clientTop; // append cell border width to calcs
         }
      }
      else                                   // if browser is Gecko, then...
      {
         if(eParElement.tagName == "TABLE")  // if parent is a table, then...
         {                                   // get its border as a number
            var nParBorder = parseInt(eParElement.border);
            if(isNaN(nParBorder))            // if no valid border attribute, then...
            {                                // check the table's frame attribute
               var nParFrame = eParElement.getAttribute('frame');
               if(nParFrame != null)         // if frame has ANY value, then...
               {
                  nTopPos += 1;              // append one pixel to counter
               }
            }
            else if(nParBorder > 0)          // if a border width is specified, then...
            {
               nTopPos += nParBorder;        // append the border width to counter
            }
         }
      }

      nTopPos += eParElement.offsetTop;      // append top offset of parent
      eParElement = eParElement.offsetParent; // and move up the element hierarchy
   }                                         // until no more offset parents exist
   return nTopPos;                           // return the number calculated
}
//-->


<!--

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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->

function IsNumeric(sText)
{
 var ValidChars = "£0123456789.,p-";
 var IsNumber=true;
 var Char;

  
 for (i = 0; i < sText.length && IsNumber == true; i++) 
 { 
  Char = sText.charAt(i); 
  if (ValidChars.indexOf(Char) == -2) 
  {
   IsNumber = false;
  }
 }
 return IsNumber;   
}

function IsNumericPayslip(sText)
{
 var ValidChars = "0123456789/";
 var IsNumber=true;
 var Char;

  
 for (i = 0; i < sText.length && IsNumber == true; i++) 
 { 
  Char = sText.charAt(i); 
  if (ValidChars.indexOf(Char) == -1) 
  {
   IsNumber = false;
  }
 }
 return IsNumber;   
}

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)
  {     
     return false
  }

  if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)
  {     
     return false
  }

  if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
      
      return false
  }

   if (str.indexOf(at,(lat+1))!=-1){
      
      return false
   }

  if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
      
      return false
   }

   if (str.indexOf(dot,(lat+2))==-1){
      
      return false
   }
  
   if (str.indexOf(" ")!=-1){
      
      return false
   }

    return true     
 }


function thisform_onsubmit() { 

if(thisform.txtTitle.value  == ""
 || thisform.txtName.value  == ""
 || thisform.txtPhone.value  == ""
 || thisform.txtEmployerName.value == "" 
 || thisform.txtGrossSalaryAmount.value  == ""
 || thisform.txtCardHolderName.value  == ""
 || thisform.txtCardNumber.value  == ""
 || thisform.txtExpiryMonth.value  == ""
 || thisform.txtExpiryYear.value  == ""
 || thisform.CardHolderAddress.value  == ""
 || thisform.txtCardHolderPostCode.value  == ""
 || thisform.txtSecurityCode.value == ""
 || thisform.txtHOWDIDYOUHEAR.value  == "")
{ 
alert('Please enter the required fields marked with a red star!'); 
return false; 
} 

if(!IsNumeric(thisform.txtSecurityCode.value))
{
alert('The Security Code is invalid. Please enter a valid Security Code!'); 
document.thisform.txtSecurityCode.focus();
return false; 
}

var sSecurity = thisform.txtSecurityCode.value;
if(sSecurity.length != 3)
{
alert('Please enter 3 digit Security Code!'); 
document.thisform.txtSecurityCode.focus();
return false; 
}

if(thisform.txtTitle.value == "[Select One]")
{
 alert("Please select a Title!");
 document.thisform.txtTitle.focus();
 return false;
}

if ((thisform.GrossNet1[0].checked == false) && (thisform.GrossNet1[1].checked == false))
{
 alert("Please select whether the Salary Amount is Gross / Net!");
 document.thisform.GrossNet1[0].focus();
 return false;
}

if(thisform.txtHowIsYourSalaryPaid.value == "[Select One]")
{
 alert("Please select how your salary is paid by !");
 document.thisform.txtHowIsYourSalaryPaid.focus();
 return false;
}


if((thisform.optStandardSage.options[thisform.optStandardSage.selectedIndex].value == "none") && (thisform.optStandardPlusSageGreen.options[thisform.optStandardPlusSageGreen.selectedIndex].value == "none") && (thisform.optStandardPlusSageBlue.options[thisform.optStandardPlusSageBlue.selectedIndex].value == "none") && (thisform.optSecurityPayslip.options[thisform.optSecurityPayslip.selectedIndex].value == "none") && (thisform.txtP60Qty.options[thisform.txtP60Qty.selectedIndex].value == "none"))
{
 alert("Please select the type of Payslip / p60 Package required!");
 document.thisform.optStandardSage.focus();
 return false;
}

if(thisform.txtHOWDIDYOUHEAR.value == "[Select One]")
{
 alert("Please select how did you hear about us!");
 document.thisform.txtHOWDIDYOUHEAR.focus();
 return false;
}

if(thisform.PayslipsFrom.value == "")
{
 alert("Please enter the date you require payslips from!");
 document.thisform.PayslipsFrom.focus();
 return false;
}

if(thisform.PayslipsUntil.value == "")
{
 alert("Please enter the date you require payslips until!");
 document.thisform.PayslipsUntil.focus();
 return false;
}

if((thisform.txtExpiryMonth.value == "[Select One]") && (thisform.txtExpiryYear.value == "[Select One]"))
{
 alert("Please select Expiry Date, valid from Month !");
 document.thisform.txtExpiryMonth.focus();
 return false;
}

if((thisform.txtExpiryMonth.value != "[Select One]") && (thisform.txtExpiryYear.value == "[Select One]"))
{
 alert("Please select Expiry Date, valid from Year !");
 document.thisform.txtExpiryYear.focus();
 return false;
}

if((thisform.txtExpiryMonth.value == "[Select One]") && (thisform.txtExpiryYear.value != "[Select One]"))
{
 alert("Please select Expiry Date, valid from Month !");
 document.thisform.txtExpiryMonth.focus();
 return false;
}

var str = thisform.txtCardNumber.value;

if(str.length < 16) {
 alert("The card no is invalid. Please enter a valid card no!");
 document.thisform.txtCardNumber.focus();
 return false;
}

if((thisform.txtCardIssueMonth .value != "") && (thisform.txtCardIssueYear.value == ""))
{
 alert("Please select Issue Date, valid from Year !");
 document.thisform.txtCardIssueYear.focus();
 return false;
}

if((thisform.txtCardIssueMonth .value == "") && (thisform.txtCardIssueYear.value != ""))
{
 alert("Please select Issue Date, valid from Month !");
 document.thisform.txtCardIssueMonth.focus();
 return false;
}

if(!IsNumeric(thisform.txtGrossSalaryAmount.value))
{
alert('The Salary Amount is invalid. Please enter a valid Salary Amount!'); 
document.thisform.txtGrossSalaryAmount.focus();
return false; 
}

sPhone = new String(thisform.txtPhone.value);
sPhone = sPhone.replace(" ", "-");

if(!IsNumeric(sPhone))
{
alert('Personal Details - The phone number is invalid. Please enter a valid phone number!');
document.thisform.txtPhone.focus();
return false; 
}

if(thisform.txtEmail.value != "")
{
 if(!echeck(thisform.txtEmail.value))
 {
 alert('Personal Details - The email is invalid. Please enter a valid email!'); 
 document.thisform.txtEmail.focus();
 return false; 
 }
}

}

function CheckDelivery(oDelivery)
{
	if (oDelivery.id == "GuaranteedDeliveryB49")
	{
		//Check 
		thisform.GuaranteedDeliveryB412.checked = false;
	}
	
	if (oDelivery.id == "GuaranteedDeliveryB412")
	{
		//Check 
		thisform.GuaranteedDeliveryB49.checked = false;
	}
	calculatecost();
}

function calculatecost()
{


	var PayslipCost = 0;

	//Standard Payslip
	switch (document.thisform.payslipselection.value)
	{
		case "optStandardSage": 
		{ 	
			document.thisform.optStandardPlusSageGreen.selectedIndex = 0;
			document.thisform.optStandardPlusSageBlue.selectedIndex = 0;
			document.thisform.optSecurityPayslip.selectedIndex = 0;
 			break 
		}
		case "optStandardPlusSageGreen": 
		{ 	
			document.thisform.optStandardSage.selectedIndex = 0;
			document.thisform.optStandardPlusSageBlue.selectedIndex = 0;
			document.thisform.optSecurityPayslip.selectedIndex = 0;
 			break 
		}
		case "optStandardPlusSageBlue": 
		{ 	
			document.thisform.optStandardSage.selectedIndex = 0;
			document.thisform.optStandardPlusSageGreen.selectedIndex = 0;
			document.thisform.optSecurityPayslip.selectedIndex = 0;
 			break 
		}
		case "optSecurityPayslip": 
		{ 	
			document.thisform.optStandardSage.selectedIndex = 0;
			document.thisform.optStandardPlusSageGreen.selectedIndex = 0;
			document.thisform.optStandardPlusSageBlue.selectedIndex = 0;		
 			break 
		}
	}


	
	if((document.thisform.optStandardSage.options[document.thisform.optStandardSage.selectedIndex].value = "none") && (document.thisform.optStandardPlusSageGreen.options[document.thisform.optStandardPlusSageGreen.selectedIndex].value = "none") && (document.thisform.optStandardPlusSageBlue.options[document.thisform.optStandardPlusSageBlue.selectedIndex].value = "none") && (document.thisform.optSecurityPayslip.options[document.thisform.optSecurityPayslip.selectedIndex].value = "none"))
	{
		if(document.thisform.txtP60Qty.options[document.thisform.txtP60Qty.selectedIndex].value != "none")
		{
			PayslipCost = (30 * document.thisform.txtP60Qty.options[document.thisform.txtP60Qty.selectedIndex].value); 
		}
	}

/*
	if((document.thisform.optStandardSage.selectedIndex != 4) && (document.thisform.optStandardPlusSageGreen.selectedIndex != 4) && (document.thisform.optStandardPlusSageBlue.selectedIndex != 4) && (document.thisform.optSecurityPayslip.selectedIndex != 4))
	{
		if(document.thisform.txtP60Qty.options[document.thisform.txtP60Qty.selectedIndex].value != "none")
		{
			PayslipCost = (30 * document.thisform.txtP60Qty.options[document.thisform.txtP60Qty.selectedIndex].value); 
		}
	}

*/
	//Standard Payslip
	switch (document.thisform.optStandardSage.selectedIndex)
	{
		case 1: 
		{ 	//1 (1 x £15)
			PayslipCost = PayslipCost + 15;
 			break 
		}
		case 2: 
		{ 	//2 (3 x £40)
			PayslipCost = PayslipCost + 40;
 			break 
		}
		case 3: 
		{ 	//3 (6 x £50)
			PayslipCost = PayslipCost + 50;
 			break 
		}
		case 4: 
		{ 	//4 (12 x £100 inc. p60)
			PayslipCost = PayslipCost + 100;
 			break 
		}
		default:
		{ 		//Empty
   				PayslipCost = PayslipCost + 0; 
 				break 
		}
	}


//Plus Green Payslip
	switch (document.thisform.optStandardPlusSageGreen.selectedIndex)
	{
		case 1: 
		{ 	//1 (1 x £15)
			PayslipCost = PayslipCost + 15;
 			break 
		}
		case 2: 
		{ 	//2 (3 x £40)
			PayslipCost = PayslipCost + 40;
 			break 
		}
		case 3: 
		{ 	//3 (5 x £50)
			PayslipCost = PayslipCost + 50;
 			break 
		}
		case 4: 
		{ 	//4 (10 x £100 inc. p60)
			PayslipCost = PayslipCost + 100;
 			break 
		}
		default:
		{ 		//Empty
   				PayslipCost = PayslipCost + 0; 
 				break 
		}
	}
	
	
//Plus Blue Payslip
	switch (document.thisform.optStandardPlusSageBlue.selectedIndex)
	{
		case 1: 
		{ 	//1 (1 x £15)
			PayslipCost = PayslipCost + 15;
 			break 
		}
		case 2: 
		{ 	//2 (3 x £40)
			PayslipCost = PayslipCost + 40;
 			break 
		}
		case 3: 
		{ 	//3 (5 x £50)
			PayslipCost = PayslipCost + 50;
 			break 
		}
		case 4: 
		{ 	//4 (10 x £100 inc. p60)
			PayslipCost = PayslipCost + 100;
 			break 
		}
		default:
		{ 		//Empty
   				PayslipCost = PayslipCost + 0; 
 				break 
		}
	}
	
	//Security Payslip
	switch (document.thisform.optSecurityPayslip.selectedIndex)
	{
		case 1: 
		{ 	//1 (1 x £15)
			PayslipCost = PayslipCost + 15;
 			break 
		}
		case 2: 
		{ 	//2 (3 x £40)
			PayslipCost = PayslipCost + 40;
 			break 
		}
		case 3: 
		{ 	//3 (5 x £50)
			PayslipCost = PayslipCost + 50;
 			break 
		}
		case 4: 
		{ 	//4 (10 x £100 inc. p60)
			PayslipCost = PayslipCost + 100;
 			break 
		}
		default:
		{ 		//Empty
   				PayslipCost = PayslipCost + 0; 
 				break 
		}
	}
	
//Guaranteed Delivery
if (document.thisform.GuaranteedDeliveryB49.checked == true)
{
	PayslipCost = PayslipCost + 13.75;        
}

if (document.thisform.GuaranteedDeliveryB412.checked == true)
{
	PayslipCost = PayslipCost + 8.75;        
}

if(document.thisform.FaxService.checked == true)
{
 PayslipCost = PayslipCost + 4.95;
}

if(document.thisform.EmailService.checked == true)
{
 PayslipCost = PayslipCost + 4.95;
}

//alert('payslips Cost = ' + PayslipCost.toFixed(2));
document.thisform.orderamount.value = PayslipCost.toFixed(2);
document.all("MyID1").innerText = PayslipCost.toFixed(2);
}

function popup(mylink, windowname)
{
	if (mylink=="")
	{ 
	return false;
	}else
	{
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	href=mylink;
	else
	href=mylink.href;
	window.open(href, windowname, 'width=700,height=500,scrollbars=yes,status=yes');
	return false;
	}
}

function popup(mylink, windowname, w, h)
{
 	w += 15;
        h += 15;

	if (mylink=="")
	{ 
	return false;
	}else
	{
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	href=mylink;
	else
	href=mylink.href;
	window.open(href, windowname, 'width='+w+',height='+h+',scrollbars=yes,status=yes');
	return false;
	}
}

function popupSageSecurity(mylink, windowname)
{
	if (mylink=="")
	{ 
	return false;
	}else
	{
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	href=mylink;
	else
	href=mylink.href;
	window.open(href, windowname, 'width=610,height=292,scrollbars=no,status=no');
	return false;
	}
}

function popupOrder(mylink, windowname)
{
	if (mylink=="")
	{ 
	return false;
	}else
	{
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	href=mylink;
	else
	href=mylink.href;
	window.open(href, windowname, 'width=600,height=500,scrollbars=yes,status=yes');
	return false;
	}
}

function popupPortP60(mylink, windowname)
{
	if (mylink=="")
	{ 
	return false;
	}else
	{
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	href=mylink;
	else
	href=mylink.href;
	window.open(href, windowname, 'width=420,height=635,scrollbars=no,status=no');
	return false;
	}
}
function popupLandP60(mylink, windowname)
{
	if (mylink=="")
	{ 
	return false;
	}else
	{
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	href=mylink;
	else
	href=mylink.href;
	window.open(href, windowname, 'width=810,height=600,scrollbars=no,status=no');
	return false;
	}
}

function popupStan(mylink, windowname)
{
	if (mylink=="")
	{ 
	return false;
	}else
	{
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	href=mylink;
	else
	href=mylink.href;
	window.open(href, windowname, 'width=625,height=288,scrollbars=no,status=no');
	return false;
	}
}

function popupStan43(mylink, windowname)
{
	if (mylink=="")
	{ 
	return false;
	}else
	{
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	href=mylink;
	else
	href=mylink.href;
	window.open(href, windowname, 'width=625,height=355,scrollbars=no,status=no');
	return false;
	}
}

function popupPlus(mylink, windowname)
{
	if (mylink=="")
	{ 
	return false;
	}else
	{
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	href=mylink;
	else
	href=mylink.href;
	window.open(href, windowname, 'width=620,height=400,scrollbars=no,status=no');
	return false;
	}
}

function popupPlusTT(mylink, windowname)
{
	if (mylink=="")
	{ 
	return false;
	}else
	{
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	href=mylink;
	else
	href=mylink.href;
	window.open(href, windowname, 'width=510,height=340,scrollbars=no,status=no');
	return false;
	}
}

function popupSecurity(mylink, windowname)
{
	if (mylink=="")
	{ 
	return false;
	}else
	{
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	href=mylink;
	else
	href=mylink.href;
	window.open(href, windowname, 'width=620,height=480,scrollbars=no,status=no');
	return false;
	}
}

function popupSecurity33(mylink, windowname)
{
	if (mylink=="")
	{ 
	return false;
	}else
	{
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	href=mylink;
	else
	href=mylink.href;
	window.open(href, windowname, 'width=620,height=420,scrollbars=no,status=no');
	return false;
	}
}

function popupSecurityIris(mylink, windowname)
{
	if (mylink=="")
	{ 
	return false;
	}else
	{
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	href=mylink;
	else
	href=mylink.href;
	window.open(href, windowname, 'width=510,height=360,scrollbars=no,status=no');
	return false;
	}
}

function popupSecurityLaser(mylink, windowname)
{
	if (mylink=="")
	{ 
	return false;
	}else
	{
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	href=mylink;
	else
	href=mylink.href;
	window.open(href, windowname, 'width=600,height=650,scrollbars=yes,status=no');
	return false;
	}
}

function popupSecurity43(mylink, windowname)
{
	if (mylink=="")
	{ 
	return false;
	}else
	{
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	href=mylink;
	else
	href=mylink.href;
	window.open(href, windowname, 'width=620,height=355,scrollbars=no,status=no');
	return false;
	}
}

function popupPrint(mylink, windowname)
{
	if (mylink=="")
	{ 
	return false;
	}else
	{
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	href=mylink;
	else
	href=mylink.href;
	window.open(href, windowname, 'width=650,height=500,scrollbars=yes,status=yes');
	return false;
	}
}


//show/hide order for Payslip/P60/both
var orderType;
function OrderTypeChanged(type)
{
	var rowPayslip=15;
	var rowP60=7;
	orderType = type;

	document.thisform.optStandardSage.selectedIndex = 0;
	document.thisform.optStandardPlusSageGreen.selectedIndex = 0;
	document.thisform.optStandardPlusSageBlue.selectedIndex = 0;
	document.thisform.optSecurityPayslip.selectedIndex = 0;

	document.thisform.txtP60Qty.selectedIndex = 0;

	calculatecost();

	switch (type){
		case "BOTH":
		{
			for(i =1; i<=rowPayslip; i++)
			{
				document.all["Payslip_"+ i].style.display="";
			}
			for(i =1; i<=rowP60; i++)
			{
				document.all["P60_"+ i].style.display="";
			}
			break;
		}
		case "PAYSLIP":
		{
			for(i =1; i<=rowPayslip; i++)
			{
				document.all["Payslip_"+ i].style.display="";
			}

			for(i =1; i<=rowP60; i++)
			{
				document.all["P60_"+ i].style.display="none";
			}

			break;
		}
		case "P60":{
			for(i =1; i<=rowP60; i++)
			{
				document.all["P60_"+ i].style.display="";
			}
			for(i =1; i<=rowPayslip; i++)
			{
				document.all["Payslip_"+ i].style.display="none";
			}

			break;
		}
	}
	return false;
}

