var IframeObserver=Class.create(Abstract.TimedObserver,{getValue:function(){try{var iframeWindow=(this.element.contentWindow||this.element.contentDocument.defaultView);var iframeHtmlElement=iframeWindow.document.documentElement;var iframeContentHeight=(document.all)?iframeWindow.document.body.scrollHeight+50:iframeHtmlElement.offsetHeight;var parent=this.element.parentNode;return iframeContentHeight+parent.getWidth();}catch(e){}}});var DynamicIframe=Class.create({initialize:function(iframe){this.iframe=$(iframe);this.parent=this.iframe.parentNode;Event.observe(this.iframe,'load',this.resizeIframe.bind(this));if(Prototype.Browser.IE6){}
else{Event.observe(this.iframe,'resize',this.resizeIframe.bind(this));}
Event.observe(this.iframe,'load',this.scrollToTop.bind(this));},scrollToTop:function(){$(parent).window.scrollTo(0,0);},resizeIframe:function(){var parentDimensions=$(this.parent).getDimensions();$(this.iframe).setStyle({'width':"100%",'overflow':"hidden"});try{var iframeWindow=(this.iframe.contentWindow||this.iframe.contentDocument.defaultView);var iframeHtmlElement=iframeWindow.document.documentElement;var iframeContentHeight=(document.all)?iframeWindow.document.body.scrollHeight+50:iframeHtmlElement.offsetHeight;$(this.iframe).setStyle({'height':iframeContentHeight+"px"});}catch(e){}
if(!this.iframe.resizeListener)this.iframe.resizeListener=new IframeObserver(this.iframe,0.2,this.resizeIframe.bindAsEventListener(this));}});var LPMenu=Class.create({initialize:function(menuElement){this.menuElement=$(menuElement);if(this.menuElement){this.initULElement(this.menuElement);}},initULElement:function(ul){var self=this;ul.childElements().each(function(li){li.parentUl=ul;var subUl=li.getElementsBySelector("ul").first();if(subUl){li.subUl=subUl;subUl.hide();subUl.parentLi=li;self.initULElement(subUl);}
var link=self.getMenuItemLink(li);if(link){if(link.hash)Event.observe(link,"click",function(){subUl.toggle();});if(link.href==document.location.href){self.activateMenuItem(li);}}});},getMenuItemLink:function(li){return li.getElementsBySelector("a").first();},activateMenuItem:function(itemId){var li=$(itemId);if(li)
this.activate(li);},activate:function(li){if(this.oldMenuItem)
this.deactivate(this.oldMenuItem);this.openPath(li);var link=this.getMenuItemLink(li);if(link)
link.addClassName("active");this.oldMenuItem=li;},deactivate:function(li){var link=this.getMenuItemLink(li);if(link)link.removeClassName("active");this.closePath(li);},openPath:function(li){li.parentUl.show();if(li.subUl)li.subUl.show();if(li.parentUl.parentLi)this.openPath(li.parentUl.parentLi);},closePath:function(li){if(li.subUl)li.subUl.hide();if(li.parentUl.parentLi)this.closePath(li.parentUl.parentLi);}});function editPage(){var currentLocation=document.location.href;if(currentLocation.indexOf('?')>0){document.location.href=currentLocation+"&"+"edit=true";}
else{document.location.href=currentLocation+"?"+"edit=true";}}
function openWindow(url,target,options){window.open(url,'_blank','');return false;}
function isValidEmail(email){var isValid=email!=""&&email.match(/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i);return isValid;}
