/*Copyright 2009 Cenetrix */
// Developed by Andrew Read - Cenetrix Systems

	var http_request = false;
	
	function makeRequest(url, parameters) {
      http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            //http_request.overrideMimeType('text/xml');
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
      http_request.onreadystatechange = alertContents;
      http_request.open('GET', url + parameters, true);
      http_request.send(null);
   }
  
  
  	function makeRequestHandler(url, parameters, handler) {
      http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            //http_request.overrideMimeType('text/xml');
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
      http_request.onreadystatechange = handler;
      http_request.open('GET', url + parameters, true);
      http_request.send(null);
   }

   function check(tocheck) {
   
   		if(tocheck == undefined) return "undef=u&";
   		
		var radioLength = tocheck.length;
		if(radioLength == undefined) return "undef=u&";
		
		for(var i = 0; i < radioLength; i++) {
			if(tocheck[i].checked) {
				return(tocheck[i].name + "=" + tocheck[i].value + "&");
			}
		}
	}

window.size = function()
{
	var w = 0;
	var h = 0;

	//IE
	if(!window.innerWidth)
	{
		//strict mode
		if(!(document.documentElement.clientWidth == 0))
		{
			w = document.documentElement.clientWidth;
			h = document.documentElement.clientHeight;
		}
		//quirks mode
		else
		{
			w = document.body.clientWidth;
			h = document.body.clientHeight;
		}
	}
	//w3c
	else
	{
		w = window.innerWidth;
		h = window.innerHeight;
	}
	return {width:w,height:h};
}

function display_form(layer) {
	var layer1 = document.getElementById([layer]);
	var layerwidthstr = layer1.style.width;
	var layerwidth = parseInt(layerwidthstr.replace(/px$/, ""));
	var layerheight = layer1.style.heightclientHeight;
	var layerheightstr = layer1.style.height;
	var layerheight = parseInt(layerheightstr.replace(/px$/, ""));
	var _x;
	var _y;
	
	//IE
	if(!window.pageYOffset)
	{
		//strict mode
		if(!(document.documentElement.scrollTop == 0))
		{
			offsetY = document.documentElement.scrollTop;
			offsetX = document.documentElement.scrollLeft;
		}
		//quirks mode
		else
		{
			offsetY = document.body.scrollTop;
			offsetX = document.body.scrollLeft;
		}
	}
	//w3c
	else
	{
		offsetX = window.pageXOffset;
		offsetY = window.pageYOffset;
	}

	//var outstr = "x=" + (window.size().width) + "-" + layerwidth;
	//alert(outstr);
	_x = ((window.size().width-layerwidth)/3)+offsetX;
	_y = ((window.size().height-(layerheight+100))/2)+offsetY;
	if ( _y < 0 ) {
			_y = 0;
	}
	// Centre the layer
	//alert(_x);
	//alert(_y);
	layer1.style.left = (_x) + "px";
	layer1.style.top = (_y) + "px";
	layer1.style.display = "block";
	
	//Lets call Google Page View for the click, so we have
	// 1. An Area Page ID - if not an area page, then it's NULL so check existence
	// 2. The type of form to display
		
	if ( $('areaToken') ) {
		// We are an area page
		pageTracker._trackPageview('/' + $F('areaToken') + '/' + layer);
	} else {
		// We're somewhere else on the site
		pageTracker._trackPageview('/' + 'site' + '/' + layer);
	}
	
}

function hide_form(layer) {
	document.getElementById([layer]).style.display = "none";
}

function display_layer(layer) {
	var layer1 = document.getElementById([layer]);
	layer1.style.display = "block";
	
	//Lets call Google Page View for the click, so we have
	// 1. An Area Page ID - if not an area page, then it's NULL so check existence
	// 2. The type of form to display
	
	if ( $('areaToken') ) {
		// We are an area page
		pageTracker._trackPageview('/' + $F('areaToken') + '/' + layer);
	} else {
		// We're somewhere else on the site
		pageTracker._trackPageview('/' + 'site' + '/' + layer);
	}
	
}

function close_layer(layer) {
	var layer1 = document.getElementById([layer]);
	layer1.style.display = "none";
	
	//Lets call Google Page View for the click, so we have
	// 1. An Area Page ID - if not an area page, then it's NULL so check existence
	// 2. The type of form to display
	
	if ( $('areaToken') ) {
		// We are an area page
		pageTracker._trackPageview('/' + $F('areaToken') + '/close/' + layer);
	} else {
		// We're somewhere else on the site
		pageTracker._trackPageview('/' + 'site' + '/close/' + layer);
	}
	
}


function set_location(element, email) {
	document.getElementById([element]).value = email;
}

// return the value of the radio button that is checked
// return an empty string if none are checked, or
// there are no radio buttons
function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}


// ajax.Request
function ajaxPostcodeRequest(url,data) {  
		var aj = new Ajax.Request(  
			url, {  
				method:'get',   
				parameters: data,   
				onComplete: getPostcodeResponse  
		}  
	);  
} 

/* ajax.Response */  
function getPostcodeResponse(oReq) {  
	$('postcode_list').innerHTML = oReq.responseText;	
	display_form('postcode_results');
}




// ajax.Request
function ajaxOPPostcodeRequest(url,data) {  
		var aj = new Ajax.Request(  
			url, {  
				method:'get',   
				parameters: data,   
				onComplete: getOPPostcodeResponse  
		}  
	);  
} 

/* ajax.Response */  
function getOPPostcodeResponse(oReq) {  
	$('postcode_list_op').innerHTML = oReq.responseText;	
	display_layer('postcode_results_op');
}





function track_interaction(token, layer) {
	
	if ( $('areaToken') ) {
		// We are an area page
		pageTracker._trackPageview('/' + token + '/' + $F('areaToken'));
	} else {
		// We're somewhere else on the site
		pageTracker._trackPageview('/' + token + '/' + layer);
	}
}


// JavaScript Document
// Developed by Andrew Read - Cenetrix Systems
   function getApplication(obj) {
      var getstr = "?action=send2&";
      getstr += obj.AppLocation.name + "=" + obj.AppLocation.value + "&";
      getstr += obj.AppName.name + "=" + obj.AppName.value + "&";
      getstr += obj.AppEmail.name + "=" + obj.AppEmail.value + "&";
      getstr += obj.AppAddress.name + "=" + obj.AppAddress.value + "&";
      getstr += obj.AppPostcode.name + "=" + obj.AppPostcode.value + "&";
      getstr += obj.AppBirthdate.name + "=" + obj.AppBirthdate.value + "&";
      getstr += obj.AppMobile.name + "=" + obj.AppMobile.value + "&";
      getstr += obj.AppTelephone.name + "=" + obj.AppTelephone.value + "&";
   
	chosen = getCheckedValue(obj.AppisOutsider);   
	if (chosen) {
		chosen_str = "AppisOutsider=" + chosen + "&";
		getstr += chosen_str;
	}   

	getstr += obj.AppCar.name + "=" + obj.AppCar.value + "&";
	chosen = getCheckedValue(obj.AppisPetOwner);   
	if (chosen) {
		chosen_str = "AppisPetOwner=" + chosen + "&";
		getstr += chosen_str;
	} 
	
	  getstr += obj.ApptoAvoid.name + "=" + obj.ApptoAvoid.value + "&";
	  getstr += obj.AppPreviousExperience.name + "=" + obj.AppPreviousExperience.value + "&";

	chosen = getCheckedValue(obj.ApphasExperience);   
	if (chosen) {
		chosen_str = "ApphasExperience=" + chosen + "&";
		getstr += chosen_str;
	} 
	
	chosen = getCheckedValue(obj.AppisExercising);   
	if (chosen) {
		chosen_str = "AppisExercising=" + chosen + "&";
		getstr += chosen_str;
	} 
	  
	chosen = getCheckedValue(obj.AppisAtHome);   
	if (chosen) {
		chosen_str = "AppisAtHome=" + chosen + "&";
		getstr += chosen_str;
	} 
	
	chosen = getCheckedValue(obj.AppisPetSitting);   
	if (chosen) {
		chosen_str = "AppisPetSitting=" + chosen + "&";
		getstr += chosen_str;
	} 
	 
      getstr += obj.Apprequired.name + "=" + obj.Apprequired.value;
      	  
	  //Debug - ensure that this is disabled
	  //alert(getstr);
      
	  makeRequestHandler('/scripts/forms/application.php', getstr, alertApplicationContents);
   }

   function alertApplicationContents() {
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
            //alert(http_request.responseText);
            result = http_request.responseText;
			if ( result == "<b>Thank you for your application, it has been sent</b>" ) {
				document.getElementById('application').innerHTML = "<span name=\"myspan\" id=\"myspan\" style=\"colour: #FFFFFF;\"></span><div style=\"position: absolute; top: 200px; left: 230px;\"><input type=\"button\" name=\"Close\" value=\"Close\" onclick=\"javascript:hide_form('application');\" /></div>";
				result_new ="<br><br><br><br><br><br><br><br><center style=\"color:#FFFFFF;\">" + result + "</center>";
				result = result_new;
			}
            document.getElementById('myspan').innerHTML = result;            
         } else {
            alert('There was a problem with the contact form, please contact the franchise directly.');
         }
      }
   }

/* Copyright 2009 - Cenetrix Systems - Controller for Tabs */

function show_links(){$('area_detail_home').hide();$('area_button_home').className="area_button_inactive";if($('area_button_service')){$('area_detail_service').hide();$('area_button_service').className="area_button_inactive";}
if($('area_button_testimonials')){$('area_detail_testimonials').hide();$('area_button_testimonials').className="area_button_inactive";}
if($('area_button_prices')){$('area_detail_prices').hide();$('area_button_prices').className="area_button_inactive";}
if($('area_button_news')){$('area_detail_news').hide();$('area_button_news').className="area_button_inactive";}
if($('area_button_links')){$('area_detail_links').show();$('area_button_links').className="area_button_active";}}
function show_service(){$('area_detail_home').hide();$('area_button_home').className="area_button_inactive";if($('area_button_links')){$('area_detail_links').hide();$('area_button_links').className="area_button_inactive";}
if($('area_button_testimonials')){$('area_detail_testimonials').hide();$('area_button_testimonials').className="area_button_inactive";}
if($('area_button_prices')){$('area_detail_prices').hide();$('area_button_prices').className="area_button_inactive";}
if($('area_button_news')){$('area_detail_news').hide();$('area_button_news').className="area_button_inactive";}
if($('area_button_service')){$('area_detail_service').show();$('area_button_service').className="area_button_active";}}
function show_home(){if($('area_button_service')){$('area_detail_service').hide();$('area_button_service').className="area_button_inactive";}
if($('area_button_links')){$('area_detail_links').hide();$('area_button_links').className="area_button_inactive";}
if($('area_button_testimonials')){$('area_detail_testimonials').hide();$('area_button_testimonials').className="area_button_inactive";}
if($('area_button_prices')){$('area_detail_prices').hide();$('area_button_prices').className="area_button_inactive";}
if($('area_button_news')){$('area_detail_news').hide();$('area_button_news').className="area_button_inactive";}
$('area_detail_home').show();$('area_button_home').className="area_button_active";}
function show_testimonials(){if($('area_button_service')){$('area_detail_service').hide();$('area_button_service').className="area_button_inactive";}
if($('area_button_links')){$('area_detail_links').hide();$('area_button_links').className="area_button_inactive";}
$('area_detail_home').hide();$('area_button_home').className="area_button_inactive";if($('area_button_prices')){$('area_detail_prices').hide();$('area_button_prices').className="area_button_inactive";}
if($('area_button_news')){$('area_detail_news').hide();$('area_button_news').className="area_button_inactive";}
if($('area_button_testimonials')){$('area_detail_testimonials').show();$('area_button_testimonials').className="area_button_inactive";}}
function show_prices(){if($('area_button_service')){$('area_detail_service').hide();$('area_button_service').className="area_button_inactive";}
if($('area_button_links')){$('area_detail_links').hide();$('area_button_links').className="area_button_inactive";}
if($('area_button_testimonials')){$('area_detail_testimonials').hide();$('area_button_testimonials').className="area_button_inactive";}
$('area_detail_home').hide();$('area_button_home').className="area_button_inactive";if($('area_button_news')){$('area_detail_news').hide();$('area_button_news').className="area_button_inactive";}
if($('area_button_prices')){$('area_detail_prices').show();$('area_button_prices').className="area_button_active";}}
function show_news(){if($('area_button_service')){$('area_detail_service').hide();$('area_button_service').className="area_button_inactive";}
if($('area_button_links')){$('area_detail_links').hide();$('area_button_links').className="area_button_inactive";}
if($('area_button_testimonials')){$('area_detail_testimonials').hide();$('area_button_testimonials').className="area_button_inactive";}
$('area_detail_home').hide();$('area_button_home').className="area_button_inactive";if($('area_button_prices')){$('area_detail_prices').hide();$('area_button_prices').className="area_button_inactive";}
if($('area_button_news')){$('area_detail_news').show();$('area_button_news').className="area_button_active";}}

// ARR 06-08-2010
// New Franchise Enquiry System

   function makeNewFranchise(obj) {
      var getstr = "?action=send2&";
      getstr += obj.Location.name + "=" + obj.Location.value + "&";
      getstr += obj.Name.name + "=" + escape(obj.Name.value) + "&";
      getstr += obj.Email.name + "=" + escape(obj.Email.value) + "&";
      getstr += obj.Address.name + "=" + escape(obj.Address.value) + "&";
      getstr += obj.Postcode.name + "=" + escape(obj.Postcode.value) + "&";
      getstr += obj.Town.name + "=" + escape(obj.Town.value) + "&";
      getstr += obj.Telephone.name + "=" + escape(obj.Telephone.value) + "&";
      getstr += obj.Findus.name + "=" + escape(obj.Findus.value) + "&";
      getstr += obj.Other.name + "=" + escape(obj.Other.value) + "&";
      getstr += obj.Message.name + "=" + escape(obj.Message.value) + "&";
      
      
	  	if ( obj.Optin.checked ) {
	  		getstr += obj.Optin.name + "=1&";
      	} else {
      		getstr += obj.Optin.name + "=0&";
      	}
      
   	  getstr += obj.required.name + "=" + obj.required.value;
	  if (obj.Subject) {
		  getstr += "&mt=" + obj.Subject.value;
	  }
	  
	  //alert(getstr);
      makeRequestHandler('/scripts/forms/enquiry.php', getstr, alertContactContents);
   }






// JavaScript Document
// Developed by Andrew Read - Cenetrix Systems
   function getContact(obj) {
      var getstr = "?action=send2&";
      getstr += obj.Location.name + "=" + obj.Location.value + "&";
      getstr += obj.Name.name + "=" + escape(obj.Name.value) + "&";
      getstr += obj.Email.name + "=" + escape(obj.Email.value) + "&";
      getstr += obj.Address.name + "=" + escape(obj.Address.value) + "&";
      getstr += obj.Postcode.name + "=" + escape(obj.Postcode.value) + "&";
      getstr += obj.Telephone.name + "=" + escape(obj.Telephone.value) + "&";
      getstr += obj.Message.name + "=" + escape(obj.Message.value) + "&";
      
	  	if ( obj.Optin.checked ) {
	  		getstr += obj.Optin.name + "=1&";
      	} else {
      		getstr += obj.Optin.name + "=0&";
      	}
      
   	  getstr += obj.required.name + "=" + obj.required.value;
	  if (obj.Subject) {
		  getstr += "&mt=" + obj.Subject.value;
	  }
	  
	  //alert(getstr);
      makeRequestHandler('/scripts/forms/contact.php', getstr, alertContactContents);
   }

   function alertContactContents() {
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
            //alert(http_request.responseText);
            result = http_request.responseText;
			if ( result == "<b>Thank you for your enquiry, it has been sent</b>" ) {
				//result_new ="<br><br><br><br><center style=\"color:#FFFFFF;\">" + result + "<br /><br /><br /><input type=\"button\" name=\"Close\" value=\"Close\" onclick=\"javascript:hide_form('contact');\" /></center>";
				//result = result_new;
				document.getElementById('Email').value='';
				document.getElementById('Name').value='';
				document.getElementById('Address').value='';
				document.getElementById('Postcode').value='';
				document.getElementById('Message').value='';
				document.getElementById('Telephone').value='';
	            //document.getElementById('contact_form').innerHTML = result;
				document.getElementById('contactspan').innerHTML = result; 
	
				if ( $('areaToken') ) {
				// We are an area page
					pageTracker._trackPageview('/' + $F('areaToken') + '/contact/sent');
				} else {
					// We're somewhere else on the site
					pageTracker._trackPageview('/' + 'site' + '/contact/sent');
				}


			} else {
            	document.getElementById('contactspan').innerHTML = result; 
            	
            	if ( $('areaToken') ) {
				// We are an area page
					pageTracker._trackPageview('/' + $F('areaToken') + '/contact/failed');
				} else {
					// We're somewhere else on the site
					pageTracker._trackPageview('/' + 'site' + '/contact/failed');
				}
				
			}
         } else {
            alert('There was a problem with the contact form, please contact the franchise directly.');
         }
      }
   }
   
   function do_contact(location){
		document.getElementById('Location').value = location;
		display_form('contact');
	}


// JavaScript Document
// Developed by Andrew Read - Cenetrix Systems
   function getFeedback(obj) {
      var getstr = "?action=send2&";
      getstr += obj.feedbackLocation.name + "=" + obj.feedbackLocation.value + "&";
      getstr += obj.feedbackName.name + "=" + obj.feedbackName.value + "&";
      getstr += obj.feedbackEmail.name + "=" + obj.feedbackEmail.value + "&";
      getstr += obj.feedbackTelephone.name + "=" + obj.feedbackTelephone.value + "&";
      getstr += obj.feedbackMessage.name + "=" + escape(obj.feedbackMessage.value) + "&";
      if ( obj.feedbackOptin.checked ) {
	  	getstr += obj.feedbackOptin.name + "=1&"
      } else {
      	getstr += obj.feedbackOptin.name + "=0&"
      }
      getstr += obj.feedbackrequired.name + "=" + obj.feedbackrequired.value;
	  if (obj.feedbackSubject) {
		  getstr += "&mt=" + obj.feedbackSubject.value;
	  }
	  
	  //alert(getstr);
      makeRequestHandler('/scripts/forms/feedback.php', getstr, alertFeedbackContents);
   }

   function alertFeedbackContents() {
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
            //alert(http_request.responseText);
            result = http_request.responseText;
			if ( result == "<b>Thank you for your feedback, it has been sent.</b>" ) {
				document.getElementById('feedbackEmail').value='';
				document.getElementById('feedbackName').value='';
				document.getElementById('feedbackMessage').value='';
				document.getElementById('feedbackTelephone').value='';
				document.getElementById('feedbackspan').innerHTML = result; 
				
				if ( $('areaToken') ) {
				// We are an area page
					pageTracker._trackPageview('/' + $F('areaToken') + '/feedback/sent');
				} else {
					// We're somewhere else on the site
					pageTracker._trackPageview('/' + 'site' + '/feedback/sent');
				}


			} else {

            	document.getElementById('feedbackspan').innerHTML = result; 
            	
            	if ( $('areaToken') ) {
				// We are an area page
					pageTracker._trackPageview('/' + $F('areaToken') + '/feedback/failed');
				} else {
					// We're somewhere else on the site
					pageTracker._trackPageview('/' + 'site' + '/feedback/failed');
				}
				
			}
         } else {
            alert('There was a problem with the contact form, please contact the franchise directly.');
         }
      }
   }


//FSMENU

/*

FREESTYLE MENUS v1.0 RC (c) 2001-2006 Angus Turnbull, http://www.twinhelix.com
Altering this notice or redistributing this file is prohibited.

*/

var isDOM=document.getElementById?1:0,isIE=document.all?1:0,isNS4=navigator.appName=='Netscape'&&!isDOM?1:0,isOp=self.opera?1:0,isDyn=isDOM||isIE||isNS4;function getRef(i,p){p=!p?document:p.navigator?p.document:p;return isIE?p.all[i]:isDOM?(p.getElementById?p:p.ownerDocument).getElementById(i):isNS4?p.layers[i]:null};function getSty(i,p){var r=getRef(i,p);return r?isNS4?r:r.style:null};if(!self.LayerObj)var LayerObj=new Function('i','p','this.ref=getRef(i,p);this.sty=getSty(i,p);return this');function getLyr(i,p){return new LayerObj(i,p)};function LyrFn(n,f){LayerObj.prototype[n]=new Function('var a=arguments,p=a[0],px=isNS4||isOp?0:"px";with(this){'+f+'}')};LyrFn('x','if(!isNaN(p))sty.left=p+px;else return parseInt(sty.left)');LyrFn('y','if(!isNaN(p))sty.top=p+px;else return parseInt(sty.top)');if(typeof addEvent!='function'){var addEvent=function(o,t,f,l){var d='addEventListener',n='on'+t,rO=o,rT=t,rF=f,rL=l;if(o[d]&&!l)return o[d](t,f,false);if(!o._evts)o._evts={};if(!o._evts[t]){o._evts[t]=o[n]?{b:o[n]}:{};o[n]=new Function('e','var r=true,o=this,a=o._evts["'+t+'"],i;for(i in a){o._f=a[i];r=o._f(e||window.event)!=false&&r;o._f=null}return r');if(t!='unload')addEvent(window,'unload',function(){removeEvent(rO,rT,rF,rL)})}if(!f._i)f._i=addEvent._i++;o._evts[t][f._i]=f};addEvent._i=1;var removeEvent=function(o,t,f,l){var d='removeEventListener';if(o[d]&&!l)return o[d](t,f,false);if(o._evts&&o._evts[t]&&f._i)delete o._evts[t][f._i]}}function FSMenu(myName,nested,cssProp,cssVis,cssHid){this.myName=myName;this.nested=nested;this.cssProp=cssProp;this.cssVis=cssVis;this.cssHid=cssHid;this.cssLitClass='highlighted';this.menus={root:new FSMenuNode('root',true,this)};this.menuToShow=[];this.mtsTimer=null;this.showDelay=0;this.switchDelay=125;this.hideDelay=500;this.showOnClick=0;this.hideOnClick=true;this.animInSpeed=0.2;this.animOutSpeed=0.2;this.animations=[]};FSMenu.prototype.show=function(mN){with(this){menuToShow.length=arguments.length;for(var i=0;i<arguments.length;i++)menuToShow[i]=arguments[i];clearTimeout(mtsTimer);if(!nested)mtsTimer=setTimeout(myName+'.menus.root.over()',10)}};FSMenu.prototype.hide=function(mN){with(this){clearTimeout(mtsTimer);if(menus[mN])menus[mN].out()}};FSMenu.prototype.hideAll=function(){with(this){for(var m in menus)if(menus[m].visible&&!menus[m].isRoot)menus[m].hide(true)}};function FSMenuNode(id,isRoot,obj){this.id=id;this.isRoot=isRoot;this.obj=obj;this.lyr=this.child=this.par=this.timer=this.visible=null;this.args=[];var node=this;this.over=function(evt){with(node)with(obj){if(isNS4&&evt&&lyr.ref)lyr.ref.routeEvent(evt);clearTimeout(timer);clearTimeout(mtsTimer);if(!isRoot&&!visible)node.show();if(menuToShow.length){var a=menuToShow,m=a[0];if(!menus[m]||!menus[m].lyr.ref)menus[m]=new FSMenuNode(m,false,obj);var c=menus[m];if(c==node){menuToShow.length=0;return}clearTimeout(c.timer);if(c!=child&&c.lyr.ref){c.args.length=a.length;for(var i=0;i<a.length;i++)c.args[i]=a[i];var delay=child?switchDelay:showDelay;c.timer=setTimeout('with('+myName+'){menus["'+c.id+'"].par=menus["'+node.id+'"];menus["'+c.id+'"].show()}',delay?delay:1)}menuToShow.length=0}if(!nested&&par)par.over()}};this.out=function(evt){with(node)with(obj){if(isNS4&&evt&&lyr&&lyr.ref)lyr.ref.routeEvent(evt);clearTimeout(timer);if(!isRoot&&hideDelay>=0){timer=setTimeout(myName+'.menus["'+id+'"].hide()',hideDelay);if(!nested&&par)par.out()}}};if(this.id!='root')with(this)with(lyr=getLyr(id))if(ref){if(isNS4)ref.captureEvents(Event.MOUSEOVER|Event.MOUSEOUT);addEvent(ref,'mouseover',this.over);addEvent(ref,'mouseout',this.out);if(obj.nested){addEvent(ref,'focus',this.over);addEvent(ref,'click',this.over);addEvent(ref,'blur',this.out)}}};FSMenuNode.prototype.show=function(forced){with(this)with(obj){if(!lyr||!lyr.ref)return;if(par){if(par.child&&par.child!=this)par.child.hide();par.child=this}var offR=args[1],offX=args[2],offY=args[3],lX=0,lY=0,doX=''+offX!='undefined',doY=''+offY!='undefined';if(self.page&&offR&&(doX||doY)){with(page.elmPos(offR,par.lyr?par.lyr.ref:0))lX=x,lY=y;if(doX)lyr.x(lX+eval(offX));if(doY)lyr.y(lY+eval(offY))}if(offR)lightParent(offR,1);visible=1;if(obj.onshow)obj.onshow(id);lyr.ref.parentNode.style.zIndex='2';setVis(1,forced)}};FSMenuNode.prototype.hide=function(forced){with(this)with(obj){if(!lyr||!lyr.ref||!visible)return;if(isNS4&&self.isMouseIn&&isMouseIn(lyr.ref))return show();if(args[1])lightParent(args[1],0);if(child)child.hide();if(par&&par.child==this)par.child=null;if(lyr){visible=0;if(obj.onhide)obj.onhide(id);lyr.ref.parentNode.style.zIndex='1';setVis(0,forced)}}};FSMenuNode.prototype.lightParent=function(elm,lit){with(this)with(obj){if(!cssLitClass||isNS4)return;if(lit)elm.className+=(elm.className?' ':'')+cssLitClass;else elm.className=elm.className.replace(new RegExp('(\\s*'+cssLitClass+')+$'),'')}};FSMenuNode.prototype.setVis=function(sh,forced){with(this)with(obj){if(lyr.forced&&!forced)return;lyr.forced=forced;lyr.timer=lyr.timer||0;lyr.counter=lyr.counter||0;with(lyr){clearTimeout(timer);if(sh&&!counter)sty[cssProp]=cssVis;var speed=sh?animInSpeed:animOutSpeed;if(isDOM&&speed<1)for(var a=0;a<animations.length;a++)animations[a](ref,counter,sh);counter+=speed*(sh?1:-1);if(counter>1){counter=1;lyr.forced=false}else if(counter<0){counter=0;sty[cssProp]=cssHid;lyr.forced=false}else if(isDOM){timer=setTimeout(myName+'.menus["'+id+'"].setVis('+sh+','+forced+')',50)}}}};FSMenu.animSwipeDown=function(ref,counter,show){if(show&&(counter==0)){ref._fsm_styT=ref.style.top;ref._fsm_styMT=ref.style.marginTop;ref._fsm_offT=ref.offsetTop||0}var cP=Math.pow(Math.sin(Math.PI*counter/2),0.75);var clipY=ref.offsetHeight*(1-cP);ref.style.clip=(counter==1?((window.opera||navigator.userAgent.indexOf('KHTML')>-1)?'':'rect(auto,auto,auto,auto)'):'rect('+clipY+'px,'+ref.offsetWidth+'px,'+ref.offsetHeight+'px,0)');if(counter==1||(counter<0.01&&!show)){ref.style.top=ref._fsm_styT;ref.style.marginTop=ref._fsm_styMT}else{ref.style.top=((0-clipY)+(ref._fsm_offT))+'px';ref.style.marginTop='0'}};FSMenu.animFade=function(ref,counter,show){var done=(counter==1);if(ref.filters){var alpha=!done?' alpha(opacity='+parseInt(counter*100)+')':'';if(ref.style.filter.indexOf("alpha")==-1)ref.style.filter+=alpha;else ref.style.filter=ref.style.filter.replace(/\s*alpha\([^\)]*\)/i,alpha)}else ref.style.opacity=ref.style.MozOpacity=counter/1.001};FSMenu.animClipDown=function(ref,counter,show){var cP=Math.pow(Math.sin(Math.PI*counter/2),0.75);ref.style.clip=(counter==1?((window.opera||navigator.userAgent.indexOf('KHTML')>-1)?'':'rect(auto,auto,auto,auto)'):'rect(0,'+ref.offsetWidth+'px,'+(ref.offsetHeight*cP)+'px,0)')};FSMenu.prototype.activateMenu=function(id,subInd){with(this){if(!isDOM||!document.documentElement)return;var fsmFB=getRef('fsmenu-fallback');if(fsmFB){fsmFB.rel='alternate stylesheet';fsmFB.disabled=true}var a,ul,li,parUL,mRoot=getRef(id),nodes,count=1;var lists=mRoot.getElementsByTagName('ul');for(var i=0;i<lists.length;i++){li=ul=lists[i];while(li){if(li.nodeName.toLowerCase()=='li')break;li=li.parentNode}if(!li)continue;parUL=li;while(parUL){if(parUL.nodeName.toLowerCase()=='ul')break;parUL=parUL.parentNode}a=null;for(var j=0;j<li.childNodes.length;j++)if(li.childNodes[j].nodeName.toLowerCase()=='a')a=li.childNodes[j];if(!a)continue;var menuID=myName+'-id-'+count++;if(ul.id)menuID=ul.id;else ul.setAttribute('id',menuID);var sOC=(showOnClick==1&&li.parentNode==mRoot)||(showOnClick==2);var evtProp=navigator.userAgent.indexOf('Safari')>-1||isOp?'safRtnVal':'returnValue';var eShow=new Function('with('+myName+'){var m=menus["'+menuID+'"],pM=menus["'+parUL.id+'"];'+(sOC?'if((pM&&pM.child)||(m&&m.visible))':'')+' show("'+menuID+'",this)}');var eHide=new Function('e','if(e.'+evtProp+'!=false)'+myName+'.hide("'+menuID+'")');addEvent(a,'mouseover',eShow);addEvent(a,'focus',eShow);addEvent(a,'mouseout',eHide);addEvent(a,'blur',eHide);if(sOC)addEvent(a,'click',new Function('e',myName+'.show("'+menuID+'",this);if(e.cancelable&&e.preventDefault)e.preventDefault();e.'+evtProp+'=false;return false'));if(subInd)a.insertBefore(subInd.cloneNode(true),a.firstChild)}if(isIE&&!isOp){var aNodes=mRoot.getElementsByTagName('a');for(var i=0;i<aNodes.length;i++){addEvent(aNodes[i],'focus',new Function('e','var node=this.parentNode;while(node){if(node.onfocus)node.onfocus(e);node=node.parentNode}'));addEvent(aNodes[i],'blur',new Function('e','var node=this.parentNode;while(node){if(node.onblur)node.onblur(e);node=node.parentNode}'))}}if(hideOnClick)addEvent(mRoot,'click',new Function(myName+'.hideAll()'));menus[id]=new FSMenuNode(id,true,this)}};var page={win:self,minW:0,minH:0,MS:isIE&&!isOp,db:document.compatMode&&document.compatMode.indexOf('CSS')>-1?'documentElement':'body'};page.elmPos=function(e,p){var x=0,y=0,w=p?p:this.win;e=e?(e.substr?(isNS4?w.document.anchors[e]:getRef(e,w)):e):p;if(isNS4){if(e&&(e!=p)){x=e.x;y=e.y};if(p){x+=p.pageX;y+=p.pageY}}if(e&&this.MS&&navigator.platform.indexOf('Mac')>-1&&e.tagName=='A'){e.onfocus=new Function('with(event){self.tmpX=clientX-offsetX;self.tmpY=clientY-offsetY}');e.focus();x=tmpX;y=tmpY;e.blur()}else while(e){x+=e.offsetLeft;y+=e.offsetTop;e=e.offsetParent}return{x:x,y:y}};if(isNS4){var fsmMouseX,fsmMouseY,fsmOR=self.onresize,nsWinW=innerWidth,nsWinH=innerHeight;document.fsmMM=document.onmousemove;self.onresize=function(){if(fsmOR)fsmOR();if(nsWinW!=innerWidth||nsWinH!=innerHeight)location.reload()};document.captureEvents(Event.MOUSEMOVE);document.onmousemove=function(e){fsmMouseX=e.pageX;fsmMouseY=e.pageY;return document.fsmMM?document.fsmMM(e):document.routeEvent(e)};function isMouseIn(sty){with(sty)return((fsmMouseX>left)&&(fsmMouseX<left+clip.width)&&(fsmMouseY>top)&&(fsmMouseY<top+clip.height))}}
//FSMENU ENABLE

/* Copyright Cenetrix Systems */

//<![CDATA[

// For each menu you create, you must create a matching "FSMenu" JavaScript object to represent
// it and manage its behaviour. You don't have to edit this script at all if you don't want to;
// these comments are just here for completeness. Also, feel free to paste this script into the
// external .JS file to make including it in your pages easier!

// Here's a menu object to control the above list of menu data:
var listMenu = new FSMenu('listMenu', true, 'display', 'block', 'none');

// The parameters of the FSMenu object are:
//  1) Its own name in quotes.
//  2) Whether this is a nested list menu or not (in this case, true means yes).
//  3) The CSS property name to change when menus are shown and hidden.
//  4) The visible value of that CSS property.
//  5) The hidden value of that CSS property.
//
// Next, here's some optional settings for delays and highlighting:
//  * showDelay is the time (in milliseconds) to display a new child menu.
//    Remember that 1000 milliseconds = 1 second.
//  * switchDelay is the time to switch from one child menu to another child menu.
//    Set this higher and point at 2 neighbouring items to see what it does.
//  * hideDelay is the time it takes for a menu to hide after mouseout.
//    Set this to a negative number to disable hiding entirely.
//  * cssLitClass is the CSS classname applied to parent items of active menus.
//  * showOnClick will, suprisingly, set the menus to show on click. Pick one of 3 values:
//    0 = all mouseover, 1 = first level click, sublevels mouseover, 2 = all click.
//  * hideOnClick hides all visible menus when one is clicked (defaults to true).
//  * animInSpeed and animOutSpeed set the animation speed. Set to a number
//    between 0 and 1 where higher = faster. Setting both to 1 disables animation.

//listMenu.showDelay = 0;
//listMenu.switchDelay = 125;
//listMenu.hideDelay = 500;
//listMenu.cssLitClass = 'highlighted';
//listMenu.showOnClick = 0;
//listMenu.hideOnClick = true;
//listMenu.animInSpeed = 0.2;
//listMenu.animOutSpeed = 0.2;


// Now the fun part... animation! This script supports animation plugins you
// can add to each menu object you create. I have provided 3 to get you started.
// To enable animation, add one or more functions to the menuObject.animations
// array; available animations are:
//  * FSMenu.animSwipeDown is a "swipe" animation that sweeps the menu down.
//  * FSMenu.animFade is an alpha fading animation using tranparency.
//  * FSMenu.animClipDown is a "blind" animation similar to 'Swipe'.
// They are listed inside the "fsmenu.js" file for you to modify and extend :).

// I'm applying two at once to listMenu. Delete this to disable!
listMenu.animations[listMenu.animations.length] = FSMenu.animFade;
//listMenu.animations[listMenu.animations.length] = FSMenu.animSwipeDown;
//listMenu.animations[listMenu.animations.length] = FSMenu.animClipDown;


// Finally, on page load you have to activate the menu by calling its 'activateMenu()' method.
// I've provided an "addEvent" method that lets you easily run page events across browsers.
// You pass the activateMenu() function two parameters:
//  (1) The ID of the outermost <ul> list tag containing your menu data.
//  (2) A node containing your submenu popout arrow indicator.
// If none of that made sense, just cut and paste this next bit for each menu you create.

var arrow = null;
if (document.createElement && document.documentElement)
{
 arrow = document.createElement('span');
 arrow.appendChild(document.createTextNode('>'));
 // Feel free to replace the above two lines with these for a small arrow image...
 //arrow = document.createElement('img');
 //arrow.src = 'arrow.gif';
 //arrow.style.borderWidth = '0';
 arrow.className = 'subind';
}
addEvent(window, 'load', new Function('listMenu.activateMenu("listMenuRoot", arrow)'));


// You may wish to leave your menu as a visible list initially, then apply its style
// dynamically on activation for better accessibility. Screenreaders and older browsers will
// then see all your menu data, but there will be a 'flicker' of the raw list before the
// page has completely loaded. If you want to do this, remove the CLASS="..." attribute from
// the above outermost UL tag, and uncomment this line:
//addEvent(window, 'load', new Function('getRef("listMenuRoot").className="menulist"'));


// To create more menus, duplicate this section and make sure you rename your
// menu object to something different; also, activate another <ul> list with a
// different ID, of course :). You can hae as many menus as you want on a page.

//]]>
