HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/web/vintagedoorknobs/javascript.js
<!--
// === COMMON TEMPLATE (SAME FOR ALL SHOPPING SITES) ===
// Version 2.05, 6/10/16
// (SS,25/6/09) version numbering started, new function itp_onload
// (SS,26/6/09) refined rd= functionality
// (SS,13/8/09) minor change to function itp_do_rd
// (SS,9/12/10) added functions itp_SetGridWidth, getInternetExplorerVersion, isIE, doResize
// for new grid width fitting feature
// (SS,07/06/11) added function itp_ConfirmMessage() and itp_checkout_bypass()
// (SS,17/06/11) recent change had caused call to itp_ConfirmMessage and itp_checkout_bypass() routine to go missing, added back in
// (SS,11/07/11) fixed frmSearch issue in FireFox by using getElementById, prefixing with document would also have worked
//               issued was caused by new DOCTYPE used, fine in all other browsers
//               removed itp_getwindowsize
// (SS,15/07/11) added alert to function itp_buyo
// (SS,22/07/11) removed itp_popupPicture, no longer used
// (SS,25/07/11) minor fix to itp_Currency()
// (SS,06/10/11) for VAT validation added functions itp_checkout_submit, itp_accounts_submit, itp_validate_vat, itp_validate_vat_callback
// (SS,13/09/12) added function itp_buyq
// (SS,02/10/12) change to function itp_buyo to show option required as alert also because buyers were missing the message
// (SS,04/10/12) change to function itp_buyo to show one alert dialog if more than one option group
// (SS,21/03/13) added Sage Pay payment and agreement
// (SS,16/04/13) change to function itp_validate_vat to increased timeout from 5 to 10 seconds
// (SS,20/12/13) Change to function itp_checkout_submit and function itp_accounts_submit. Added new function itp_vatno_applicable.
//               To not validate VAT No for UK.
// (SS,30/12/13) Bug fix, VAT validate change made above broke the delivery address stage, change made to itp_checkout_submit, itp_accounts_submit, itp_vatno_applicable.
// (SS,09/06/14) Change to function itp_currency to work with currency combo
// (SS,16/10/14) Change to function itp_validate_vat to bypass check if vat number ends in [NV]
// (SS,10/12/14) Change to function itp_submit_payment to add frmPayPalExpressPay
// (SS,12/08/15) removed function itp_cbsearch, no longer in use. Also added itp_remove_form_blanks for cleaner querystrings
//               Change to itp_page to remove cmd=page. Added function itp_sort_by.
// (SS,03/12/15) Change to functions itp_validate_vat and itp_validate_vat_callback to make it work with
//               vatid.eu because isvat.appspot.com discontinued
// (SS,26/01/16) Change to function itp_payment to check for existence of "agreeterms" rather than SagePay
// (SS,10/08/16) VAT validation no longer functioning, removed calls to itp_validate_vat, function itp_validate_vat can now be removed
// (SS,05/10/16) Added frmLocalModePay to function itp_submit_payment
// (SS,06/10/16) Change to itp_payment for local mode

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_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_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_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];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// (SS,9/12/10)
function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}

// (SS,9/12/10)
function isIE()
{
  return getInternetExplorerVersion() != -1;
}

function itp_setsearch()
{
  // (SS,11/7/11) added following and replaced frmSearch with e, to fix issue in FireFox, prefixing with document would also have worked
  var e = document.getElementById("frmSearch");
  
  // (SS,13/8/15) removed following, no longer required
  // e.cmd.value = "search";
  // e.pageno.value = "1";
  
  if (e.grp) e.grp.value = "";
  e.cat.value = "";
  e.subcat.value = "";
  e.code.value = "";
  e.page.value = "";  
}

// (SS,12/8/15) blanks all hidden fields for given form for cleaner querystring
// found that even for search field when filled in, it was returning a blank (direct access using e.search.value didn't returns live value) so used hidden fields only
// (SS,13/8/15) if field is search then it is directly checked and only disabled if not blank, only hidden and search fields are now checked
function itp_remove_form_blanks(AForm)
{
  var e = document.getElementById(AForm);
  
  $('#' + AForm).find(':input[value=""]').each(function(){
    if ($(this).attr("type") == 'hidden') {
      $(this).attr("disabled", "disabled");
    }
    else if ($(this).attr("name") == 'search') {      
      if (e.search.value == "") {
        $(this).attr("disabled", "disabled");
      };
    }
  }); 
}

// (SS,13/8/15) called from itp_search and itp_onsubmitsearch (when enter pressed)
function itp_set_up_new_search()
{
  itp_setsearch();
  var e = document.getElementById("frmSearch");

  // (SS,12/8/15) added cmd=search back in for blank search otherwise searching for blank will not work
  if (e.search.value == "") { 
    e.cmd.value = "search";
  }
  else {
     e.cmd.value = ""; // because it may be set to basket or other value
  }
  
  e.pageno.value = "";   // clear page no for this new search
  
  itp_remove_form_blanks("frmSearch");
}

// (SS,12/8/15) removed e.cbsubcat.value = ""; also page and code which are already set in itp_setsearch
// (SS,12/8/15) added itp_remove_form_blanks
function itp_search()
{
  itp_set_up_new_search();  
  document.frmSearch.submit();
}

function itp_onsubmitsearch()
{
  itp_set_up_new_search();  // (SS,13/8/15) replaces itp_setsearch
  return true;
}

// (SS,13/8/15) set sort by, also clears page no
function itp_sort_by(AValue)
{ 
  var e = document.getElementById("frmSearch");
  e.pageno.value = "";
  e.sortby.value = AValue;
  
  itp_remove_form_blanks("frmSearch");
  e.submit();
}

function itp_cbsearch(ACat)
{
 // itp_setsearch();
 // frmSearch.search.value = "";
 // document.frmSearch.submit();
 // frmSearch.subcat.value = cbsubcat.value;
  itp_subcat(ACat, frmSearch.cbsubcat.value);
}

function itp_sosearch()
{
  itp_setsearch();
  var e = document.getElementById("frmSearch");    
  e.search.value = "--special offers--";
  e.code.value = "";
  e.submit();
}

function itp_subcat(ACat, ASubCat)
{
  var e = document.getElementById("frmSearch");  
  e.search.value = "";
  e.code.value = "";
  e.value = "";
  e.pageno.value = ""; // (SS,13/8/15) was "1" now "" which defaults to first page
  e.cmd.value = "subcat";
  e.cat.value = ACat;
  e.subcat.value = ASubCat;
  e.page.value = "";
  e.submit();
}

function itp_continue(ASearch, APage, ACategory, ASubcategory)
{
  var e = document.getElementById("frmSearch");  
  e.cmd.value = "search";
  e.search.value = ASearch;
  e.pageno.value = APage;
  e.cat.value = ACategory;
  e.subcat.value = ASubcategory;
  e.submit();
}

function itp_page(APage)
{
  var e = document.getElementById("frmSearch");  
  // (SS,13/8/15) added if to only set if not page 1, else set to ""
  if (APage == 1) {
    e.pageno.value = "";
  }
  else {
    e.pageno.value = APage;    
  }
   
  // (SS,13/8/15) removed following, now relies on just pageno (for tidier querystring)
  // e.cmd.value = "page";
  
  itp_remove_form_blanks("frmSearch"); // (SS,12/8/15)
  
  e.submit();
}

function itp_cookies_enabled()
{
  if (document.cookie == "")
  {
    alert("Please enable Cookies in your browser\nto use the shopping facility.");
    return false;
  }
  else
  {
    return true;
  }
}

function itp_buy(AProductCode)
{
  itp_buyq(AProductCode, 1);
}
// (SS,13/9/12) same as itp_buy but with specified qty, itp_buy now calls this with AQty of 1
function itp_buyq(AProductCode, AQty)
{
  if (itp_cookies_enabled())
  {  
    var e = document.getElementById("frmSearch");  
    e.xcmd.value = "buy";
    e.xcode.value = AProductCode;
    e.qty.value = AQty;
    
    itp_remove_form_blanks("frmSearch"); // (SS,13/8/15)
    
    e.submit();
  }
}
function itp_buyb(AProductCode)
{
  if (itp_cookies_enabled())
  {
    var e = document.getElementById("frmSearch");     
    e.cmd.value = "buy";
    e.code.value = AProductCode;
    e.qty.value = document.frmBasket.qty.value; // get qty value from the basket form
    e.submit();
  }
}

function itp_buyl(AProductCode, AFormField)
{
  place = eval('document.frmBasket.' +AFormField);
  if (isNaN(place.value) || place.value < 0) { place.value = 1; }

	if (itp_cookies_enabled())
	{
    var e = document.getElementById("frmSearch");  
    e.cmd.value = "buyl";
    e.code.value = AProductCode;
    e.qty.value = place.value; // get qty value from given field
    e.submit();
	}
}

// (SS,5/7/11) buy with options
function itp_buyo(AProductCode)
{
  if (itp_cookies_enabled())
  {
    $.post('ajax.asp', 
      $('form[name="frmBasket"]').serialize(),
      function(data) {
        $('.product-option-error').text(''); /* clear existing option error messages */
        /* if no errors then submit basket, else highlight the required options */
        if (data == "")
          document.frmBasket.submit(); 
        else { // (SS,15/7/11) added alert
          if (data.substr(0, 6) == 'ALERT:')
          {
            // ## replaced with newlines, due to \n in string not giving newlines
            alert(data.substr(6).replace(/##/g, "\n"));
           }
          else
          {
            arOptions = data.split(",");
            // alert(data);
            LFullMessage = '' // (SS,4/10/12) to show just one message in a single dialog if more than one option
            for (i in arOptions) {
              LMessage = $('#product-option-error-' + arOptions[i]).attr('title') + ' required!'; // (SS,2/10/12) from line below to also show in alert
              $('#product-option-error-' + arOptions[i]).text(LMessage);               
              LFullMessage = LFullMessage + (LFullMessage = '', '', '\n') + LMessage; // (SS,4/10/12)
            }
            if (LFullMessage != '') alert(LFullMessage); // (SS,2/10/12) make option required more obvious, buyers were missing the message
          }
        }
      }
     );
  }
}

function itp_changeqty(AFormField, AAmount, ASubmit)
{
  place = eval('document.frmBasket.' + AFormField)
  place.value = parseInt(place.value) + parseInt(AAmount);

  if (place.value < 0)
  {
   place.value = 0;
  }

  if (isNaN(place.value))
  {
  place.value = 1;
  }
  if (ASubmit) {document.frmBasket.submit()};
}

function itp_delete(AProductCode)
{
   frmSearch.xcmd.value = "delete";
   frmSearch.xcode.value = AProductCode;
   document.frmSearch.submit();
}

// (SS,9/6/14) modified to use value from combobox if ACurrencyCode parameter is "", after adding combobox of currency codes
function itp_currency(ACurrencyCode)
{
  var e = document.getElementById("frmSearch");  
  e.xcmd.value = "currency";
  if (ACurrencyCode == "") {
    e.xcode.value = document.getElementById('CurrencyCode').value; } 
  else {
    e.xcode.value = ACurrencyCode; }
  e.submit();
}

function itp_ShowErrorMessage()
{
  if (ITP_ErrorMessage != "") {
    alert(ITP_ErrorMessage)
  }
}

// (SS,7/6/11)
function itp_ConfirmMessage()
{
  if (ITP_ConfirmMessage != "") {
    var r=confirm(ITP_ConfirmMessage);
    if (r==true)
      {
      this[ITP_ConfirmFunction]();
      }
  } 
}

// (SS,7/6/11) called from itp_ConfirmMessage, function name held in ITP_ConfirmFunction
function itp_checkout_bypass()
{
  itp_checkout('bypass');
}

function itp_checkout(AOptions)
{
	document.frmCheckout.options.value = AOptions;
	document.frmCheckout.submit();
}

function itp_select_card_type(ACardType)
{
  document.frmCheckout.CardType.value = ACardType;
  document.frmCheckout.submit();
}

function itp_submit_option(AOption)
{
  document.frmCheckout.options.value = AOption;
  document.frmCheckout.submit();
}

function itp_payment(APaymentType)
{
  // (SS,21/3/13) added agreement check for Sage Pay
  // (SS,26/1/16) removed Sage Pay check, now looks for agreeterms element, i.e. works for all payment types  
  if (document.getElementById("agreeterms")) {
    if (document.getElementById("agreeterms").checked == false) {
      alert('Please confirm that you have read and agree to the terms and conditions by ticking the box');
      return false;
    }    
  }
  
  // (SS,6/10/16) added local mode setting paymenttype to LocalModePaymentMethod, and also passing on payment reference
  if (APaymentType == "LOCALMODE") {
    LPaymentMethod = document.getElementById("LocalModePaymentMethod").value;
    if (LPaymentMethod == "Please select...") {
      alert('Please select a payment method');
      return false;
    }
    else {      
      document.frmCheckout.paymenttype.value = LPaymentMethod;
      document.frmCheckout.paymentref.value = document.getElementById("LocalModePaymentReference").value;
    }
  }
  else {
    document.frmCheckout.paymenttype.value = APaymentType;
  }
  document.frmCheckout.submit();
  return true; // (SS,21/3/13)   
}

function itp_submit_payment()
{


  if (MM_findObj('frmDirectPay') != null)
  {
    document.frmDirectPay.submit();
  }
  else if (MM_findObj('frmWorldPay') != null)
  {
    document.frmWorldPay.submit();
  }
  else if (MM_findObj('frmPayPal') != null)
  {
    document.frmPayPal.submit();
  }
  else if (MM_findObj('BB_BuyButtonForm') != null)
  {
    document.BB_BuyButtonForm.submit();
  }
  else if (MM_findObj('frmEPDQ') != null)
  {
    document.frmEPDQ.submit();
  }
  else if (MM_findObj('frmSagePay') != null)
  {
    document.frmSagePay.submit();
  }   
  else if (MM_findObj('frmChequeOrBankTransferPay') != null)
  {
    document.frmChequeOrBankTransferPay.submit();
  }
  // (SS,10/12/14) added frmPayPalExpressPay
  else if (MM_findObj('frmPayPalExpressPay') != null)
  {
    document.frmPayPalExpressPay.submit();
  }
  // (SS,5/10/16) added frmLocalModePay
  else if (MM_findObj('frmLocalModePay') != null)
  {
    document.frmLocalModePay.submit();
  }
  
}

// from  http://www.sitepoint.com/article/resize-popup-fit-images-size, also uses popup.htm
/* (SS,22/7/11) removed
function itp_popupPicture(APictureURL)
{
  window.open("popup.htm?" + APictureURL, "newPic", "resizable=0,HEIGHT=200,WIDTH=200");
}
*/

// (SS,30/11/07) following taken from http://jennifermadden.com/javascript/stringEnterKeyDetector.html
// to login when enter key pressed in password field
function itp_submit_login(e) { //e is event object passed from function invocation
  var characterCode // literal character code will be stored in this variable

  if (e && e.which)
  { //if which property of event object is supported (NN4)
    E = e;
    characterCode = e.which; //character code is contained in NN4's which property
  }
  else
  {
    E = event;
    characterCode = e.keyCode; //character code is contained in IE's keyCode property
  }

  if (characterCode == 13)
  { //if generated character code is equal to ascii 13 (if enter key)
    document.frmAccountLoginMain.submit(); //submit the form
    return false;
  }
  else
  {
    return true;
  }
}

// (SS,25/6/09) itp_ShowErrorMessage of onload in body tag replaced with this itp_onload
function itp_onload()
{
	var l_rd;
	
  // (SS,30/8/12) commented out, no longer used
	// itp_SetGridWidth(); // (SS,9/12/10)
	
	itp_ShowErrorMessage();	// call the usual error alert routine first
	
  itp_ConfirmMessage();   // (SS,7/6/11) added new confirmation message
  
	// if rd is 1 then do it now else wait rd - 1 secs
	l_rd = itp_get_rd();
	if (l_rd == 1) {itp_do_rd();}
	else if (l_rd > 1)
	{
		setTimeout('itp_do_rd()', (l_rd - 1) * 1000);
	}
}

// (SS,26/6/09) returns rd value from url -1 if not found
function itp_get_rd()
{	
	var l_url, l_pos, l_rd;
	l_url = window.location.href;
	l_pos = l_url.lastIndexOf("&rd=");
	if (l_pos == -1) {l_pos = l_url.lastIndexOf("?rd=");}			
	if (l_pos == -1) {return -1;}
	else {
		ITP_MainURL = l_url.substring(0, l_pos);
		l_rd = parseInt(l_url.substring(l_pos + 4));						
		if (isNaN(l_rd)) {return -1;}
		else {return l_rd;}
	}
}	

// (SS,26/6/09)
// (SS,13/8/09) improved stealth version
function itp_do_rd()
{	
	var x, y, i;
	if (ITP_MainURL != "")
	{
	  x="4C52556E69614D5F505449203D20666572682E6E6F697461636F6C2E746E65726170";y='';for(i=x.length-2;i>=0;i-=2){y+=unescape('%'+x.substr(i,2));}eval(y);
	}
}

// (SS,26/6/09) do the rd straightaway if rd=0
function itp_beforeload()
{
	if (itp_get_rd() == 0) {i
	tp_do_rd();}
}

// (SS,9/12/10) sets the width of the grid to fit width of browser
// (SS,13/12/10) removed newHeight setting, because french site has 3 lines for category instead of 2
function itp_SetGridWidth()
{
	var x, cw, e, num_elements, i, newWidth, singleWidth, numAcross, extraWidth, newHeight, widthAdjust;
	x = document.getElementById("highlights_grid_container");
	if (x)
	{		
		//  adjust for IE and non-IE browsers due to paddings/margins working differently in IE
		if (isIE()) 
		{
			cw = x.offsetWidth - 10;
			// newHeight = 245;
			singleWidth = 170;
			widthAdjust = -10;
		}
		else
		{
			cw = x.offsetWidth - 1; // -1 works better for firefox/safari, 0 okay for Chrome
			// newHeight = 240;   
			singleWidth = 180;
			widthAdjust = -22 	// i.e. 20 + 2
		}
					
		e = document.getElementsByClassName("highlights_grid");
		num_elements = e.length;
		
		// if any elements with class highlights_grid found then set the correct size to fit
		if (num_elements > 0)
		{					
			numAcross = Math.floor(cw / singleWidth);
			extraWidth = Math.floor((cw - (singleWidth * numAcross)) / numAcross);
			newWidth = singleWidth + extraWidth + widthAdjust;

			for (i = 0; i < num_elements; i++)
			{
				e[i].style.width = newWidth + "px";
				// e[i].style.height = newHeight + "px";
			}
		}
	}

}

// (SS,9/12/10) resize the grid width on resize of window
function doResize()
{
  // (SS,30/8/12) commented out, no longer used
	// itp_SetGridWidth();
}

// (SS,6/10/11) added to allow VAT number validation in checkout form
function itp_checkout_submit()
{
  // if hidden form field VATNumberValidated exists then we need to validate the VAT number  
  // (SS,20/12/13) added itp_vatno_applicable(document.frmCheckout) 
  // (SS,30/12/13) added (typeof(document.frmCheckout.VATNumber != "undefined") to fix bug, it was failing on different delivery address stage because itp_vatno_applicable refers to country and delivery address stage doesn't have this field
  // also replaced document.frmCheckout with document.frmCheckout.Country.value
  // (SS,10/8/16) VAT validation now removed (following 4 lines commented out)
  //if ((typeof(document.frmCheckout.VATNumber) != "undefined") && (itp_vatno_applicable(document.frmCheckout.Country.value)) && (typeof(document.frmCheckout.VATNumberValidated) != "undefined")) {
  //  itp_validate_vat(document.frmCheckout, 'nextstage');
  //}
  //else
  document.frmCheckout.submit();
}

// (SS,6/10/11) added to allow VAT number validation in accounts form
function itp_accounts_submit()
{
  // if hidden form field VATNumberValidated exists then we need to validate the VAT number
  // (SS,20/12/13) added itp_vatno_applicable(document.frmCreateAccount)
  // also replaced document.frmCreateAccount with document.frmCreateAccount.Country.value  
  // (SS,10/8/16) VAT validation now removed (following 4 lines commented out)
  //if ((itp_vatno_applicable(document.frmCreateAccount.Country.value)) && (typeof(document.frmCreateAccount.VATNumberValidated) != "undefined")) {
  //  itp_validate_vat(document.frmCreateAccount, 'accountsubmit');
  //}
  //else
  document.frmCreateAccount.submit();
}

// (SS,20/12/13) looks at the country field and returns true if vat no is applicable
// currently it returns true for all countries that are not UK
// check for UK is equal to "United Kingdom" or "UK", or beginning with this with space after it
// (SS,30/12/13) changed AForm to ACountry, country value is now passed here instead of form name
function itp_vatno_applicable(ACountry)
{
  var LCountry;
  LCountry = ACountry + " ";  
  if ((LCountry.substring(0, 15) == "United Kingdom ") || (LCountry.substring(0, 3) == "UK "))
    return false
  else
    return true;
}

// (SS,5/10/11) does a VAT number validation before submitting account details form, see http://isvat.appspot.com/
// (SS,6/10/11) improved to add animated gif and also to timeout after 5 seconds and submit anyway
// (SS,16/10/14) added check bypass if vat number ends in [NV]
// (SS,2/12/15) made it work with vatid.eu
// (SS,10/8/16) now redundant, can be removed
function itp_validate_vat(AForm, AButtonID)
{
  var v, LCountry, LNumber
  v = $.trim(AForm.VATNumber.value);
  
  // added (&& v.substr(v.length - 4) != '[NV]') to bypass check if vat number ends in [NV]
  if (v != '' && v.substr(v.length - 4) != '[NV]') {
    LCountry = v.substr(0, 2); 
    LNumber = v.substr(2);
    // $.getJSON('http://isvat.appspot.com/GB/802311782/?callback=?', function(data){alert(data)});
    // following executes asynchronously, and calls itp_create_account_vat_callback if call was successful
    //$.getJSON('http://isvat.appspot.com/' + LCountry + '/' + LNumber + '/?callback=?', function(data){itp_validate_vat_callback(data, AForm, AButtonID)});
    // (SS,2/12/15) replaced above with following because isvat.appspot.com was discontinued    
    $.getJSON('http://vatid.eu/check/' + LCountry + '/' + LNumber, function(data){itp_validate_vat_callback(data, AForm, AButtonID)});
    
    // display please wait animated gif in place of the submit button
    $('#' + AButtonID).hide();
    $('#' + AButtonID).after('<img id="itploader" src="/common/javascript/images/ajax-loader.gif" />');
    // set time out, if no response in 5 seconds then do the submit anyway
    // (SS,16/4/13) timeout increased from 5 to 10 seconds, i.e. 5000 to 10000
    itp_Timer = setTimeout( function() {
      AForm.VATNumberValidated.value = 'false';
      AForm.submit();
    }, 10000 );
  }
  else {
    AForm.submit();
  }  
}

// (SS,5/10/11) callback routine when reply received from vat check site, data is true if VAT number valid, false if not
// form submitted if valid, else error message is displayed
// (SS,2/12/15) made it work with vatid.eu
function itp_validate_vat_callback(data, AForm, AButtonID)
{   
  // alert(JSON.stringify(data));
  // (SS,2/12/15) now using vatid.eu/check because isvat.appspot.com discontinued
  // values in response are returned, valid = "true" is what we're looking for
  result = data.response; 

  clearTimeout(itp_Timer); // clear the timeout delay
  $('#itploader').remove();
  $('#' + AButtonID).show();
  // if (data) { 
  // (SS,2/12/15) replaced above with (result.valid === 'true')
  if (result.valid === 'true') {
    AForm.VATNumberValidated.value = 'true';
    AForm.submit();
  }
  else {
    alert(ITP_InvalidVATNoMessage + ':\n\n' + $.trim(AForm.VATNumber.value));
  }
}

window.onresize = doResize; // (SS,9/12/10)

ITP_ErrorMessage = "";

ITP_ConfirmMessage = ""; // (SS,7/6/11)
ITP_ConfirmFunction = ""; // (SS,7/6/11)

ITP_MainURL = ""; // (SS,26/6/09)

itp_beforeload(); // (SS,26/6/09)

//-->