var message="";

<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
	
function notYet()
{
	alert("Sorry this item is not available yet")
}

function goTo(pg)
{
	document.location.href=pg;
}

function newWindow(pg)
{
	window.open(pg);
}

function closeIt()
{
	window.close();
}

function noPermission()
{
	alert("Please sign in on the main screen");
}

function goMap()
{
	GP_AdvOpenWindow('map.html','map','fullscreen=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no',800,530,'center','ignoreLink','',0,'');
}

function GP_AdvOpenWindow(theURL,winName,features,popWidth,popHeight,winAlign,ignorelink,alwaysOnTop,autoCloseTime,borderless) { //v2.0
  var leftPos=0,topPos=0,autoCloseTimeoutHandle, ontopIntervalHandle, w = 480, h = 340;  
  if (popWidth > 0) features += (features.length > 0 ? ',' : '') + 'width=' + popWidth;
  if (popHeight > 0) features += (features.length > 0 ? ',' : '') + 'height=' + popHeight;
  if (winAlign && winAlign != "" && popWidth > 0 && popHeight > 0) {
    if (document.all || document.layers || document.getElementById) {w = screen.availWidth; h = screen.availHeight;}
		if (winAlign.indexOf("center") != -1) {topPos = (h-popHeight)/2;leftPos = (w-popWidth)/2;}
		if (winAlign.indexOf("bottom") != -1) topPos = h-popHeight; if (winAlign.indexOf("right") != -1) leftPos = w-popWidth; 
		if (winAlign.indexOf("left") != -1) leftPos = 0; if (winAlign.indexOf("top") != -1) topPos = 0; 						
    features += (features.length > 0 ? ',' : '') + 'top=' + topPos+',left='+leftPos;}
  if (document.all && borderless && borderless != "" && features.indexOf("fullscreen") != -1) features+=",fullscreen=1";
  if (window["popupWindow"] == null) window["popupWindow"] = new Array();
  var wp = popupWindow.length;
  popupWindow[wp] = window.open(theURL,winName,features);
  if (popupWindow[wp].opener == null) popupWindow[wp].opener = self;  
  if (document.all || document.layers || document.getElementById) {
    if (borderless && borderless != "") {popupWindow[wp].resizeTo(popWidth,popHeight); popupWindow[wp].moveTo(leftPos, topPos);}
    if (alwaysOnTop && alwaysOnTop != "") {
    	ontopIntervalHandle = popupWindow[wp].setInterval("window.focus();", 50);
    	popupWindow[wp].document.body.onload = function() {window.setInterval("window.focus();", 50);}; }
    if (autoCloseTime && autoCloseTime > 0) {
    	popupWindow[wp].document.body.onbeforeunload = function() {
  			if (autoCloseTimeoutHandle) window.clearInterval(autoCloseTimeoutHandle);
    		window.onbeforeunload = null;	}  
   		autoCloseTimeoutHandle = window.setTimeout("popupWindow["+wp+"].close()", autoCloseTime * 1000); }
  	window.onbeforeunload = function() {for (var i=0;i<popupWindow.length;i++) popupWindow[i].close();}; }   
  document.MM_returnValue = (ignorelink && ignorelink != "") ? false : true;
}


function checkEmailValid(emailStr,msg)
{
	var emailPat=/^(.+)@(.+)$/
	var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
	var validChars="\[^\\s" + specialChars + "\]"
	var quotedUser="(\"[^\"]*\")"
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
	var atom=validChars + '+'
	var word="(" + atom + "|" + quotedUser + ")"
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
	var errMsg="";   
	var matchArray=emailStr.match(emailPat)

	if (matchArray==null) 
	{
	   errMsg=errMsg+msg+" Email Address seems incorrect";
	   return errMsg;
	}
	else
	{
	  var user=matchArray[1]
	  var domain=matchArray[2]
	  if (user.match(userPat)==null) 
	  {
		errMsg=errMsg+msg+" Email Address seems incorrect";
		return errMsg;       
	  }
	  var IPArray=domain.match(ipDomainPat)
	  if (IPArray!=null) 
	  {
		  for (var i=1;i<=4;i++) 
			  {
			if (IPArray[i]>255) 
				{
				errMsg=errMsg+msg+" Email Address seems incorrect";
				return errMsg;
				}//IF
			  }//for
	   }//IP Array
	   var domainArray=domain.match(domainPat)
	   if (domainArray==null) 
	   {
		 errMsg=errMsg+msg+" Email Address seems incorrect";
		 return errMsg;
	   }
	   var atomPat=new RegExp(atom,"g")
	   var domArr=domain.match(atomPat)
	   var len=domArr.length
	   if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3) 
	   {
		 errMsg=errMsg+msg+" Email Address seems incorrect";
		 return errMsg;	
	   } 
	   if (len<2) 
	   {
		 errMsg=errMsg+msg+" Email Address seems incorrect";
		 return errMsg;	 
	   } 
	 }//End  Match
	return "0";
}

function checkDataEntry(obj)
{
	var mycode
	var count=0;
	if(obj.length!=0)
	{
		for(i=0; i<obj.length; i++)
		{
			mycode = obj.charCodeAt(i);
			if((mycode>47 && mycode<58) || (mycode>64 && mycode<91) || (mycode>96 && mycode<123) || (mycode>3584 && mycode<3631) || (mycode>3647 && mycode<3653))
			{
				count=count+1;
			}
		}
	}
	return count;
}

function goHome()
{
	document.location.href='/';
}

function tellButton(cid,tid)
{
	GP_AdvOpenWindow('/emailfriend.asp?POS='+cid+'&STK='+tid,'ifriend','fullscreen=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no',500,600,'center','ignoreLink','',0,'');
}

function checkEmailFriend()
{
	if(checkDataEntry(document.frmData.strFriendName.value)==0)
	{
		alert("Please enter your Friend's Name");
		return false;
	}
	if(checkDataEntry(document.frmData.strFriendEmail.value)==0)
	{
		alert("Please enter your Friend's Email Address");
		return false;
	}
	if(checkDataEntry(document.frmData.strFriendEmail.value)!=0)
	{
		var e=document.frmData.strFriendEmail.value;
		if (checkEmailValid(e)!="0") 
		{
			alert(checkEmailValid(e,'Your Friend'));
			return false;	
		}
	}

	if(checkDataEntry(document.frmData.strYourName.value)==0)
	{
		alert("Please enter your Name");
		return false;
	}
	if(checkDataEntry(document.frmData.strEmail.value)==0)
	{
		alert("Please enter your  Email Address");
		return false;
	}
	if(checkDataEntry(document.frmData.strEmail.value)!=0)
	{
		var e=document.frmData.strEmail.value;
		if (checkEmailValid(e)!="0") 
		{
			alert(checkEmailValid(e,'Your'));
			return false;	
		}
	}

	return true;
}

function eServicesButton()
{
	var e=document.frmData.strESEmail.value;
	var pwd=document.frmData.strESPassword.value;

	if(checkDataEntry(e)==0)
	{
		alert("Please enter your Email Address");
		return false;
	}
	else
	{
		if (checkEmailValid(e)!="0") 
		{
			alert(checkEmailValid(e,'Your'));
			return false;	
		}
	}
	if(checkDataEntry(pwd)==0)
	{
		alert("Please enter your Password");
		return false;
	}

	var sector=document.getElementById('eServicesBox') 
	sector.innerHTML="<div class='boxsubheading centered'>Processing...<div class='blank'>&nbsp;</div><img src='images/ajax-loader.gif' /></div><div id='spacer11'></div>"
	var doc = null; 
 
	// Make a new XMLHttp object
 if (typeof window.ActiveXObject != 'undefined' ) 
   { 
       doc = new ActiveXObject("Microsoft.XMLHTTP"); 
   } 
   else 
   { 
       doc = new XMLHttpRequest(); 
    //doc.setRequestHeader 'Content-Type', 'text/xml';
   } 
	doc.onreadystatechange = handleStateChange;  
	  
	// Load the result from the response page
	// Note the response page can be any page that returns the right result. 
	// I used ASP. PHP, PERL... etc could acheive the same result
	 
	// ** As far a I know firefox will only load a document on the SAME domain!!
	//doc.setRequestHeader "Content-Type", "text/xml"
	doc.open("GET", "processeservices.asp?e="+e+"&pwd="+pwd, true);
	doc.send(null);
	//destination.innerHTML = doc.responseText;

	function handleStateChange()
	{        
		if (doc.readyState == 4)
		{
			var pos=doc.responseText.indexOf(".asp?");
			if(pos>0)
			{
				document.location.href=doc.responseText;
			}
			else
			{
				sector.innerHTML = doc.responseText;
			}
		}
	}
}
function checkESSubscriber()
{
	var e=document.frmData.strESEmail.value;
	if(checkDataEntry(document.frmData.strContactName.value)==0)
	{
		alert("Please enter your Contact Name");
		return false;
	}
	if(checkDataEntry(e)==0)
	{
		alert("Please enter your Email Address");
		return false;
	}
	if(checkDataEntry(e)!=0)
	{
		if (checkEmailValid(e)!="0") 
		{
			alert(checkEmailValid(e,'Your'));
			return false;	
		}
	}
	if(checkDataEntry(document.frmData.strESPassword.value)==0)
	{
		alert("Please enter your Password");
	   return false;
	}
	if(checkDataEntry(document.frmData.strConfPassword.value)==0)
	{
		alert("Please enter the Confirm Password");
	   return false;
	}
	if (document.frmData.strESPassword.value!=document.frmData.strConfPassword.value)
	{
	   alert("The Password and Confirm Password do not match");
	   return false;
	}
	return true;
}

function checkServiceChkLst()
{ 
	var c=document.frmData.chkCategory;	
	var valid=false;
	for(i=0;i<c.length;++i)
	{
		if(c[i].checked)
		{
			valid=true;
		}
	}
	if(c.checked)
	{
		valid=true;
	}
	if ((valid==false) && (document.frmData.chkNewsletter.checked==false))
	{
		alert("Please select at least one item");
		return false;
	}	
	return true;	
}

function checkChangEmail()
{
	if(checkDataEntry(document.frmData.strSerEmail.value)==0)
	{
		alert("Please enter an Email Address");
		return false;
	}
	if(checkDataEntry(document.frmData.strSerEmail.value)!=0)
	{
		var e=document.frmData.strSerEmail.value;
		if (checkEmailValid(e)!="0") 
		{
			alert(checkEmailValid(e,'The'));
			return false;	
		}
	}
	return true;
}

function contactButton()
	{
	var cName=document.frmData.strContactName.value;
	var e=document.frmData.strEmail.value;
	var msg=document.frmData.strMessage.value;
/*	var cpName=document.frmData.strCompanyBox.value;
	var url=document.frmData.strUrlBox.value;*/
	if(checkDataEntry(cName)==0)
	{
		alert("Please enter your Contact Name");
		return false;
	}
	if(checkDataEntry(e)==0)
	{
		alert("Please enter your Email Address");
		return false;
	}
	else
	{
		if (checkEmailValid(e)!="0") 
		{
			alert(checkEmailValid(e,'Your'));
			return false;	
		}
	}
	if(checkDataEntry(msg)==0)
	{
		alert("Please enter your Message");
		return false;
	}
	else
	{
		var txt="";
		var myChar="";
		var myCode="";
		for(i=0; i<msg.length; i++)
		{
			myChar=msg.substr(i,1)
			myCode = msg.charCodeAt(i);
			if(myCode==10)
			{
				txt=txt+"<br />";
			}
			else
			{
				txt=txt+myChar;
			}
		}
	}

	var sector=document.getElementById('contactBox') 
	sector.innerHTML="<div id='spacer'></div><span class='boxsubheading'>Processing...</span><div class='blank'>&nbsp;</div><img src='images/ajax-loader.gif' />"
	var doc = null; 
 
	// Make a new XMLHttp object
 if (typeof window.ActiveXObject != 'undefined' ) 
   { 
       doc = new ActiveXObject("Microsoft.XMLHTTP"); 
   } 
   else 
   { 
       doc = new XMLHttpRequest(); 
    //doc.setRequestHeader 'Content-Type', 'text/xml';
   } 
	doc.onreadystatechange = handleStateChange;  
	  
	// Load the result from the response page
	// Note the response page can be any page that returns the right result. 
	// I used ASP. PHP, PERL... etc could acheive the same result
	 
	// ** As far a I know firefox will only load a document on the SAME domain!!
	//doc.setRequestHeader "Content-Type", "text/xml"
	doc.open("GET", "processcontact.asp?cn="+cName+"&e="+e+"&msg="+txt, true);
	doc.send(null);
	//destination.innerHTML = doc.responseText;
	
	function handleStateChange()
	{        
		if (doc.readyState == 4)
		{
			sector.innerHTML = doc.responseText;
		}
	}
}

function getProduct()
{
	var psearch=document.getElementById('strSearch');
	var nsearch=psearch.value
	
	if(nsearch.length==0)
		{
		alert("Please enter a product code")
	return false;
		}
	if (isNaN(nsearch))
		{
			alert("Please check the product code");
			return false;
		}
	var doc = null; 
 
	// Make a new XMLHttp object
	 if (typeof window.ActiveXObject != 'undefined' ) 
	   { 
		   doc = new ActiveXObject("Microsoft.XMLHTTP"); 
	   } 
	   else 
	   { 
		   doc = new XMLHttpRequest(); 
		//doc.setRequestHeader 'Content-Type', 'text/xml';
	   } 
		doc.onreadystatechange = handleStateChange;  
	  
		// Load the result from the response page
		// Note the response page can be any page that returns the right result. 
		// I used ASP. PHP, PERL... etc could acheive the same result
		 
		// ** As far a I know firefox will only load a document on the SAME domain!!
		//doc.setRequestHeader "Content-Type", "text/xml"
		doc.open("GET", "/processcode.asp?pc="+nsearch, true);
		doc.send(null);
		//destination.innerHTML = doc.responseText;
		
		function handleStateChange()
		{        
			if (doc.readyState == 4)
			{
				/*
				What we do next depends on whether the result is SUCCESS or ERROR
				
				If the result responseText contains ERROR: pass all chars to the right of :
				to an alert box.
				
				If the responseText contains SUCCESS: all chars to the right of : forms a link for redirection
				*/
				var ret
				var resp = doc.responseText;
				var respAdjusted
				ret=resp.indexOf("ERROR:");
				if (ret==-1)
				{
					ret=resp.indexOf(":");
					respAdjusted=resp.substr(ret+1,(resp.length-ret));
					document.location.href=respAdjusted
					
				}
				else
				{
					ret=resp.indexOf(":");
					respAdjusted=resp.substr(ret+1,(resp.length-ret));
					alert(respAdjusted);
					
				}
			}	 
		}
}

function checkRegister()
{
	if(checkDataEntry(document.frmData.strContactName.value)==0)
	{
		alert("Please enter your Contact Name");
		return false;
	}
	var e=document.frmData.strCEmail.value;
	if(checkDataEntry(e)==0)
	{
		alert("Please enter your Email Address");
		return false;
	}
	else
	{
		if (checkEmailValid(e)!="0") 
		{
			alert(checkEmailValid(e,'Your'));
			return false;	
		}
	}
	if(checkDataEntry(document.frmData.strCTelephone.value)==0)
	{
		alert("Please enter your Telephone Number");
		return false;
	}
	if(checkDataEntry(document.frmData.strCPassword.value)==0)
	{
		alert("Please enter your Password");
		return false;
	}
	if(checkDataEntry(document.frmData.strCConfirmPwd.value)==0)
	{
		alert("Please enter the Confirm Password");
		return false;
	}
	if (document.frmData.strCPassword.value!=document.frmData.strCConfirmPwd.value)
	{
		alert("The Password and Confirm Password do not match");
	   	return false;
	}
	return true;
}

function checkCustomerSignIn()
{
	var e=document.frmData.strSingInEmail.value;
	var pwd=document.frmData.strSingInPassword.value;

	if(checkDataEntry(e)==0)
	{
		alert("Please enter your Email Address");
		return false;
	}
	else
	{
		if (checkEmailValid(e)!="0") 
		{
			alert(checkEmailValid(e,'Your'));
			return false;	
		}
	}
	if(checkDataEntry(pwd)==0)
	{
		alert("Please enter your Password");
		return false;
	}
	return true;
}

function checkShippingAddress()
{
	if(checkDataEntry(document.frmData.strName.value)==0)
	{
		alert("Please enter the Address Name");
		return false;
	}
	if(checkDataEntry(document.frmData.strCAddress.value)==0)
	{
		alert("Please enter the Address");
		return false;
	}
	if(document.frmData.strCAddress.value.length>512)
	{
		alert("The maximum characters of the Address is 512");
		return false;
	}
	if(checkDataEntry(document.frmData.strCity.value)==0)
	{
		alert("Please enter the City");
		return false;
	}
	if(document.frmData.lngCountryId.value=="0")
	{
		alert("Please enter a Country");
		return false;
	}
	if(checkDataEntry(document.frmData.strPostcode.value)==0)
	{
		alert("Please enter the Zip/Postcode");
		return false;
	}
	if(document.frmData.chkDrop.checked==true)
	{
		if(checkDataEntry(document.frmData.strRecipientName.value)==0)
		{
			alert("Please enter the Recipient Name");
			return false;
		}
	}
	return true;
}

function checkForgotPwd()
{
	var e=document.frmData.strEmail.value;
	if(checkDataEntry(e)==0)
	{
		alert("Please enter your Email Address");
		return false;
	}
	else
	{
		if (checkEmailValid(e)!="0") 
		{
			alert(checkEmailValid(e,'The'));
			return false;	
		}
	}
	return true;
}

function checkFreeDraw()
{
	if(checkDataEntry(document.frmData.strContactName.value)==0)
	{
		alert("Please enter your Contact Name");
		return false;
	}
	var e=document.frmData.strCEmail.value;
	if(checkDataEntry(e)==0)
	{
		alert("Please enter your Email Address");
		return false;
	}
	else
	{
		if (checkEmailValid(e)!="0") 
		{
			alert(checkEmailValid(e,'Your'));
			return false;	
		}
	}
	return true;
}

function reSendESEmail(id)
{
	document.location.href="esemail.asp?id="+id;
}
function removetext1()
{
document.getElementById("textfield2").value='';
}
function addButtonRegister()
{
	document.location.href="cregister.asp";
}
function Back2Cart()
{
	document.location.href="cart.asp";
}
function updateButton()
{
	var cn=document.frmData.strContactName.value;
	var e=document.frmData.strEmail.value;
	var pwd=document.frmData.strMyPassword.value;
	var cpwd=document.frmData.strConfirmPwd.value;
	var t=document.frmData.strTelephone.value;

	if(checkDataEntry(cn)==0)
	{
		alert("Please enter your Contact Name");
		return false;
	}
	if(checkDataEntry(e)==0)
	{
		alert("Please enter your Email Address");
		return false;
	}
	else
	{
		if (checkEmailValid(e)!="0") 
		{
			alert(checkEmailValid(e,'Your'));
			return false;	
		}
	}
	if(checkDataEntry(t)==0)
	{
		alert("Please enter your Telephone Number");
		return false;
	}
	if(checkDataEntry(pwd)==0)
	{
		alert("Please enter your Password");
		return false;
	}
	if(checkDataEntry(cpwd)==0)
	{
		alert("Please enter the Confirmation Password");
		return false;
	}
	if (pwd!=cpwd)
	{
		alert("The Password and Confirmation Password do not match");
	   	return false;
	}
	
	var place = document.getElementById('personalArea') 
	place.innerHTML="<div id='spacer'></div><span class='boxsubheading'>Data Updating...</span><div class='blank'>&nbsp;</div><img src='images/ajax-loader.gif'>"
	var doc = null; 
	
	// Make a new XMLHttp object
	if (typeof window.ActiveXObject != 'undefined' ) 
	{ 
	   doc = new ActiveXObject("Microsoft.XMLHTTP"); 
	} 
	else 
	{ 
	   doc = new XMLHttpRequest(); 
	//doc.setRequestHeader 'Content-Type', 'text/xml';
	} 
	doc.onreadystatechange = handleStateChange;  
	  
	// Load the result from the response page
	// Note the response page can be any page that returns the right result. 
	// I used ASP. PHP, PERL... etc could acheive the same result
	 
	// ** As far a I know firefox will only load a document on the SAME domain!!
	//doc.setRequestHeader "Content-Type", "text/xml"
	doc.open("GET", "processmydetails.asp?cn="+cn+"&e="+e+"&pwd="+pwd+"&t="+t, true);
	doc.send(null);
	//destination.innerHTML = doc.responseText;
	
	function handleStateChange()
	{        
		if (doc.readyState == 4)
		{
			place.innerHTML = doc.responseText;
		}
	}
}
function addButton()
{
	document.location.href="addshippingaddress.asp?frm=acct";
}

function removeButton()
{
	var cid=document.frmAddress.lngCustomerId.value;
	var ctrl=document.frmAddress.lngAddressId;
	var i=0;
	var id=0;
	var txt="";
	
	for(i=0; i < ctrl.options.length; i++)
	{
		if (ctrl.options[i].selected)
		{
			id = ctrl.options[i].value;
			txt = ctrl.options[i].text;
		}
	}

	if(id==0)
	{
		alert("Please select a Shipping Address from the list!")
		return false;
	}
	else
	{
		if(confirm("Are you sure you want to delete the Shipping Addreaa: " + txt + "?"))
		{
			id=id.substr(1,id.length);
		}
		else
		{
			return false;
		}
	}

	var sector=document.getElementById('addressArea') 
	sector.innerHTML="<div align='center' class='boxsubheading'>Removing...<div class='blank'>&nbsp;</div><img src='images/ajax-loader.gif' /></div>"
	var doc = null; 
 
	// Make a new XMLHttp object
	 if (typeof window.ActiveXObject != 'undefined' ) 
   { 
       doc = new ActiveXObject("Microsoft.XMLHTTP"); 
   } 
   else 
   { 
       doc = new XMLHttpRequest(); 
    //doc.setRequestHeader 'Content-Type', 'text/xml';
   } 
	doc.onreadystatechange = handleStateChange;  
	  
	// Load the result from the response page
	// Note the response page can be any page that returns the right result. 
	// I used ASP. PHP, PERL... etc could acheive the same result
	 
	// ** As far a I know firefox will only load a document on the SAME domain!!
	//doc.setRequestHeader "Content-Type", "text/xml"
	doc.open("GET", "delshippingaddress.asp?cid="+cid+"&aid="+id, true);
	doc.send(null);
	//destination.innerHTML = doc.responseText;
	
	function handleStateChange()
	{        
		if (doc.readyState == 4)
		{
			sector.innerHTML = doc.responseText;
			var pos=doc.responseText.indexOf("|in used|")
			{
				if(pos>0)
				{
					alert("Sorry, unable to remove the selected shipping address as it has been used for your previous orders.")
				}
			}
		}
	}
}

function editButton()
{
	var ctrl=document.frmAddress.lngAddressId;
	var i=0;
	var id=0;
	
	for(i=0; i < ctrl.options.length; i++)
	{
		if (ctrl.options[i].selected)
		{
			id = ctrl.options[i].value;
		}
	}

	if(id==0)
	{
		alert("Please select a Shipping Address from the list!");
		return false;
	}
	else
	{
		id=id.substr(1,id.length);
		document.location.href="editshippingaddress.asp?frm=acct&aid="+id;
	}
}

function viewButton()
{
	var ctrl=document.frmAddress.lngAddressId;
	var i=0;
	var id=0;
	
	for(i=0; i < ctrl.options.length; i++)
	{
		if (ctrl.options[i].selected)
		{
			id = ctrl.options[i].value;
		}
	}

	if(id==0)
	{
		alert("Please select a Shipping Address from the list!");
		return false;
	}
	else
	{
		id=id.substr(1,id.length);
		GP_AdvOpenWindow('viewshippingaddress.asp?aid='+id,'view','fullscreen=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no',400,300,'center','ignoreLink','',0,'');
	}
}

function setButton()
{
	var txt=document.frmAddress.lngAddressId.options[document.frmAddress.lngAddressId.selectedIndex].value;
	var cs=txt.substr(0,1);
	var id=txt.substr(1,txt.length);

	if(cs=="e")
	{
		document.getElementById("buttonArea").innerHTML="<input name='btnEdit' type='button' value=' EDIT ' class='button' title=' edit the selected address ' onClick='editButton()' />";
	}
	else
	{
		document.getElementById("buttonArea").innerHTML="<input name='btnView' type='button' value=' VIEW ' class='button' title=' view the selected address ' onClick='viewButton()' />";
	}
}
function cancelButton()
{
	var frm=document.frmData.strPageFrom.value;
	if(frm.length>0)
	{
		document.location.href="myaccount.asp";
	}
	else
	{
		document.location.href="shippingaddress.asp";
	}
}

function setBox(obj)
{
	if(obj.checked==true)
	{
		document.frmData.strRecipientName.disabled="";
		document.frmData.strRecipientName.className="box";
	}
	else
	{
		document.frmData.strRecipientName.disabled="disabled";
		document.frmData.strRecipientName.className="graybox";
	}
}