function writeEMail(pLinkText, pSubject)
{
var v2="ASYCI4YWADQPRI2584WKKXS";
var v7=unescape("%29653-Q*%3C%0100%225%2CFSWA%25e%287%3E");
 var v5=v2.length;var v1="";
 for(var v4=0;v4<v5;v4++)
 {
  v1+=String.fromCharCode(v2.charCodeAt(v4)^v7.charCodeAt(v4));
 }
document.write('<a href="javascript:void(0)" onclick="window.location=\'mail\u0074o\u003a'+v1+'?subject='+escape(pSubject)+'\'">'+pLinkText+'</a>');
}
function printable(){
	if(!window.print){
		alert("You need NS4.x to use this print button!");
		return;
	}
	window.print();
}

function contact(){
	var survWindow = window.open("http://www.targetfour.com/t4/contact/contact.html", "DemoWindow", "toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0, width=300, height=350");
}

function contactePatient(){
	var survWindow = window.location("http://www.epatient.co.uk/contact/contact.html");
}

function calculate(){
	var survWindow = window.open("../../calculate/index.htm", "DemoWindow", "toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0, width=380, height=280");
}
/*
function acrobat(){
	var survWindow = window.open("http://www.targetfour.com/dc/download/acrobat.html", DemoWindow", "toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0, width=300, height=135");
}
*/

function Redirect(){
	window.location.href = document.frmRedirect.lstCountries.options[document.frmRedirect.lstCountries.selectedIndex].value;
}

function PopUp(sURL, iWidth, iHeight){
	var sProps;
	sProps = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=" + iWidth + "height=" + iHeight;
	var oWin = window.open(sURL, "PopUpWindow", sProps);
}


// Script to swap images used as buttons with an up or down state on a mouse rollover
// Expects two images with the naming convention "xxxUP.jpg" and "xxxDOWN.jpg" - whichever is being displayed is swapped out for its replacement
// Any errors that occur just result in the original image being displayed
function UpDownImage(oImage, sImgLoc){
	var sImgSrc = new String;
	var sImgNew = new String;
	sImgSrc = oImage.src;
	try{
		if (sImgSrc.substr(sImgSrc.length -6, 6).toUpperCase() == 'UP.JPG'){
			sImgNew = sImgSrc.substr(0, sImgSrc.length -6) + 'DOWN.jpg';
		}
		else{
			sImgNew = sImgSrc.substr(0, sImgSrc.length -8) + 'UP.jpg';
		}
		oImage.src = sImgNew;
	}
	catch(er){
		// On error, just display the original image
		oImage.src = sImgSrc;
	}
}

// Script to swap images used as buttons with an up or down state on a mouse rollover
// Expects two images with the naming convention "xxxUP.jpg" and "xxxDOWN.jpg" - whichever is being displayed is swapped out for its replacement
// Any errors that occur just result in the original image being displayed
function UpDowneSuiteImage(oImage, sImgLoc){
	var sImgSrc = new String;
	var sImgNew = new String;
	sImgSrc = oImage.src;
	try{
		if (sImgSrc.substr(sImgSrc.length -14, 14).toUpperCase() == 'ESUITELOGO.GIF'){
			sImgNew = sImgSrc.substr(0, sImgSrc.length -14) + 'ESUITELOGO_PRIMARY.GIF';
		}
		else{
			sImgNew = sImgSrc.substr(0, sImgSrc.length -14) + 'ESUITELOGO_PRIMARY.GIF';
		}
		oImage.src = sImgNew;
	}
	catch(er){
		// On error, just display the original image
		oImage.src = sImgSrc;
	}
}

function PriceChangeFont(){
	if(frmPrice.optMethod[0].checked){
		spnEmail.className = "FontNormal";
		spnFax.className = "FontNormal";
	}
	else if(frmPrice.optMethod[1].checked){
		spnEmail.className = "FontRed";
		spnFax.className = "FontNormal";
	}
	else{
		spnEmail.className = "FontNormal";
		spnFax.className = "FontRed";
	}
}

function initMap() {
   if (document.getElementById) {
      var mapIds = initMap.arguments;    // pass string IDs of containing map elements
      var i, j, area, areas;
      for (i = 0; i < mapIds.length; i++) {
        areas = document.getElementById(mapIds[i]).getElementsByTagName("area");

        for (j = 0; j < areas.length; j++) {  // loop thru area elements
           area = areas[j];
           area.onmousedown = imgSwap;    // set event handlers
           area.onmouseout = imgSwap;
           area.onmouseover = imgSwap;
           area.onmouseup = imgSwap;
        }
      }
   }
}

// image swapping event handling
function imgSwap(evt) {
   evt = (evt) ? evt : event;                   // equalize event models
   var elem = (evt.target) ? evt.target : evt.srcElement;
   var imgClass = elem.parentNode.name;         // get map element name
   var coords = elem.coords.split(",");         // convert coords to clip
   var clipVal = "rect(" + coords[1] + "px " +
                           coords[2] + "px " +
                           coords[3] + "px " +
                           coords[0] + "px)";
   var imgStyle;
   
   switch (evt.type) {
      case "mousedown" :
         imgStyle = document.getElementById(imgClass + "Down").style;
         imgStyle.clip = clipVal;
         imgStyle.visibility = "visible";
         break;
      case "mouseout" :
         document.getElementById(imgClass + "Over").style.visibility = "hidden";
         document.getElementById(imgClass + "Down").style.visibility = "hidden";
         break;
      case "mouseover" :
         imgStyle = document.getElementById(imgClass + "Over").style;
         imgStyle.clip = clipVal;
         imgStyle.visibility = "visible";
         break
      case "mouseup" :
         document.getElementById(imgClass + "Down").style.visibility = "hidden";
         // guarantee click in IE
         if (elem.click) {
             elem.click();
         }
         break;
   }
   evt.cancelBubble = true;
   return false;
}