var screensize = window.screen.width

if(screensize < 800)
	{window.location.href="resolution.asp"}

var version = navigator.appVersion
var offset = ""
offset = version.indexOf("MSIE")
version = version.charAt(offset + 5)

//alert(navigator.appVersion)
var isNav, isIe

if(navigator.appName.indexOf("Netscape") != -1)
	{isNav = true}
else

if(navigator.appName.indexOf("Microsoft") != -1)
	{isIe = true}


	



function setBackground(thisOne,thisColour,textColour)

{
//alert(thisOne)
var obj

if (document.all)
		{
		
	//alert("IE")
		obj = document.all(thisOne).style.backgroundColor = thisColour
		
		obj = document.all("text"+thisOne).style.color = textColour
			
		}
		
	else if (document.getElementById)
		{
		//alert("netscapev6+")
		obj = document.getElementById(thisOne).style.backgroundColor = thisColour
		
		obj = document.getElementById("text"+thisOne).style.color = textColour
		}
		
	else if (document.layers)
		{
		//alert("netscapev4")
		obj = ""
		}
		
}



var finalWidth = ""
var screenRes = window.screen.width /2
var viewerScreen = window.screen.width
var leftAnchor = ""

function create(thisWidth,thisHeight,thisProduct)
{

//alert(thisPrinter)
if(viewerScreen > 800)
{
finalWidth = parseInt(thisWidth)
finalWidth = finalWidth + 50
finalHeight = parseInt(thisHeight)
finalHeight = finalHeight + 10
}

else

{
finalWidth = parseInt(thisWidth)
finalWidth = finalWidth + 40
finalHeight = parseInt(thisHeight)
finalHeight = finalHeight + 10
}





leftAnchor = screenRes - (finalWidth / 2)
//alert("status=no,toolbar=no,title=no,location=no,scrollbars=yes,resizable=yes,screenX=100,left=" + leftAnchor + ", top=0")
//alert(finalWidth)



var writeBody = ""
//thisProduct = "view_" + thisCategory + ".asp?id=" + thisProduct + "&voltage=" + thisVoltage + "&category=" + thisCategory
//alert(thisProduct)
var newWin = window.open("","","status=no,toolbar=no,title=no,location=no,scrollbars=yes,resizable=yes,screenX=100,left=" + leftAnchor + ", top=0")
//alert(newWin.value)
if(newWin!=null || newWin.closed)

	{
	newWin.window.resizeTo(finalWidth,finalHeight)
	newWin.location = thisProduct
	newWin.document.close()
	}
}

function display(thisWidth,thisHeight)
{
//alert(thisPrinter)
if(viewerScreen > 800)
{
finalWidth = parseInt(thisWidth)
finalWidth = finalWidth + 40
finalHeight = parseInt(thisHeight)
finalHeight = finalHeight + 10
}

else

{
finalWidth = parseInt(thisWidth)
finalWidth = finalWidth + 40
finalHeight = parseInt(thisHeight)
finalHeight = finalHeight + 10
}





leftAnchor = screenRes - (finalWidth / 2)
//alert("status=no,toolbar=no,title=no,location=no,scrollbars=yes,resizable=yes,screenX=100,left=" + leftAnchor + ", top=0")
//alert(finalWidth)



var writeBody = ""
thisProduct = "offline_order_form.asp"
//alert(thisProduct)
var newWin = window.open("","","status=no,toolbar=no,title=no,location=no,scrollbars=yes,resizable=yes,screenX=100,left=" + leftAnchor + ", top=0")
//alert(newWin.value)
if(newWin!=null || newWin.closed)

	{
	newWin.window.resizeTo(finalWidth,finalHeight)
	newWin.location = thisProduct
	newWin.document.close()
	}
}


// Title: Tigra Scroller
// Description: See the demo at url
// URL: http://www.softcomplex.com/products/tigra_scroller/
// Version: 1.4
// Date: 07-03-2003 (mm-dd-yyyy)
// Feedback: feedback@softcomplex.com (specify product title in the subject)
// Note: Permission given to use this script in ANY kind of applications if
//    header lines are left unchanged.
// About us: Our company provides offshore IT consulting services.
//     Contact us at sales@softcomplex.com if you have any programming task you
//     want to be handled by professionals.

// set correct path to Tigra Scroller files
var Tscroll_path_to_files = 'scroller/ts_files/'

// please, don't change anything below this line
function Tscroll_init (id) {
	document.write ('<iframe id="Tscr' + id + '" scrolling=no frameborder=no src="' + Tscroll_path_to_files + 'scroll.html?' + id + '" width="1" height="1"></iframe>');
}


function focusOnUser()
{
document.forms[0].bill_name.focus()
}

function focusOnLogin(field)
{
//alert(field)
document.forms[0][field].focus()
}


function goSend()
{
//alert("send")
document.forms[0].submit()

}

function addToFavorite(favTitle)
{

if ((navigator.appVersion.indexOf("MSIE") > 0) && (parseInt(navigator.appVersion) >= 4)) 

		{
		//alert(location.href)
		window.external.AddFavorite(location.href, unescape(favTitle));
		}
}




function verify(enquiry)
{

  if(enquiry.bill_name.value == "")
  {
    alert("Please enter the cardholder name.");
    enquiry.bill_name.focus();
	//enquiry.bill_name.bgcolor == #FFFFFF
	enquiry.bill_name.select();
    return (false);
  }
  
  
  if(enquiry.bill_addr_1.value == "")
  {
    alert("Please enter the first line of your address.");
    enquiry.bill_addr_1.focus();
	enquiry.bill_addr_1.select();
    return (false);
  }
  
  
      if(enquiry.bill_city.value == "")
  {
    alert("Please enter the town or city.");
    enquiry.bill_city.focus();
	enquiry.bill_city.select();
    return (false);
  }
  
        if(enquiry.bill_state.value == "")
  {
    alert("Please enter the county or state.");
    enquiry.bill_state.focus();
	enquiry.bill_state.select();
    return (false);
  }
  
        if(enquiry.bill_post_code.value == "")
  {
    alert("To ensure accurate delivery, we also require a postcode or zip code.");
    enquiry.bill_post_code.focus();
	enquiry.bill_post_code.select();
    return (false);
  }
  
       if(enquiry.bill_country.value == "")
  {
    alert("Please enter the country you live in.");
    enquiry.bill_country.focus();
	enquiry.bill_country.select();
    return (false);
  }
  
  	if(enquiry.postal_region.options[enquiry.postal_region.selectedIndex].value == "select")
	{
	alert("Please select your postal region.");
    enquiry.postal_region.focus();
    return (false);
	}
 
   if(enquiry.bill_email.value == "")
  {
    alert("Please enter an E-mail address to send your order confirmation to.");
    enquiry.bill_email.focus();
	enquiry.bill_email.select()
    return (false);
  }
  
 
 
 if(enquiry.bill_tel.value == "")
  {
    alert("Please enter a contact telephone number.");
    enquiry.bill_tel.focus();
	enquiry.bill_tel.select();
    return (false);
  }



  var checkOK = "0123456789-+()#{}[] \t\r\n\f";
  var checkStr = enquiry.bill_tel.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("This field accepts only digits and the characters  + - ( ) # { } [ ] ");
    enquiry.bill_tel.focus()
	enquiry.bill_tel.select()
    return (false);
  }

	

return (true);

}
 
function showThawte()
{

var screenRes = window.screen.width /2
var leftAnchor = ""
alert("here")
leftAnchor = screenRes - (200)

var newWin = window.open("https://www.thawte.com/cgi/server/certdetails.exe?code=GBSECP3-1","","status=yes,toolbar=no,title=yes,alwaysRaised=yes,location=no,scrollbars=yes,resizable=no,left=" + leftAnchor + ", top=0, width=530, height=400")

}
  

function mailingVerify(enquiry)
{

  if(enquiry.first_name.value == "")
  {
    alert("Please enter your first name.");
    enquiry.first_name.focus();
	enquiry.first_name.select();
    return (false);
  }
  
  
  if(enquiry.second_name.value == "")
  {
    alert("Please enter your surname.");
    enquiry.second_name.focus();
	enquiry.second_name.select();
    return (false);
  }
  
 
   if(enquiry.add_email.value == "")
  {
    alert("Please enter your E-mail address.");
    enquiry.add_email.focus();
	enquiry.add_email.select()
    return (false);
  }
  
  
if(enquiry.add_email_check.value == "")
  {
    alert("Please enter your E-mail address a 2nd time for a comparison.");
    enquiry.add_email_check.focus();
	enquiry.add_email_check.select();
    return (false);
  }
  

if(enquiry.add_email.value != enquiry.add_email_check.value)
	{alert("The E-mail address you have entered does not match\n the confirmation, please check them carefully!")
	
	enquiry.add_email_check.focus()
	enquiry.add_email_check.select()
	 return(false)
	 }

return (true);

}

function register(enquiry)
{


  if(enquiry.user_name.value == "")
  {
    alert("Please enter your eMail address.\nYour eMail address will be used for any order confirmation\nin addition to being your user name for accessing your account");
    enquiry.user_name.focus();
	enquiry.user_name.select();
    return (false);
  }
  
  if(enquiry.user_password.value == "")
  {
    alert("Choose a password between 8 and 12 characters in length.\nYour password should only contain alpha-numeric characters.");
    enquiry.user_password.focus();
	enquiry.user_password.select();
    return (false);
  }
  

  if(enquiry.contact_name.value == "")
  {
    alert("Please provide your own name.");
    enquiry.contact_name.focus();
	enquiry.contact_name.select();
    return (false);
  } 
 
  

return (true);

}
 

