if (document.images) 
{ 
image101 = new Image;
image201 = new Image;
image301 = new Image;
image401= new Image;
image501 = new Image;
image601 = new Image;
image701 = new Image;
image801 = new Image;
image1101 = new Image;
image2201 = new Image;
image3301 = new Image;
image4401= new Image;
image5501 = new Image;
image6601 = new Image;
image7701 = new Image;
image8801 = new Image;
image101.src = 'http://www.ecolearningsystems.com/images/101_over.gif';
image201.src = 'http://www.ecolearningsystems.com/images/201_over.gif';
image301.src = 'http://www.ecolearningsystems.com/images/301_over.gif';
image401.src = 'http://www.ecolearningsystems.com/images/401_over.gif';
image501.src = 'http://www.ecolearningsystems.com/images/501_over.gif';
image601.src = 'http://www.ecolearningsystems.com/images/601_over.gif';
image701.src = 'http://www.ecolearningsystems.com/images/701_over.gif';
image801.src = 'http://www.ecolearningsystems.com/images/801_over.gif';

image1101.src = 'http://www.ecolearningsystems.com/images/101.gif';
image2201.src = 'http://www.ecolearningsystems.com/images/201.gif';
image3301.src = 'http://www.ecolearningsystems.com/images/301.gif';
image4401.src = 'http://www.ecolearningsystems.com/images/401.gif';
image5501.src = 'http://www.ecolearningsystems.com/images/501.gif';
image6601.src = 'http://www.ecolearningsystems.com/images/601.gif';
image7701.src = 'http://www.ecolearningsystems.com/images/701.gif';
image8801.src = 'http://www.ecolearningsystems.com/images/801.gif';
}

var menuids=["suckertree1"] //Enter id(s) of SuckerTree UL menus, separated by commas

function buildsubmenus(){
for (var i=0; i<menuids.length; i++){
  var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
    ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
		if (ultags[t].parentNode.parentNode.id==menuids[i]) //if this is a first level submenu
			ultags[t].style.left=ultags[t].parentNode.offsetWidth+"px" //dynamically position first level submenus to be width of main menu item
		else //else if this is a sub level submenu (ul)
		  ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
    ultags[t].parentNode.onmouseover=function(){
    this.getElementsByTagName("ul")[0].style.display="block"
    }
    ultags[t].parentNode.onmouseout=function(){
    this.getElementsByTagName("ul")[0].style.display="none"
    }
    }
		for (var t=ultags.length-1; t>-1; t--){ //loop through all sub menus again, and use "display:none" to hide menus (to prevent possible page scrollbars
		ultags[t].style.visibility="visible"
		ultags[t].style.display="none"
		}
  }
}

if (window.addEventListener)
window.addEventListener("load", buildsubmenus, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus)





function roll_over(img_name, img_src)
   {
   document[img_name].src = img_src;
   }

//window.onbeforeunload = windowclose;
var PicWin;
function showpic(ignore,imgname,alt) {
	if (PicWin){PicWin.close()}
	
	x=document.getElementById("OPTFORM1")
	
	if(x != null){
	    alt = escape(alt);
	    var SC = x.item.value;
	    scsplit= SC.split(";")
	    SC=scsplit[0];
    	
	    for(i = 0; i < x.length; i++){
		    if(x[i].tagName == 'SELECT'){
			    SC+="-" + x[i].value;
		    }
	    }
    	SC = SC+";"+scsplit[1]+";"+scsplit[2]
	    PicWin = window.open('largeimage.php?imgname='+imgname+'&alt='+alt,"","toolbar=no,location=no,directories=no,menubar=no,resizable=yes,width=700,height=700,scrollbars=yes,status=no");
	}
	else {

	
	if(ignore != ""){
		PicWin = window.open('largeimage.php?imgname='+imgname+'&alt='+alt,"","toolbar=no,location=no,directories=no,menubar=no,resizable=yes,width=640,height=580,scrollbars=yes,status=no");
	
	}

	}	
	if (PicWin.opener == null) PicWin.opener = self;
}
var fontSize = 8;

function FontSizeSet()
	{
        var el, n = 1;
        while (el = document.getElementById('maintext' + n++))
	       el.style.fontSize = fontSize + 'pt';
        return false;
	}

function SetFontLarger()
	{
	if (fontSize < 18) 
            fontSize++;
	return FontSizeSet();
	}
	
	function SetFontLargerBig()
	{
	if (fontSize < 30) 
            fontSize++;
	return FontSizeSet();
	}
	
function SetFontSmaller()
	{
	if (fontSize > 7) 
            fontSize--;
	return FontSizeSet();
	}
function showpic2(SC,alt) {

	if (PicWin){PicWin.close()}
		
	if(SC != null){
	    alt = escape(alt);
	    PicWin = window.open('largeimage.php?product='+SC+'&alt='+alt,"","toolbar=no,location=no,directories=no,menubar=no,resizable=yes,width=800,height=800,scrollbars=yes,status=no");
	}

	if (PicWin.opener == null) PicWin.opener = self;
	return false;
}
function noChars(e)
{

var keynum
var keychar
var numcheck

if(window.event) // IE
	{
	keynum = e.keyCode
	}
else if(e.which) // Netscape/Firefox/Opera
	{
	keynum = e.which
	}
keychar = String.fromCharCode(keynum)
numcheck = /\d/
return numcheck.test(keychar)
}

var altKey  = false;
var keyCode = 0;
var version = navigator.appVersion; 
 function windowclose(evt)
	{
	try {
            var sKey;
			var evt = (evt) ? evt : window.event;
			var clickY  = evt.clientY;
			var altKey  = evt.altKey;
			var keyCode = evt.keyCode;
			//var keycode =(window.event) ? event.keyCode : e.keyCode;
				var keycode =(window.event) ? event.keyCode : e.keyCode;

            if(window.event) {
                sKey = window.event.keyCode;
            }
            else if(objEvent) {
                sKey = objEvent.which;
            }   
            var objEvent = objEvent || window.event;    
            
	   if (!evt.clientY)
		{
			//if (window.confirm('There are items in your shopping cart, are you sure you want to exit?'))
			//{
				//return void(0);
			//}
			//else
			//{
				//window.open('basket.php');					
			//}
        }
		else if(clickY < 0)
		{
			
			/*var response =confirm("There are items in your shopping cart, are you sure you want to exit?");
			if (response == false)
			   {
					window.open('basket.php','','fullscreen=yes,location=yes,menubar=yes,resizable=yes,left=0,titlebar=yes,toolbar=yes,scrollbars=yes,top=0,status=1');					
			   }*/
			   if(confirm("There are items in your shopping cart, are you sure you want to exit?"))
				{
					window.close();
					
				}
				else
				{
					return false;
				}
		}
		else if(sKey == 115 && objEvent.altKey) 
		{      
              //  var response =confirm("There are items in your shopping cart, are you sure you want to exit?");
			  /*if (response == false)
			   {
					window.open('basket.php','','fullscreen=yes,location=yes,menubar=yes,resizable=yes,left=0,titlebar=yes,toolbar=yes,scrollbars=yes,top=0,status=1');					
			   }*/   
			  	if(confirm("There are items in your shopping cart, are you sure you want to exit?"))
				{
					window.close();
					
				}
				else
				{
					return false;
				}
			
            }  
        }
        catch(ex) {
             return void(0);
        }
	}


 
function closeSession(evt){
 
    evt = (evt) ? evt : event;
 
    clickY  = evt.clientY;
    altKey  = evt.altKey;
    keyCode = evt.keyCode;
 
    if(!evt.clientY){
        // Window Closing in FireFox
        // capturing ALT + F4
               /*var objconfirm = confirm("There are items in your shopping cart, are you sure you want to exit?");
               if (objconfirm == false) 
			   {
                    self.close();
                    window.open("basket.php");
                }
				*/
                 //else
                // {
					// self.close();
                    // window.open("logout.php");
                // }
 
    } 
	
	else {
        // Window Closing in IE
        // capturing ALT + F4
        if (altKey == true && keyCode == 115){
           /*var objconfirm = confirm("There are items in your shopping cart, are you sure you want to exit?");
               if (objconfirm == false) 
			   {
                    self.close();
                    window.open("basket.php");
                }
			*/
			if(confirm("There are items in your shopping cart, are you sure you want to exit?"))
				{
					window.close();
				}
				else
				{
					return false;
				}
                 //else
                // {
					// self.close();
                    // window.open("logout.php");
                // }
        // capturing a window close by "X"
        } else if(clickY < 0){
			//return "There are items in your shopping cart, are you sure you want to exit?";
          /*  var objconfirm = confirm("There are items in your shopping cart, are you sure you want to exit?");
               if (objconfirm == false) 
			   {
                    self.close();
                    window.open("basket.php");
                }
				
			*/
			if(confirm("There are items in your shopping cart, are you sure you want to exit?"))
				{
					window.close();
					
				}
				else
				{
					return false;
				}
                 //else
                // {
					// self.close();
                    // window.open("logout.php");
                // }
        // simply leaving the page via a link
        } else {
            //alert('close 3');
            return void(0);
        }
    }
}

 
//window.onkeydown      = whatKey;
navHover = function() {
	var lis = document.getElementById("navmenu").getElementsByTagName("LI");
	for (var i=0; i<lis.length; i++) {
		lis[i].onmouseover=function() {
			this.className+=" iehover";
		}
		lis[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" iehover\\b"), "");
		}
	}
}
//if (window.attachEvent) window.attachEvent("onload", navHover);
//window.onunload = closeSession;
var activeImage = false;
function showImage()
	{
			if(activeImage){
			activeImage.style.filter = 'alpha(opacity=50)';	
			activeImage.style.opacity = 0.5;
			this.style.borderColor='#CCCCCC';
		}	
		this.style.filter = 'alpha(opacity=100)';
		this.style.opacity = 1;	
		activeImage = this;	
	}
	
function MM_findObj(n, d) { //v4.0

  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 && document.getElementById) x=document.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var imageGalleryObj = document.getElementById('theImages');
var slideshowImages = imageGalleryObj.getElementsByTagName('IMG');
		for(var no=0;no<slideshowImages.length;no++){
			slideshowImages[no].onmouseover = showImage;
		}
  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 searchvalid()
{
	if((document.frmsearch.txtsearch.value=="")||(document.frmsearch.txtsearch.value=="Search & Buy"))
	{
		alert("Please enter the search keyword");
		document.frmsearch.txtsearch.focus();
		return false;
	}
}
function validClient()
{
	if(document.login.txtUserName.value=="")
	{
		alert("Please enter the Username");
		document.login.txtUserName.focus();
		return false;
	}
	if(document.login.txtpassword.value=="")
	{
		alert("Please enter the password");
		document.login.txtpassword.focus();
		return false;
	}
}
function submitpub()
{
	document.pub.pubId.value='1';
}
var popupwin;
function popUp(url)
{
	if(popupwin)
	{
		if(!popupwin.closed) popupwin.close();
	}
	popupwin=open(url,'popupwin','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,width=500,height=500,left=200,top=250');
}
function bigimg(url)
{
	if(popupwin)
	{
		if(!popupwin.closed) popupwin.close();
	}
	popupwin=open(url,'popupwin','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,width=100%,height=100%,left=250,top=250');
}
function validnewsletter(strurl)
{
	//alert("test");
	var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
	var matchArray = newsletter.email.value.match(emailPat);
	if(document.newsletter.email.value=="")
	{
		alert("Please enter the email address");
		return false;
	}
	else
	{
		if (matchArray == null)
		{
			alert ("Please enter your valid email address.");
			document.newsletter.email.focus();
			return false;
		}
		else
		{
			popUp(strurl+'newsletter.php?email='+document.newsletter.email.value);
		}
	}
	document.newsletter.email.value='';
	return false;
}

function validateregistration()
{
	
	if(document.eregistration.txtUsername.value=="")
	{
		    alert ("Please Enter Your UserName For Login.");
		    document.eregistration.txtUsername.focus();
			return false;
	}
	if(document.eregistration.txtPassword.value=="")
	{
		    alert ("Please Enter Your Password.");
		    document.eregistration.txtPassword.focus();
			return false;
	}
	if(document.eregistration.txtFirstName.value=="")
	{
		alert("Please Enter Your First Name.");
		document.eregistration.txtFirstName.focus();
		return false;
	}
	if(document.eregistration.txtLastName.value=="")
	{
		alert("Please Enter Your Last Name.");
		document.eregistration.txtLastName.focus();
		return false;
	}
	var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
	var matchArray = document.eregistration.txtEmail.value.match(emailPat);
	var matchArray1 = document.eregistration.atxtEmail.value.match(emailPat);
	if(document.eregistration.txtEmail.value=="")
		{
			alert("Please enter the email address");
			document.eregistration.txtEmail.focus();
			return false;
		}
	else
	{
		if (matchArray == null)
		{
			alert ("Please enter your valid email address.");
			document.eregistration.txtEmail.focus();
			return false;
		}
	}
	if(document.eregistration.atxtEmail.value!="")
	{
	if (matchArray1 == null)
		{
			alert ("Please enter your valid email address.");
			document.eregistration.atxtEmail.focus();
			return false;
		}
	}
	
	if(document.eregistration.txtphone.value=="")
	{
		    alert ("Please Enter Your phone number.");
		    document.eregistration.txtphone.focus();
			return false;
	}
	
	/*if(document.eregistration.txtmobile.value=="")
	{
		    alert ("Please Enter Your Mobile number.");
		    document.eregistration.txtmobile.focus();
			return false;
	}
	else
	{
		var phonepatt = /^[0-9]+$/;
		matcharray = document.eregistration.txtmobile.value.match(phonepatt);
		if (matcharray == null)
			{
			alert ("Please enter your valid Mobile number.");
			document.eregistration.txtmobile.focus();
			return false;
				
			}
	}*/
	
	if(document.eregistration.txtAddress1.value=="")
	{
		    alert ("Please Enter Your Address.");
		    document.eregistration.txtAddress1.focus();
			return false;
	}
	if(document.eregistration.txtTown.value=="")
	{
		    alert ("Please Enter Your city.");
		    document.eregistration.txtTown.focus();
			return false;
	}
if(document.eregistration.cmbstate.value=="")
	{
		    alert ("Please Select Your Sate/Province.");
		    document.eregistration.cmbstate.focus();
			return false;
	}

	if(document.eregistration.txtPostalCode.value=="")
	{
		    alert ("Please Enter Your Zip Code.");
		    document.eregistration.txtPostalCode.focus();
			return false;
	}
	/*else
	{
		var phonepatt = /^[\w]+$/;
		matcharray = document.eregistration.txtPostalCode.value.match(phonepatt);
		if (matcharray == null)
			{
			alert ("Please enter your valid Zip Code.");
			document.eregistration.txtPostalCode.focus();
			return false;
				
			}
		
		}*/
if(document.eregistration.txtCountry.value=="")
	{
		    alert ("Please Select Your Country.");
		    document.eregistration.txtCountry.focus();
			return false;
	}

	if(document.eregistration.cmbquestion.value=="")
	{
		    alert ("Please Select Your Question.");
		    document.eregistration.cmbquestion.focus();
			return false;
	}
	if(document.eregistration.txtanswer.value=="")
	{
		    alert ("Please Select Your Answer.");
		    document.eregistration.txtanswer.focus();
			return false;
	}
	
	
	if(document.eregistration.txt_shipname.value=="")
	{
		alert("Please Enter Your First Name.");
		document.eregistration.txt_shipname.focus();
		return false;
	}
	if(document.eregistration.txt_shiplname.value=="")
	{
		alert("Please Enter Your Last Name.");
		document.eregistration.txt_shiplname.focus();
		return false;
	}
	if(document.eregistration.txt_shipaddress1.value=="")
	{
		    alert ("Please Enter Your Address.");
		    document.eregistration.txt_shipaddress1.focus();
			return false;
	}
	if(document.eregistration.txt_shipcity.value=="")
	{
		    alert ("Please Enter Your city.");
		    document.eregistration.txt_shipcity.focus();
			return false;
	}
	if(document.eregistration.shippostcode.value=="")
	{
		    alert ("Please Enter Your Zip Code.");
		    document.eregistration.shippostcode.focus();
			return false;
	}
	/*else
	{
		var phonepatt = /^[\w]+$/;
		matcharray = document.eregistration.shippostcode.value.match(phonepatt);
		if (matcharray == null)
			{
			alert ("Please enter your valid Zip Code.");
			document.eregistration.shippostcode.focus();
			return false;
				
			}
		
	}*/
	
	
	if(document.eregistration.bfname.value=="")
	{
		alert("Please Enter Your First Name.");
		document.eregistration.bfname.focus();
		return false;
	}
	if(document.eregistration.blname.value=="")
	{
		alert("Please Enter Your Last Name.");
		document.eregistration.blname.focus();
		return false;
	}
	if(document.eregistration.badd1.value=="")
	{
		    alert ("Please Enter Your Address.");
		    document.eregistration.badd1.focus();
			return false;
	}
	if(document.eregistration.bcity.value=="")
	{
		    alert ("Please Enter Your city.");
		    document.eregistration.bcity.focus();
			return false;
	}
	if(document.eregistration.bpost.value=="")
	{
		    alert ("Please Enter Your Zip Code.");
		    document.eregistration.bpost.focus();
			return false;
	}
	else
	{
		var phonepatt = /^[\w]+$/;
		matcharray = document.eregistration.bpost.value.match(phonepatt);
		if (matcharray == null)
			{
			alert ("Please enter your valid Zip Code.");
			document.eregistration.bpost.focus();
			return false;
			}
		
	}
	
	
}


function clearTip(field)
{
	if(field.defaultValue == field.value)
	field.value = "";
}

function writeTip(field)
{
	if(field.value == "")
		field.value = field.defaultValue;
}
function chkcontact()
{
	if(document.contactus.fName==undefined)
	{
	}
	else
	{
		if((document.contactus.fName.value=="")&&(document.contactus.fName.className=="required"))
		{
				alert (document.contactus.fName_msg.value);
				document.contactus.fName.focus();
				return false;
		}
	}
	if(document.contactus.lName==undefined)
	{
	}
	else
	{
		if((document.contactus.lName.value=="")&&(document.contactus.lName.className=="required"))
		{
				alert (document.contactus.lName_msg.value);
				document.contactus.lName.focus();
				return false;
		}
	}
	if(document.contactus.email==undefined)
	{
	}
	else
	{
		var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
		var matchArray = contactus.email.value.match(emailPat);
		if((document.contactus.email.value=="")&&(document.contactus.email.className=="required"))
			{
				alert (document.contactus.email_msg.value);
				document.contactus.email.focus();
				return false;
			}
		else
		{
			if ((matchArray == null)&&(document.contactus.email.className=="required"))
			{
				alert (document.contactus.email_msg.value);
				document.contactus.email.focus();
				return false;
			}
		}
	}
	if(document.contactus.company==undefined)
	{
	}
	else
	{
		if((document.contactus.company.value=="")&&(document.contactus.company.className=="required"))
		{
				alert (document.contactus.company_msg.value);
				document.contactus.company.focus();
				return false;
		}
	}
	if(document.contactus.telephone==undefined)
	{
	}
	else
	{
		if((document.contactus.telephone.value=="")&&(document.contactus.telephone.className=="required"))
		{
				alert (document.contactus.telephone_msg.value);
				document.contactus.telephone.focus();
				return false;
		}
	}
	if(document.contactus.fax==undefined)
	{
	}
	else
	{
		if((document.contactus.fax.value=="")&&(document.contactus.fax.className=="required"))
		{
				alert (document.contactus.fax_msg.value);
				document.contactus.fax.focus();
				return false;
		}
	}
	if(document.contactus.add==undefined)
	{
	}
	else
	{
		if((document.contactus.add.value=="")&&(document.contactus.add.className=="required"))
		{
				alert (document.contactus.add_msg.value);
				document.contactus.add.focus();
				return false;
		}
	}
	if(document.contactus.zip==undefined)
	{
	}
	else
	{
		if((document.contactus.zip.value=="")&&(document.contactus.zip.className=="required"))
		{
				alert (document.contactus.zip_msg.value);
				document.contactus.zip.focus();
				return false;
		}
	}
	if(document.contactus.city==undefined)
	{
	}
	else
	{
		if((document.contactus.city.value=="")&&(document.contactus.city.className=="required"))
		{
				alert (document.contactus.city_msg.value);
				document.contactus.city.focus();
				return false;
		}
	}
	if(document.contactus.state==undefined)
	{
	}
	else
	{
		if((document.contactus.state.value=="")&&(document.contactus.state.className=="required"))
		{
				alert (document.contactus.state_msg.value);
				document.contactus.state.focus();
				return false;
		}
	}
	if(document.contactus.country==undefined)
	{
	}
	else
	{
		if((document.contactus.country.value=="")&&(document.contactus.country.className=="required"))
		{
				alert (document.contactus.country_msg.value);
				document.contactus.country.focus();
				return false;
		}
	}
	if(document.contactus.comment==undefined)
	{
	}
	else
	{
		if((document.contactus.comment.value=="")&&(document.contactus.comment.className=="required"))
		{
				alert (document.contactus.comment_msg.value);
				document.contactus.comment.focus();
				return false;
		}
	}
	
}
function chkuser()
{
	if(document.newuser.fName.value=="")
	{
		alert("Please Enter Your First Name.");
		document.newuser.fName.focus();
		return false;
	}
	if(document.newuser.lName.value=="")
	{
		alert("Please Enter Your Last Name.");
		document.newuser.lName.focus();
		return false;
	}
	var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
	var matchArray = newuser.email.value.match(emailPat);
	var matchArray1 = newuser.alt_email.value.match(emailPat);
	if(document.newuser.email.value=="")
		{
			alert("Please enter the email address");
			document.newuser.email.focus();
			return false;
		}
	else
	{
		if (matchArray == null)
		{
			alert ("Please enter your valid email address.");
			document.newuser.email.focus();
			return false;
		}
	}
	if(document.newuser.alt_email.value!="")
	{
	if (matchArray1 == null)
		{
			alert ("Please enter your valid email address.");
			document.newuser.alt_email.focus();
			return false;
		}
	}
	if(document.newuser.userName.value=="")
	{
		    alert ("Please Enter Your UserName For Login.");
		    document.newuser.userName.focus();
			return false;
	}
	if(document.newuser.password.value=="")
	{
		    alert ("Please Enter Your Password.");
		    document.newuser.password.focus();
			return false;
	}
	
	if(document.newuser.question.value=="")
	{
		    alert ("Please Select Your Question.");
		    document.newuser.question.focus();
			return false;
	}
	if(document.newuser.answer.value=="")
	{
		    alert ("Please Select Your Answer.");
		    document.newuser.answer.focus();
			return false;
	}
	if(document.newuser.country.value=="")
	{
		    alert ("Please Select Your Country.");
		    document.newuser.country.focus();
			return false;
	}
}
function sextractPageName(xhrefString)
{
	var arrx = xhrefString.split('.');
	arrx = arrx[arrx.length-2].split('/');
	return arrx[arrx.length-1].toLowerCase();		
}
function ssetActiveMenu(arrx, xcrtPage)
{
	for(var i=0; i < arrx.length; i++)
		if(sextractPageName(arrx[i].href) == xcrtPage)
		{
			var arr = getpagemenu(xcrtPage);
			if (arr == "homecare")
			{
			arrx[i].className = "homecare";
			arrx[i].parentNode.className = "homecare";
			}
			else if (arr == "paint")
			{arrx[i].className = "paint";
			arrx[i].parentNode.className = "paint";
			}
			else if (arr == "power")
			{
			arrx[i].className = "power";
			arrx[i].parentNode.className = "power";
			}
			else if (arr == "ironmongery")
			{
			arrx[i].className = "ironmongery";
			arrx[i].parentNode.className = "ironmongery";
			}
			else if (arr == "offers")
			{
			arrx[i].className = "offers";
			arrx[i].parentNode.className = "offers";
			}
			else if (arr == "contactus")
			{
			arrx[i].className = "contactus";
			arrx[i].parentNode.className = "contactus";
			}
			else if (arr == "aboutus")
			{arrx[i].className = "aboutus";
			arrx[i].parentNode.className = "aboutus";
			}
			else
			{
			arrx[i].className = "current";
			arrx[i].parentNode.className = "current";
			}
		}
}
function getpagemenu(xhrefString)
{
	var arr = xhrefString.split('_');
	return arr[0].toLowerCase();
}

function ssetPage()
{
	if(document.location.href) 
		xhrefString = document.location.href;
		
	else
		xhrefString = document.location;

	if (document.getElementById("navmenu")!=null) 
		ssetActiveMenu(document.getElementById("navmenu").getElementsByTagName("a"), sextractPageName(xhrefString));
}

function extractPageName(hrefString)
{
	var arr = hrefString.split('#');
	arr = arr[arr.length-1].split('=');
	return arr[arr.length-1].toLowerCase();		
}

function setActiveMenu(arr, crtPage)
{
	for(var i=0; i <arr.length; i++)
		if(extractPageName(arr[i].href) == crtPage)
		{
			
			arr[i].className = "selected";
			arr[i].parentNode.className = "selected";
		}
}

function setPage()
{
	if(document.location.href) 
		hrefString = document.location.href;
	else
		hrefString = document.location;
  //  alert(hrefString );
	if (document.getElementById("infonav")!=null) 
		setActiveMenu(document.getElementById("infonav").getElementsByTagName("a"), extractPageName(hrefString));
}



function changeMenuClass(a)
{	var menu = a;
	//var menu = document.getElementById("navmenu").getElementsByTagName("a");
	alert (menu[0]);
}
var min=8;
var max=18;
function increaseFontSize() {
   var p = document.getElementsByTagName('div');
   //var p=document.getElementById('text');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 11;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }
}
function decreaseFontSize() {
 var p = document.getElementsByTagName('div');
 //var p = document.all('text');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 11;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }   
}

 
var dom = (document.getElementById) ? true : false;
var ns5 = (!document.all && dom || window.opera) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ie4 && !ie5 && !dom) ? true : false;

var origWidth, origHeight;

// avoid error of passing event object in older browsers
if (nodyn) { event = "nope" }

///////////////////////  CUSTOMIZE HERE   ////////////////////
// settings for tooltip 
// Do you want tip to move when mouse moves over link?
var tipFollowMouse= true;	
// Be sure to set tipWidth wide enough for widest image
var tipWidth= 235;
var offX= -50;	// how far from mouse to show tip
var offY= 12; 
var tipFontFamily= "Verdana, arial, helvetica, sans-serif";
var tipFontSize= "8pt";
// set default text color and background color for tooltip here
// individual tooltips can have their own (set in messages arrays)
// but don't have to
var tipFontColor= "#000000";
var tipBgColor= "#FFFFFF"; 
var tipBorderColor= "#4cdfdf";
var tipBorderWidth= 1;
var tipBorderStyle= "ridge";
var tipPadding= 4;

// tooltip content goes here (image, description, optional bgColor, optional textcolor)
var messages = new Array();
// multi-dimensional arrays containing: 
// image and text for tooltip
// optional: bgColor and color to be sent to tooltip
messages[0] = new Array('images/logo.jpg','',"");
messages[1] = new Array('images/team/graham.jpg','Mr John Graham F.R.C.S',"");
messages[2] = new Array('images/team/east.jpg','Mr. Charles Anthony East MB, FRCS',"");
messages[3] = new Array('images/team/Badia.jpg','Lydia Badia FRCS (ORL-HNS)',"");
messages[4] = new Array('images/team/gus_alusi.jpg','Mr. G. Alusi PhD, FRCS (Ed), FRCS (ORL-HNS)',"");

////////////////////  END OF CUSTOMIZATION AREA  ///////////////////

// preload images that are to appear in tooltip
// from arrays above
if (document.images) {
	var theImgs = new Array();
	//alert(theImgs);
	for (var i=0; i<messages.length; i++) {
  	theImgs[i] = new Image();
		theImgs[i].src = messages[i][0];
		//alert(theImgs[i].src);
  }
}

// to layout image and text, 2-row table, image centered in top cell
// these go in var tip in doTooltip function
// startStr goes before image, midStr goes between image and text
var startStr = '<table width="' + tipWidth + '"><tr><td align="center" width="100%"><img src="';
var midStr = '" border="0"></td></tr><tr><td valign="top">';
var endStr = '</td></tr></table>';

////////////////////////////////////////////////////////////
//  initTip	- initialization for tooltip.
//		Global variables for tooltip. 
//		Set styles
//		Set up mousemove capture if tipFollowMouse set true.
////////////////////////////////////////////////////////////
var tooltip, tipcss;
function initTip() {
	if (nodyn) return;
	tooltip = (ie4)? document.all['tipDiv']: (ie5||ns5)? document.getElementById('tipDiv'): null;
	tipcss = tooltip.style;
	if (ie4||ie5||ns5) {	// ns4 would lose all this on rewrites
		tipcss.width = tipWidth+"px";
		tipcss.fontFamily = tipFontFamily;
		tipcss.fontSize = tipFontSize;
		tipcss.color = tipFontColor;
		tipcss.backgroundColor = tipBgColor;
		tipcss.borderColor = tipBorderColor;
		tipcss.borderWidth = tipBorderWidth+"px";
		tipcss.padding = tipPadding+"px";
		tipcss.borderStyle = tipBorderStyle;
	}
	if (tooltip&&tipFollowMouse) {
		document.onmousemove = trackMouse;
	}
}

window.onload = initTip;

/////////////////////////////////////////////////
//  doTooltip function
//			Assembles content for tooltip and writes 
//			it to tipDiv
/////////////////////////////////////////////////
var t1,t2;	// for setTimeouts
var tipOn = false;	// check if over tooltip link
function doTooltip(evt,num) {
	if (!tooltip) return;
	if (t1) clearTimeout(t1);	if (t2) clearTimeout(t2);
	tipOn = true;
	// set colors if included in messages array
	if (messages[num][2])	var curBgColor = messages[num][2];
	else curBgColor = tipBgColor;
	if (messages[num][3])	var curFontColor = messages[num][3];
	else curFontColor = tipFontColor;
	if (ie4||ie5||ns5) {
		var tip = startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr;
		tipcss.backgroundColor = curBgColor;
	 	tooltip.innerHTML = tip;
	}
	if (!tipFollowMouse) positionTip(evt);
	else t1=setTimeout("tipcss.visibility='visible'",100);
}

var mouseX, mouseY;
function trackMouse(evt) {
	standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
	mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
	mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
	if (tipOn) positionTip(evt);
}

/////////////////////////////////////////////////////////////
//  positionTip function
//		If tipFollowMouse set false, so trackMouse function
//		not being used, get position of mouseover event.
//		Calculations use mouseover event position, 
//		offset amounts and tooltip width to position
//		tooltip within window.
/////////////////////////////////////////////////////////////
function positionTip(evt) {
	if (!tipFollowMouse) {
		standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
		mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
		mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
	}
	// tooltip width and height
	var tpWd = (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
	var tpHt = (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;
	// document area in view (subtract scrollbar width for ns)
	var winWd = (ns5)? window.innerWidth-20+window.pageXOffset: standardbody.clientWidth+standardbody.scrollLeft;
	var winHt = (ns5)? window.innerHeight-20+window.pageYOffset: standardbody.clientHeight+standardbody.scrollTop;
	// check mouse position against tip and window dimensions
	// and position the tooltip 
	if ((mouseX+offX+tpWd)>winWd) 
		tipcss.left = mouseX-(tpWd+offX)+"px";
	else tipcss.left = mouseX+offX+"px";
	if ((mouseY+offY+tpHt)>winHt) 
		tipcss.top = winHt-(tpHt+offY)+"px";
	else tipcss.top = mouseY+offY+"px";
	if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}

function hideTip() {
	if (!tooltip) return;
	t2=setTimeout("tipcss.visibility='hidden'",100);
	tipOn = false;
}

function validateQty(frm)
{	
	if(frm.Itemqty.value=="" )
	{
		alert("Please Enter Quantity");
		return false;
	}
	else
	{
	var qtyPat = /^[0-9]+$/;
	var matcharray =frm.Itemqty.value.match(qtyPat);
	
				if(matcharray == null)
				{ 					
					alert("Quantity Must Be Numeric Value");
					return false;
				}
	}
}

function showhidedesc(curdiv)
{
	  //history.go();
	  // var lis = document.getElementById("infonav").getElementsByTagName("LI");
	  //  this.style.backgroundColor=;
		//obj.style.backgroundColor=bgcolor;
		
		var divtag=document.getElementsByTagName("div");
		
		for(i=0;i<document.getElementsByTagName("div").length;i++)
		{
			var divname=divtag[i].id;
			divname=divname.substring(0,4);
			
			if((divname=="desc")&&(divtag[i].id!=curdiv))
			{
				//alert(divname+"\n");
				//alert(curdiv+"\n");
				document.getElementById(divtag[i].id).style.visibility='hidden';
				document.getElementById(divtag[i].id).style.display='none';
			}    
		}
		if(curdiv!="pagecont")
		{
			
			document.getElementById(curdiv).style.visibility='visible';
			document.getElementById(curdiv).style.display='block';
			document.getElementById('pagecont').style.visibility='hidden';
			document.getElementById('pagecont').style.display='none';
		}
		else
		{
			
			//document.getElementById(curdiv).className='selected';
			document.getElementById(curdiv).style.visibility='visible';
			document.getElementById(curdiv).style.display='block';
		}
		//history.go(0);
}




// class switcher:
function newClass(obj, new_style) {    obj.className = new_style;}  // found on internet for rollover tabs

// ----------------------------------------------
// StyleSwitcher functions written by Paul Sowden
// http://www.idontsmoke.co.uk/ss/
// - - - - - - - - - - - - - - - - - - - - - - -
// For the details, visit ALA:
// http://www.alistapart.com/stories/alternate/

// modified by Michiel Dethmers, tincan ltd to include the option
// for textonly

var i;
var stylesheets;

function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}

function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
}

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; domain=.phplist.com; path=/";
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

function rememberFontSize(divname,fontsize) {
  var cookie = readCookie("fontsize");
  var cookieout = '';
  if (cookie) {
    var divs = cookie.split('~');
    for (var i=0; i<divs.length;i++) {
      var pairs = divs[i].split('|');
      if (pairs[0] == divname) {
        cookieout += divname+'|'+fontsize+'~';
      } else if (pairs[0] && pairs[0] != 'undefined') {
        cookieout += pairs[0]+'|'+pairs[1]+'~';
      }
    }
  } else {
    cookieout = divname+'|'+fontsize+'~';
  }
  createCookie('fontsize',cookieout,365);
}

function setFontSize(cookieval) {
  var divs = cookieval.split('~');
  for (var i=0; i<divs.length;i++) {
    var pairs = divs[i].split('|');
    var div = document.getElementById(pairs[0]);
    if (div) {
      div.style.fontSize = pairs[1];
    }
  }
}

function increasefont(divname,step) {
  if (!step) { step = 20; }
  var div = document.getElementById(divname);
  if (!div) return;
  var fontsize = div.style.fontSize;
  if (!fontsize) {
    fontsize = "100%";
  }
  fontsize = parseInt(fontsize);
  fontsize += step;
  if (fontsize > 300) {
    //alert('Now you\'re being silly, that\'s really too big\n\n-- powered by the Webbler, http://www.webbler.org --');
    fontsize = 300;
  }
  fontsize += '%';
  rememberFontSize(divname,fontsize);
  div.style.fontSize = fontsize;
}

function defaultfont(divname) {
  var fontsize = "100%";
  var div = document.getElementById(divname);
  rememberFontSize(divname,fontsize);
  div.style.fontSize = fontsize;
}


function decreasefont(divname,step) {
  var cookie = readCookie("fontsize");
  if (!step) { step = 20; }
  var div = document.getElementById(divname);
  if (!div) return;
  var fontsize = div.style.fontSize;
  if (!fontsize) {
    fontsize = "100%";
  }
  fontsize = parseInt(fontsize);
  fontsize -= step;
  if (fontsize < 50) {
    //alert('I cannot believe you can still read that\n-- powered by the Webbler, http://www.webbler.org --');
    fontsize = 50;
  }
  fontsize += '%';
  rememberFontSize(divname,fontsize);
  div.style.fontSize = fontsize;
}

function textonly(){
  var cookie = readCookie("textonly");
  var flip = cookie != 'yes';
  try{
    stylesheets=this.document.styleSheets;
    for(i=1;i<stylesheets.length;i++)
      stylesheets[i].disabled = flip;
    createCookie('textonly',flip ? 'yes':'no',365);
  }
  catch(m){
  }
}

function printfriendly() {
  removeimages();
  textonly();
}


function fillship()
{
   if(document.eregistration.sameinfo.checked==true)
   {
     document.eregistration.txt_shipname.value=document.eregistration.txtFirstName.value;
	 document.eregistration.txt_shiplname.value=document.eregistration.txtLastName.value;
	// document.client.scompany.value=document.client.company.value;
	 document.eregistration.txt_shipaddress1.value=document.eregistration.txtAddress1.value;
	 document.eregistration.txt_shipaddress2.value=document.eregistration.txtAddress2.value;
	 document.eregistration.txt_shipcity.value=document.eregistration.txtTown.value;
	 document.eregistration.shippostcode.value=document.eregistration.txtPostalCode.value;
	 document.eregistration.db_shipstate.value=document.eregistration.cmbstate.value;
	 document.eregistration.txt_shipcountry.selectedIndex=document.eregistration.txtCountry.selectedIndex;
	 
   }
   else
     
	 {
     document.eregistration.txt_shipname.value="";
	 document.eregistration.txt_shiplname.value="";
	// document.client.scompany.value=document.client.company.value;
	 document.eregistration.txt_shipaddress1.value="";
	 document.eregistration.txt_shipaddress2.value="";
	 document.eregistration.txt_shipcity.value="";
	 document.eregistration.shippostcode.value="";
	 document.eregistration.db_shipstate.value="";
	 document.eregistration.txt_shipcountry.selectedIndex="";
	 }
}

function fillbill()
{
  if(document.eregistration.bsameinfo.checked==true)
  {
	 document.eregistration.bfname.value=document.eregistration.txtFirstName.value;
	 document.eregistration.blname.value=document.eregistration.txtLastName.value;	
	 document.eregistration.badd1.value=document.eregistration.txtAddress1.value;	
	 document.eregistration.badd2.value=document.eregistration.txtAddress2.value;	
	 document.eregistration.bcity.value=document.eregistration.txtTown.value;	
	 document.eregistration.bpost.value=document.eregistration.txtPostalCode.value;	
	document.eregistration.db_bstate.value=document.eregistration.cmbstate.value;		
	document.eregistration.bcountry.value=document.eregistration.txtCountry.value;		
	
	 
   }
   else
     
	 {
    document.eregistration.bfname.value="";
	document.eregistration.blname.value="";
	 document.eregistration.badd1.value="";	
	 document.eregistration.badd2.value="";	
	 document.eregistration.bcity.value="";	
	 document.eregistration.bpost.value="";	
	document.eregistration.db_bstate.value="";	
	document.eregistration.bcountry.value="";	
	
	 }
}

function removeimages(){
  try{
    images=this.document.images;
    len=images.length;
    if(len>0){
      for(q=0;q<len;q++) {
        image=images[q];
        span=this.document.createElement('span');
        if(image) imagealt=image.attributes.getNamedItem('alt');
        alttext='[!]';
        bgcolor='#f00';
        if(imagealt){
          alttext=image.alt;
          bgcolor='#ff0'
        }
        span.style.color='#000';
        span.style.backgroundColor=bgcolor;
        replacement=this.document.createTextNode(alttext);
        span.appendChild(replacement);
        image.parentNode.replaceChild(span,image);
        if(len!=images.length)q--;
      }
    }
  }catch(m){}
}

window.onload = function(e) {
  var cookie = readCookie("style");
  var textonly = readCookie("textonly");
  var fontsize = readCookie("fontsize");
  if (fontsize) {
    setFontSize(fontsize);
  }
  if (textonly == 'yes') {
    stylesheets=this.document.styleSheets;
    for(i=1;i<stylesheets.length;i++)
      stylesheets[i].disabled = true;
  } else {
    var title = cookie ? cookie : getPreferredStyleSheet();
    setActiveStyleSheet(title);
  }
  var hhag = document.getElementById('footerads');
  if (hhag) {
//    hhag.style.display = "none";
  }

}

window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie("style", title, 365);
}

var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);

function chfont(fsize)
{
//alert(fsize);
document.getElementById('cleare').style.fontSize=fsize;
}

function bgr_color(obj, color) {
    obj.style.backgroundColor=color;
}

PositionX = 100;
PositionY = 100;
defaultWidth  = 202;
defaultHeight = 170;
var AutoClose = true;
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle,RanchName){
imageTitle=RanchName;
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');
writeln('<sc'+'ript>');
writeln('var isNN,isIE;');
writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');
writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');
writeln('if (isIE){'); 
writeln('window.resizeTo(eval(document.images[0].width + 10), eval(document.images[0].height+80));');  
writeln('}');
writeln('if (isNN){'); 
writeln('window.innerWidth=document.images[0].width+80;');  
writeln('window.innerHeight=document.images[0].height+80;}}');

writeln('function doTitle(){document.title="'+imageTitle+'";}');
writeln('</sc'+'ript>');
if (!AutoClose) 
writeln('</head><body bgcolor=FFFFFF scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=FFFFFF scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close();">');// onblur="self.close();" //  
writeln('<table border=0 cellpadding=0 cellspacing=0 width=100% height=100% >');
writeln('<tr><td colspan=2 valign=middle align=center><img name="aboutusimage" src="'+imageURL+'" style="display:block"></td></tr>');
writeln('</table>');
close();		
}}   
/* ---------------------------- */
/* XMLHTTPRequest Enable */
/* ---------------------------- */
function createObject() {
var request_type;
var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer"){
request_type = new ActiveXObject("Microsoft.XMLHTTP");
}else{
request_type = new XMLHttpRequest();
}
return request_type;
}

var http = createObject();
/* -------------------------- */
/* Display */
/* -------------------------- */
/* Required: var nocache is a random number to add to request. This value solve an Internet Explorer cache issue */
var nocache = 0;
function display() {
//alert(document.getElementById('display_response'));
// Optional: Show a waiting message in the layer with ID login_response
document.getElementById('display_response').innerHTML = "Loading Wishlist...";

// Required: verify that all fileds is not empty. Use encodeURI() to solve some issues about character encoding.
//var site_url= encodeURI(document.getElementById('site_url').value);
//var site_name = encodeURI(document.getElementById('site_name').value);
// Set te random number to add to URL request
nocache = Math.random();
// Pass the login variables like URL variable
if(document.location.href) 
hrefurl = document.location.href;
else
hrefurl = document.location;
var linkme=hrefurl.search(/dynamicdata/);
if(linkme==-1)
{
 http.open('get', 'createwishlist.php');
}
else
{
 http.open('get', '../createwishlist.php');
}
http.onreadystatechange = displayReply;
http.send(null);
}

function displayReply() {
if(http.readyState == 4)
{ 
var response = http.responseText;
// else if login is ok show a message: "Site added+ site URL".
document.getElementById('display_response').innerHTML = response;
}

}
function noChars(e)
				{
				
				var keynum
				var keychar
				var numcheck

				if(window.event) // IE
					{
					keynum = e.keyCode
					}
				else if(e.which) // Netscape/Firefox/Opera
					{
					keynum = e.which
					}
				keychar = String.fromCharCode(keynum)
				numcheck = /\d/
				return numcheck.test(keychar)
				}
