/* Validation for Membership Form*/
		function trim(sString) 
	{
		while (sString.substring(0,1) == ' ')
		{
			sString = sString.substring(1, sString.length);
		}
		while (sString.substring(sString.length-1, sString.length) == ' ')
		{
			sString = sString.substring(0,sString.length-1);
		}
		return sString;
	}
	
	function check_mail(str)
	{
		var strng;
		strng = eval("document.memberFrm."+str);
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(strng.value))
		{
			return (true);
		}
		alert( "Please enter a valid email address." );
		strng.focus();
		return  false;
	}

	
	function checkNum(str)
	{
	  var strng;
	  var valid = "0123456789-."
	  var ok = "yes";
	  var temp;

	  strng = eval("document.memberFrm."+str);
	  //alert(strng.value)
	  var stripped = strng.value.replace(/[\(\)\.\-\ ]/g, '');

	  for (var i=0; i<strng.value.length; i++)
	  {
		    temp = "" + strng.value.substring(i, i+1);
		    if (valid.indexOf(temp) == "-1")
		    ok = "no";
	  }
	  if (ok == "no")
	  {
		    alert("Invalid entry!!! Only numbers are accepted!");
		    strng.value="";
		    strng.focus();
		    return (false);
		}
		if (ok == "yes")
		{
			return (true);
		}
	}
function textCounter(field, countfield, maxlimit ) 
	{
			
		 if (countfield.value.length > maxlimit )
		 {
		    //document.annFrm.content.value=field.value.substring( 0, maxlimit );
			//field.value = field.value.substring( 0, maxlimit );
		    alert( 'Textarea value can only be 200 characters in length.' );
		    return false;
		 }
		 else
  		{
		    countfield.value = maxlimit - field.value.length;
  		}
}
	function validate()
	{
		//var name=document.memberFrm.name.value;
		if(trim(document.memberFrm.name.value) == '')
		{
			alert("Please enter Name");
			document.memberFrm.name.value="";
			document.memberFrm.name.focus();
			return false;
		}
		
		if(trim(document.memberFrm.add.value) == '')
		{
			alert("Please enter Address");
			document.memberFrm.add.value="";
			document.memberFrm.add.focus();
			return false;
		}
		
		if(trim(document.memberFrm.email.value) == '')
		{
			alert("Please enter Email");
			document.memberFrm.email.value="";
			document.memberFrm.email.focus();
			return false;
		}
		
		if(trim(document.memberFrm.postal_code.value) != '')
		{
			if(!checkNum('postal_code'))
		 		return false;
		}
	
		if(trim(document.memberFrm.home_tel.value) != '')
		{
			if(!checkNum('home_tel'))
		 		return false;
		}
		
		if(trim(document.memberFrm.office_tel.value) != '')
		{
			if(!checkNum('office_tel'))
		 		return false;
		}
				
		/*if(trim(document.memberFrm.handphone.value) == '')
		{
			alert("Please enter Handphone");
			document.memberFrm.handphone.value="";
			document.memberFrm.handphone.focus();
			return false;
		}*/
		if(trim(document.memberFrm.handphone.value) != '')
		{
			if(!checkNum('handphone'))
		 		return false;
		}
		
		if(trim(document.memberFrm.pager.value) != '')
		{
			if(!checkNum('pager'))
		 		return false;
		}

		/*if(trim(document.memberFrm.email.value) == '')
		{
			alert("Please enter Email Address");
			document.memberFrm.email.value="";
			document.memberFrm.email.focus();
			return false;
		}*/
		if(trim(document.memberFrm.email.value) != '')
		{
			if(!check_mail('email'))
				return false;
		}
		

		if(trim(document.memberFrm.dd.value) == '')
		{
			alert("Please enter Date");
			document.memberFrm.dd.value="";
			document.memberFrm.dd.focus();
			return false;
		}
		else
		{
			if(!checkNum('dd'))
		 		return false;
		}

		if(trim(document.memberFrm.mm.value) == '')
		{
			alert("Please enter Month");
			document.memberFrm.mm.value="";
			document.memberFrm.mm.focus();
			return false;
		}
		else
		{
			if(!checkNum('mm'))
		 		return false;
		}
		if(trim(document.memberFrm.yyyy.value) == '')
		{
			alert("Please enter Year");
			document.memberFrm.yyyy.value="";
			document.memberFrm.yyyy.focus();
			return false;
		}
		else
		{
			if(!checkNum('yyyy'))
		 		return false;
			var err_flag=0;
			var dd=document.memberFrm.dd.value;
			var mm=document.memberFrm.mm.value;
			var yyyy=document.memberFrm.yyyy.value;

			if(mm > 12 || mm <= 0)
			      err_flag = 1;

			 if(dd <= 0 || dd > 31)
			      err_flag = 1;

			 if(mm == 2)
			 {
				 if(yyyy%4 == 0 && mm == 2)
				 {
					  if(dd > 29) err_flag = 1;
				 }else{
					  if(dd > 28) err_flag = 1;
				 }
			}
			if(yyyy.length != 4) 
				err_flag = 1 ;

			if(err_flag ==1)
			{
				alert("Please enter valid Date");
				document.memberFrm.dd.value="";
				document.memberFrm.mm.value="";
				document.memberFrm.yyyy.value="";
				document.memberFrm.dd.focus();
				return false;
			}		
		}

		if(trim(document.memberFrm.ic_no.value) == '')
		{
			alert("Please enter I/C No.");
			document.memberFrm.ic_no.focus();
				return false;
		}
		if(trim(document.memberFrm.disable.value) == '')
		{
			alert("Please enter Disabilities");
			document.memberFrm.disable.value="";

			document.memberFrm.disable.focus();
			return false;
		}
		if(trim(document.memberFrm.mobility.value) == '')
		{
			alert("Please enter Mobility or other Aids Used");
			document.memberFrm.mobility.value="";

			document.memberFrm.mobility.focus();
			return false;
		}
		
		if(trim(document.memberFrm.reason.value) == '')
		{
			alert("Please enter Reason for joining DPA");
			document.memberFrm.reason.value="";
			document.memberFrm.reason.focus();
			return false;
		}

		if(trim(document.memberFrm.reason.value) == '')
		{
			alert("Please enter Reason for joining DPA");
			document.memberFrm.reason.value="";
			document.memberFrm.reason.focus();
			return false;
		}
		
		document.memberFrm.method = "POST";
		document.memberFrm.submit();
		document.memberFrm.action = "example_process_form.asp";
		return true;
	}

/*Validation Ends here for Membership Form*/

/* Validation for Volunteer form starts here*/

	function validateVol()
	{
		
		var name=document.volunteerFrm.name.value;
		if(trim(name) == '')
		{
			alert("Please enter Name");
			document.volunteerFrm.name.value="";
			document.volunteerFrm.name.focus();
			return false;
		}
		
		if(trim(document.volunteerFrm.add.value) == '')
		{
			alert("Please enter Address");
			document.volunteerFrm.add.value="";
			document.volunteerFrm.add.focus();
			return false;
		}
		
		if(trim(document.volunteerFrm.passport.value) == '')
		{
			alert("Please enter NRIC/Passport No.");
			document.volunteerFrm.passport.value="";
			document.volunteerFrm.passport.focus();
			return false;
		}
		
		if(trim(document.volunteerFrm.dd.value) == '')
		{
			alert("Please enter Date");
			document.volunteerFrm.dd.value="";
			document.volunteerFrm.dd.focus();
			return false;
		}
		else
		{
			if(!checkNum_vol('dd'))
		 		return false;
		}
		if(trim(document.volunteerFrm.mm.value) == '')
		{
			alert("Please enter Month");
			document.volunteerFrm.mm.value="";
			document.volunteerFrm.mm.focus();
			return false;
		}
		else
		{
			if(!checkNum_vol('mm'))
		 		return false;
		}
		if(trim(document.volunteerFrm.yyyy.value) == '')
		{
			alert("Please enter Year");
			document.volunteerFrm.yyyy.value="";
			document.volunteerFrm.yyyy.focus();
			return false;
		}
		else
		{
			if(!checkNum_vol('yyyy'))
		 		return false;
			var err_flag=0;
			var dd=document.volunteerFrm.dd.value;
			var mm=document.volunteerFrm.mm.value;
			var yyyy=document.volunteerFrm.yyyy.value;

			if(mm > 12 || mm <= 0)
			      err_flag = 1;

			 if(dd <= 0 || dd > 31)
			      err_flag = 1;

			 if(mm == 2)
			 {
				 if(yyyy%4 == 0 && mm == 2)
				 {
					  if(dd > 29) err_flag = 1;
				 }else{
					  if(dd > 28) err_flag = 1;
				 }
			}
			if(yyyy.length != 4) 
				err_flag = 1 ;

			 if(err_flag ==1)
			{
				alert("Please enter valid Date");
				document.volunteerFrm.dd.value="";
				document.volunteerFrm.mm.value="";
				document.volunteerFrm.yyyy.value="";
				document.volunteerFrm.dd.focus();
				return false;
			}		
		}
		
		if(trim(document.volunteerFrm.telephone.value) != '')
		{
			if(!checkNum_vol('telephone'))	
				return false;
		}

		if(trim(document.volunteerFrm.email.value) == '')
		{
			alert("Please enter Email Address");
			document.volunteerFrm.email.value="";
			document.volunteerFrm.email.focus();
			return false;
		}
		if(trim(document.volunteerFrm.email.value) != '')
		{
			if(!check_mail_vol('email'))
				return false;
		}
	
	/*
		for (i=0;i<document.volunteerFrm.duration.length;i++) 
		{ 
     		if (document.volunteerFrm.duration[i].checked) 
			{ 
            	rbgroup_value = document.volunteerFrm.duration[i].value; 
		    } 
		} 
	*/
	}
	function abcd1()
	{
		document.getElementById('container').innerHTML='';
	}
	function abcd()
	{
		flag=1;
		var obj="<input name='other_duration' value='others, please specify' type='text' class='inputbox' size='30' maxlength='35' tabindex='<%=tab_count %><%tab_count = tab_count + 1 %>' accesskey=' ' id='other_duration'/>";
		if (flag)
		{
			document.getElementById('container').innerHTML=obj;
		}	
	}
	
	function check_mail_vol(str)
	{
		var strng;
		strng = eval("document.volunteerFrm."+str);
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(strng.value))
		{
			return (true);
		}
		alert( "Please enter a valid email address." );
		strng.focus();
		return  false;
	}

	function checkNum_vol(str)
	{
	  var strng;
	  var valid = "0123456789-."
	  var ok = "yes";
	  var temp;

	  strng = eval("document.volunteerFrm."+str);
	  //alert(strng.value)
	  var stripped = strng.value.replace(/[\(\)\.\-\ ]/g, '');

	  for (var i=0; i<strng.value.length; i++)
	  {
		    temp = "" + strng.value.substring(i, i+1);
		    if (valid.indexOf(temp) == "-1")
		    ok = "no";
	  }
	  if (ok == "no")
	  {
		    alert("Invalid entry!!! Only numbers are accepted!");
		    strng.value="";
		    strng.focus();
		    return (false);
	  }
		if (ok == "yes")
		{
			return (true);
		}
	}


/* Validation for Volunteer form ends here*/


/* Validation for Enquiry form starts */
	
	function checkNum_enq(str)
	{
	  var strng;
	  var valid = "0123456789-."
	  var ok = "yes";
	  var temp;

	  strng = eval("document.frm_FeedBack."+str);
	  //alert(strng.value)
	  var stripped = strng.value.replace(/[\(\)\.\-\ ]/g, '');

	  for (var i=0; i<strng.value.length; i++)
	  {
		    temp = "" + strng.value.substring(i, i+1);
		    if (valid.indexOf(temp) == "-1")
		    ok = "no";
	  }
	  if (ok == "no")
	  {
		    alert("Invalid entry!!! Only numbers are accepted!");
		    strng.value="";
		    strng.focus();
		    return (false);
		}
		if (ok == "yes")
		{
			return (true);
		}
	}
	
	function check_mail_enq(str)
	{
		var strng;
		strng = eval("document.frm_FeedBack."+str);
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(strng.value))
		{
			return (true);
		}
		alert( "Please enter a valid email address." );
		strng.focus();
		return  false;
	}

	function SubmitEnq()
	{
		name=document.frm_FeedBack.txtName.value;
		if(trim(name)=='' || trim(name)=='Enter first name')
		{	
			alert("Please enter first Name");
			document.frm_FeedBack.txtName.value="";
			document.frm_FeedBack.txtName.focus();
			return false;
		}
		lname=document.frm_FeedBack.txtlName.value;
		if(trim(lname)=='' || trim(lname)=='Enter last name')
		{
			alert("Please enter last Name");		
			document.frm_FeedBack.txtlName.value="";
			document.frm_FeedBack.txtlName.focus();
			return false;
		}
		phone=document.frm_FeedBack.txtPhoneNo.value;
		if(trim(phone)!='Enter phone no.')
		{
			if(!checkNum_enq('txtPhoneNo'))
		 		return false;
		}
		if(document.frm_FeedBack.txtlName.value!='')
		{
			if(!check_mail_enq('txtEmailID'))
			   return false;
		}
		//return false;
	}

/* Validation fro Enquiry form ends*/

/* Validation for Donation form starts */

	function validateDonation()
	{
		
		if(!document.donationFrm.anonymous.checked)
		{
		    var name=document.donationFrm.name.value;
		    if(trim(name) == '')
		    {
			    alert("Please enter Name");
			    document.donationFrm.name.value="";
			    document.donationFrm.name.focus();
			    return false;
		    }
    		
		    if(trim(document.donationFrm.add.value) == '')
		    {
			    alert("Please enter Address");
			    document.donationFrm.add.value="";
			    document.donationFrm.add.focus();
			    return false;
		    }
    		
		    if(trim(document.donationFrm.nricno.value) == '')
		    {
			    alert("Please enter NRIC No.");
			    document.donationFrm.nricno.value="";
			    document.donationFrm.nricno.focus();
			    return false;
		    }
    		
		    if(trim(document.donationFrm.telephone.value) != '')
		    {
			    if(!checkNum_vol('telephone'))	
				    return false;
		    }

		    /*if(trim(document.donationFrm.email.value) == '')
		    {
			    alert("Please enter Email Address");
			    document.donationFrm.email.value="";
			    document.donationFrm.email.focus();
			    return false;
		    }*/
		    
		    if(trim(document.donationFrm.email.value) != '')
		    {
			    if(!check_mail_vol('email'))
				    return false;
		    }
		    
		    /*if(trim(document.volunteerFrm.telephone.value) != '')
		    {
			    if(!check_num_don('telephone'))	
				    return false;
		    }*/
		}
	}
	
	function check_mail_don(str)
	{
		var strng;
		strng = eval("document.donationFrm."+str);
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(strng.value))
		{
			return (true);
		}
		alert( "Please enter a valid email address." );
		strng.focus();
		return  false;
	}
	
	function check_num_don(str)
	{
	  var strng;
	  var valid = "0123456789-."
	  var ok = "yes";
	  var temp;

	  strng = eval("document.donationFrm."+str);
	  //alert(strng.value)
	  var stripped = strng.value.replace(/[\(\)\.\-\ ]/g, '');

	  for (var i=0; i<strng.value.length; i++)
	  {
		    temp = "" + strng.value.substring(i, i+1);
		    if (valid.indexOf(temp) == "-1")
		    ok = "no";
	  }
	  if (ok == "no")
	  {
		    alert("Invalid entry!!! Only numbers are accepted!");
		    strng.value="";
		    strng.focus();
		    return (false);
	  }
		if (ok == "yes")
		{
			return (true);
		}
	}



/* Validation for Donation form starts */






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;
			this.animOutSpeed=.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='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))}}