	function addbookmark(a) 	{	
		/*	add a bookmark	*/
		if (document.all) {
	   	   window.external.AddFavorite(window.location.href,a);	
	   	   alert(a +"  added to Favorites") ;
		}
    }   
  		
	function clickp(path, obj) {
		/*	direct to next location	*/
		var sw=",width=" +screen.width*0.65;
		var sh=",height=" +screen.height*0.65;
		var left=",left=" +screen.width*0.02;
		var top=",top=" +screen.height*0.10;
		var params='"';
		var target = window.location.host +"/" ; 
		newWindow=window.open(path +obj +".jpg","Pictures","toolbar=no,location=no, scrollbars=yes, resizable=no, directories=no, menubar=yes, copyhistory=no, status=no" +sw +sh +left +top +params) ;
	}

    function countchars(maximum,ID) {
	 	var max = maximum
	  	var myvalue = document.getElementById(ID).value ;
	  	var mylength = myvalue.length +1;
	  	if (mylength > max) {
	  	     myvalue = myvalue.substring(0,max) ;
			 document.getElementById(ID).value = myvalue;
  		  	 return "\n You have reached the maximum character limit of " +max ;
	 	 }
		return mylength; 
	}
	   
	function getById(value) { 
		var a=document.getElementById(value)
		if( a != "" && a != null) {
			e = document.getElementById(value)			/* input required value */
			return e.value
		} else {
			return ""
		}
	}
	 
	function getcookie(dough) {
		var a = null
		var c_start=document.cookie.indexOf(dough+"=");
		if (c_start != -1) {
			c_start=c_start + dough.length +1; 
    		c_end=document.cookie.indexOf(";",c_start);
			if (c_end==-1) c_end=document.cookie.length;
  			a =  unescape(document.cookie.substring(c_start,c_end))
		}	
		return a
	}
 
    function GetXmlHttpObject() {
		var xmlHttp=null;
		try {  
  			xmlHttp=new XMLHttpRequest();	// Firefox, Opera 8.0+, Safari
  		}
		catch (e) {
  			try {							// Internet Explorer
    			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    		}
  			catch (e) {
 				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    		}
  		}
		return xmlHttp;
	}

	
	function issuealert(reply) { 
		if ( reply != "" ) {
			reply1 = "\nPlease correct the following errors found on the form.\n" + reply
			alert (reply1)
			return false
	}
	return true	
	}

	function issueconfirm(question) { 
		if (confirm(question+"\n")) { 
			return true 						
		} else {
			return false 						/* not today */
		}
	}
	
	function loadWindow(target){
		var sw=",width=460";
		var sh=",height=650";
		var left=",left=" +screen.width*0.02;
		var top=",top=" +screen.height*0.25;
		var params='"';
		newWindow=window.open(target +"","HelpWindow","toolbar=no,location=no, scrollbars=yes, resizable=no, directories=no, menubar=yes, copyhistory=no, status=no" +sw +sh +left +top +params) ;
	}
	
	function m1(max,ID,XID) {
		result = countchars(max,ID) 
		if (result.len > 1) {
			if (result.substr(0,2) == "\n") { 
				result = max ;
 				issuealert(result);
			}
		}
		document.getElementById(XID).value = max - result;
		result = ""
	}

	function mouseover(me,all){
		document.getElementById(me).style.color='black';
		document.getElementById(me).style.textDecoration="underline"
		r0(all);
	}

	function mouseout(me){
		document.getElementById(me).style.color='blue';
		document.getElementById(me).style.textDecoration="underline"
	}
	
	function clickn(obj) {
		/*	direct to next location	*/
		window.location = obj  ;
	}

	function r0(object1){ 				/*	cursor change */
		object1.className='hand';
	}

	function r1(object1,bc,fc){ 		/*	rollover and rollout	*/
		document.getElementById(object1).style.background = bc;
		document.getElementById(object1).style.color = fc;
	}

	function r2(object){ 
		/*	rollover and rollout	*/
		document.getElementById(object).style.border="thin solid #0000FF";
	}
	function r3(object){ 
		/*	rollover and rollout	*/
		document.getElementById(object).style.border="thin solid #FFFFFF";
	}

	function r6(t) {
		a = t.className ;	
		if (t.className.indexOf(' hand') > -1) {
			t.className.replace(' hand','') 
		} else {
			t.className += ' hand';
		}
	}
	function r7(target) {window.open(target,"_blank") ;}
	function r8(t,type) {
		document.getElementById(t.id).src = "http://"+location.host+"/images/"+type+".gif";
		r6(t);
	}

	function setCookie(c_name,invalue,expiredays) {
		if (invalue.substr(0,1) == "|") {
			value = invalue.substr(1)
		} else {
			value = getById(invalue)					/* input value */
		}
		var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);
		document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
	}

    imagecount=0									/* preset counter for images */
	function  rotate(target) {
		/*	rotate pictures in frame	*/
		  if (colcount != 0) {
			  colcount++;  
			  if (colcount > 4) {colcount = 1} 
		  }  

		  if (document.images) {
		  	 imagecount++;
			 if (imagecount > imageno) {imagecount = 1}
			 var q =target +  imagename1 +imagecount +".jpg"; 
			 var r =target +  imagename2 +imagecount +".gif"; 
			 var s =target +  imagename3 +imagecount +".gif"; 
		     if (colcount == 0) {
		     	document.pictures.src =target +  imagename1 +imagecount +".jpg";
			 } else {
		     	if (colcount == 1) {document.pictures1.src =target +  imagename1 +imagecount +".jpg";} 
		     	if (colcount == 2) {document.pictures2.src =target +  imagename2 +imagecount +".gif";} 
		     	if (colcount == 3) {document.pictures3.src =target +  imagename3 +imagecount +".gif";} 
		     	if (colcount == 4) {document.pictures4.src =target +  imagename1 +imagecount +".jpg";} 
		  	 }
		  }
		  setTimeout("rotate('"+target +"')",5000)
    }

	function t1(elem) {
		var k = document.getElementById(elem).style;
		k.display = "inline";
	}
	function t2(elem) {
		var k = document.getElementById(elem).style;
		k.display = "none";
	}

	function validemail(email) { 
		message = ""						/* message buffer */
		t1 = 0								/* error found */

		if (email =="" ) {					/* IS mail null */
			message += ( "\n * Enter a valid email address")
			t1 = 1 
		}

    	if ( t1 == 0 ) {					/* bypass if no email */
	  		invalidchars = "/:,;"				/* invalid char in email check */
	  		for ( i=0; i<invalidchars.length; i++ ) {
				notval = invalidchars.charAt(i)
				if (email.indexOf(notval,0) > -1 ) {
					message += ( "\n * " + notval + " is not a valid character in an email address \n")
				}
	  		}
							/* @ found flag */
	  		symbolcheck1 = "@"				/* check that one @ exists */
	  		atposition1 = email.indexOf(symbolcheck1,1)
	  		if ( atposition1 == -1 ) {
				message +=  (  "\n * " + email + " is not valid as it does not have a '@' symbol ")
				t1 = 1
	  		}
	  		if (email.indexOf(symbolcheck1, atposition1+1) > -1 ) {
				message +=  ( "\n * " + email + " is not valid as it has two '@' symbols in it ")
	  		}

	  		if ( t1 == 0 ) {		/* only do if @ has been found */
	    		symbolcheck2 = "."		/* check that one . exists  after @ */
				atposition2 = email.indexOf(symbolcheck2,1)
				if ( atposition2 == -1 ) {
		   			message += ( "\n * " + email + " is not valid as it does not have a '.' ")
				}
	  		} 
    	}						/* end of no mail bypass */
		return message	
	}

/* Start of Single */
function checkemail() {
	message = ""						/* message buffer */
	t1 = 0								/* error found */
	email = getById('email')			/* input email value */
	result = validemail(email)			/* check email address */
	reply = result 
	$status = issuealert(reply)
	return $status
}

function ck1(oldvalue,newvalue,ref,a1) {
	if ( oldvalue != newvalue) {
		document.getElementById(ref).disabled = false
		document.getElementById(a1).style.fontWeight = 'bold'
	} else {
		document.getElementById(ref).disabled = true
		document.getElementById(a1).style.fontWeight = 'normal'
	}
}

function isTerms() {
	var a = 'terms'
	if (document.getElementById(a).checked) {
		message = ""						/* message buffer */
		t1 = 0								/* error found */
		email = getById('email')				/* input email value */
		result = validemail(email)				/* check email address */
		reply = result 
		$status = issuealert(reply)
	} else {
		reply = "\n* Please confirm your acceptance of the terms and conditions.\n"
		$status = issuealert(reply) 
	} 
	return $status
}

function refresh(oldvalue,newvalue) {
	if (oldvalue != document.getElementById(newvalue).value) {
		alert("Please use 'Refresh' option when changing the Email address.")  ;
		return false
	}
	return true
}

function validinput(myForm) { 
	reply = ""									/* message buffer */
	t1 = 0										/* error flag */
	if (myForm.contact_spam.value != transpam ) {					/* validate */
		result = ( "\n * Enter the validation code")
		t1 = 1 
	}
	reply += result 
	email = getById('email')					/* input email value */
	result = validemail(email)					/* check email address */
	reply += result
	
	result = ""
	if (getById('comments')=="" ) {				/* message area is null */
		result = ( "\n * Enter your request in the message area ")
		myForm.contact_comments.focus()
		myForm.contact_comments.select()
	}  
	reply += result

	result = ""
	if (getById('from') =="" ) {				/* sender area is null */
		result = ( "\n * Enter your name")
		myForm.contact_from.focus()
		myForm.contact_from.select()
	}  
	reply += result
	return issuealert(reply)
}
/* Start of Menu */
var dbMenu = {
    init: function(){
        var uls = document.getElementsByTagName('ul');
        for(var i = 0; i < uls.length; i++){
            if(uls[i].className.search(/\bdbMenu\b/) == -1)
                continue;
            var menu = uls[i];
            
            dbMenu.styleSubMenus(menu);
            
            addEvent(menu, 'mouseover', dbMenu.hover, false);
            addEvent(menu, 'mouseout', dbMenu.hoverOff, false);
            if(menu.className.search(/\bonMouse\b/) == -1){
                addEvent(menu, 'click', dbMenu.click, false);
            }
            addEvent(menu, 'click', dbMenu.nav, false);
        }    
    },
    
    hover: function(e){
        var target = (window.event)? window.event.srcElement : (e)? e.target : null;
        
        if(target){
            target = dbMenu.getTarget(target, 'li');
            if(!target) return;
        }else{
            return;
        }
        
        target.className += ' hover';
        
        var t = (target.className.search(/\bsubMenu\b/) != -1)? target : (target.parentSubMenu)? target.parentSubMenu : null;
        if(!t) return;
        clearTimeout(t.timeout);
        
        if(target.parentMenu.className.search(/\bonMouse\b/) != -1){
            t.className += ' click';
        }
    },
    
    hoverOff: function(e){
        var target = (window.event)? window.event.srcElement : (e)? e.target : null;
        
        if(target){
            target = dbMenu.getTarget(target, 'li');
            if(!target) return;
        }else{
            return;
        }
        
        target.className = target.className.replace(/hover/g, '');
        
        if(target.parentMenu.className.search(/\bonMouse\b/) != -1){
            var t = (target.className.search(/\bsubMenu\b/) != -1)? target : (target.parentSubMenu)? target.parentSubMenu: null;
            if(!t) return; 
            t.timeout = setTimeout(function(){ t.className = t.className.replace(/click/g, ''); }, 30);
        }
    },
    
    click: function(e){
        if(window.event){
            window.event.cancelBubble = true;
        }
        if(e && e.stopPropagation){
            e.stopPropagation();
        }
        var target = (window.event)? window.event.srcElement : (e)? e.target : null;
        
        if(target){
            target = dbMenu.getTarget(target, 'li');
            if(!target) return;
        }else{
            return;
        }
        
        if(target.className.search(/\bclick\b/) == -1){
            target.className += ' click';
        }else{
            target.className = target.className.replace(/click/g, '');
        }
    },
    
    nav: function(e){
        if(window.event){
            window.event.cancelBubble = true;
        }
        if(e && e.stopPropagation){
            e.stopPropagation();
        }
        var target = (window.event)? window.event.srcElement : (e)? e.target : null;
        
        if(target){
            target = dbMenu.getTarget(target, 'li');
            if(!target) return;
        }else{
            return;
        }
        
        for(var i = 0; i < target.childNodes.length; i++){
            var node = target.childNodes[i];
            if(node.nodeName.toLowerCase() == 'a'){
                window.location = node.href;
                break;
            }
        }
    },
    
    getTarget: function(target, elm){
        if(target.nodeName.toLowerCase() != elm && target.nodeName.toLowerCase() != 'body'){
            return dbMenu.getTarget(target.parentNode, elm);
        }else if(target.nodeName.toLowerCase() == 'body'){
            return null;
        }else{
            return target;
        }
    },
    
    styleSubMenus: function(menu){
        lis = menu.getElementsByTagName('li');
        for(var i = 0; i < lis.length; i++){
            node = lis[i];
            node.parentMenu = menu;
            if(node.getElementsByTagName('ul').length != 0){
                node.className += ' subMenu';
                sublis = node.getElementsByTagName('li');
                for(var j = 0; j < sublis.length; j++){
                    sublis[j].parentSubMenu = node;
                }
            }
        }
    }
}
    
function addEvent(elm, evType, fn, useCapture){  
	if(elm.addEventListener){
		elm.addEventListener(evType, fn, useCapture);
		return true;
	}else if(elm.attachEvent){
		var r = elm.attachEvent('on' + evType, fn);
		return r;
	}else{
		elm['on' + evType] = fn;
	}
}

addEvent(window, 'load', dbMenu.init, false);