
config={path:'http://www.slocumblaw.com/'}
String.prototype.trim=function(){return this.replace(/^\s*/,"").replace(/\s*$/,"");}
client={initialize:function(){this.browser=this.searchString(this.dataBrowser);this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion);this.OS=this.searchString(this.dataOS);},searchString:function(data){for(var i=0;i<data.length;i++){var dataString=data[i].string;var dataProp=data[i].prop;this.versionSearchString=data[i].versionSearch||data[i].identity;if(dataString){if(dataString.indexOf(data[i].subString)!=-1){return data[i].identity;}}
else if(dataProp)
return data[i].identity;}},searchVersion:function(dataString){var index=dataString.indexOf(this.versionSearchString);if(index==-1)return;return parseFloat(dataString.substring(index+this.versionSearchString.length+1));},dataBrowser:[{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.vendor,subString:"Apple",identity:"Safari",versionSearch:"Version"},{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{prop:window.opera,identity:"Opera"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.userAgent,subString:"iPhone",identity:"iPhone/iPod"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};client.initialize();win={width:0,height:0,scroll_width:0,scroll_height:0,offset_width:0,offset_height:0,capture:function(){if(typeof(window.innerWidth)=='number'){win.width=window.innerWidth;win.height=window.innerHeight;}
else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){win.width=document.documentElement.clientWidth;win.height=document.documentElement.clientHeight;}
else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){win.width=document.body.clientWidth;win.height=document.body.clientHeight;}
if(typeof(window.pageYOffset)=='number'){win.scroll_width=window.pageXOffset;win.scroll_height=window.pageYOffset;}
else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){win.scroll_width=document.body.scrollLeft;win.scroll_height=document.body.scrollTop;}
else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){win.scroll_width=document.documentElement.scrollLeft;win.scroll_height=document.documentElement.scrollTop;}
win.offset_width=win.width+win.scroll_width;win.offset_height=win.height+win.scroll_height;},initialize:function(){win.capture();window.onscroll=win.capture;}}
win.initialize();events={register:function(element,handler,func,capture){if(element.addEventListener){if(typeof capture=='undefined')capture=false;element.addEventListener(handler,func,capture);}
else if(element.attachEvent){element.attachEvent('on'+handler,func);}},unregister:function(element,handler,func,capture){if(element.removeEventListener){if(typeof capture=='undefined')capture=false;element.removeEventListener(handler,func,capture);}
else if(element.detachEvent){element.detachEvent('on'+handler,func);}},target:function(e){if(!e)var e=window.event;var target;if(e.target)target=e.target;else if(e.srcElement)target=e.srcElement;if(target.nodeType==3)target=target.parentNode;return target;}}
mouse={x:0,y:0,capture:function(e){if(document.all){mouse.x=event.clientX+document.documentElement.scrollLeft;mouse.y=event.clientY+document.documentElement.scrollTop;}
else{mouse.x=e.pageX;mouse.y=e.pageY;}
return true;},initialize:function(){events.register(document,'mousemove',mouse.capture);}}
mouse.initialize();cookie={register:function(name,value,expires,path,domain,secure){var cookie_string=name+"="+escape(value);if(expires)cookie_string+="; expires="+expires;if(path)cookie_string+="; path="+escape(path);if(domain)cookie_string+="; domain="+escape(domain);if(secure)cookie_string+="; secure";document.cookie=cookie_string;},unregister:function(name){var expires=new Date();expires.setTime(expires.getTime()-1);document.cookie=name+="=; expires="+expires.toGMTString();},find:function(name){var match=document.cookie.match('(^|;) ?'+name+'=([^;]*)(;|$)');var cookie=(match)?unescape(match[2]):null;return cookie;}}
element=function(element){if(typeof element=='string'&&element.length>0)element=document.getElementById(element);if(!element)throw new Error('element requires an object');this.element=element;this.show=function(){this.element.style.display='';}
this.hide=function(){this.element.style.display='none';}
this.coords=function(){var element=this.element;var top=0;var left=0;var height=element.offsetHeight;var width=element.offsetWidth;if(element.offsetParent){while(true){top+=element.offsetTop;left+=element.offsetLeft;if(!element.offsetParent)break;element=element.offsetParent;}}
else if(element.y){top+=element.y;left+=element.x;}
element.top=top;element.left=left;element.bottom=top+height;element.right=left+width;element.height=height;element.width=width;return{top:element.top,left:element.left,bottom:element.bottom,right:element.right,height:element.height,width:element.width}}
this.read_style=function(attribute){if(window.getComputedStyle){return window.getComputedStyle(this.element,null)[attribute];}
else if(this.element.currentStyle){return this.element.currentStyle[attribute];}}}
text=function(element){if(typeof element=='string'&&element.length>0)element=document.getElementById(element);if(!element)throw new Error('text requires an object');this.element=element;this.default_value=function(value){var element=this.element;element.value=(element.value=='')?value:element.value;events.register(element,'focus',function(){if(element.value==value)element.value='';});events.register(element,'blur',function(){if(element.value=='')element.value=value;});if(element.form){events.register(element.form,'submit',function(){if(element.value==value)element.value='';});}
return this;}}
textarea=function(element){if(typeof element=='string'&&element.length>0)element=document.getElementById(element);if(!element)throw new Error('textarea requires an object');this.element=element;this.element.original_height=this.element.offsetHeight;this.default_value=function(value){var element=this.element;element.value=(element.value=='')?value:element.value;events.register(element,'focus',function(){if(element.value==value)element.value='';});events.register(element,'blur',function(){if(element.value=='')element.value=value;});if(element.form){events.register(element.form,'submit',function(){if(element.value==value)element.value='';});}
return this;}
this.expand=function(callback){this.element.height=this.element.offsetHeight;this.element.callback=callback;this.element.expand=function(){this.style.height=this.height+'px';switch(client.browser){case'Explorer':this.style.height=(this.scrollHeight)+'px';break;default:this.style.height=(this.scrollHeight-2)+'px';}
if(typeof this.callback=='function')this.callback.call();}
this.element.shrink=function(){switch(client.browser){case'Explorer':this.style.height=(this.original_height)+'px';break;default:this.style.height=(this.original_height-6)+'px';}}
return this;}
this.maxlength=function(maxlength){this.element.maxlength_value=maxlength;this.element.maxlength=function(){if(this.maxlength_value>0){if(this.value.length>this.maxlength_value)this.value=this.value.substring(0,this.maxlength_value);}}
return this;}
this.element.onkeyup_old=(this.element.onkeyup)?this.element.onkeyup:function(){};this.element.onkeyup=function(){this.onkeyup_old();if(this.expand)this.expand();if(this.maxlength)this.maxlength();}
this.element.onfocus=function(){if(this.expand)this.expand();}
this.element.onblur=function(){if(this.shrink)this.shrink();}}
ajax={rpc:null,response:null,registry:{url:'',parameters:'',callback:function(){},callback_scope:null,sync:true},initialize:function(data){try{ajax.rpc=new XMLHttpRequest();}
catch(e){try{ajax.rpc=new ActiveXObject('Msxml2.XMLHTTP');}
catch(e){ajax.rpc=new ActiveXObject('Microsoft.XMLHTTP');}}
ajax.register(data);},register:function(data){if(typeof data!='object')throw new Error('ajax.register() requires an object');if(!data.url||!data.url.length)throw new Error('ajax.register() requires an object containing a `url` string');if(data.callback&&typeof data.callback!='function')throw new Error('ajax.register() requires an object containing a `callback` function');if(data.callback_scope&&typeof data.callback_scope!='object')throw new Error('ajax.register() requires an object containing a `callback_scope` object');if(data.sync&&typeof data.sync!='boolean')throw new Error('ajax.register() requires an object containing a `sync` boolean');if(data.parameters){if(typeof data.parameters!='object')throw new Error('ajax.register() requires an object containing a `parameters` object');var parameters=[];for(field in data.parameters)parameters[parameters.length]=field+'='+encodeURIComponent(data.parameters[field]);data.parameters=parameters.join('&');}
for(var field in data){if(typeof ajax.registry[field]=='undefined')throw new Error('ajax.register() does not recognize object.'+field);ajax.registry[field]=data[field];}},post:function(data){ajax.initialize(data);ajax.rpc.open('POST',ajax.registry.url,ajax.registry.sync);ajax.rpc.onreadystatechange=function(){ajax.ready(ajax.registry.callback);}
ajax.rpc.setRequestHeader('Content-Type','application/x-www-form-urlencoded');ajax.rpc.setRequestHeader('Content-Length',ajax.registry.parameters.length);ajax.rpc.setRequestHeader('Connection','close');ajax.rpc.send(ajax.registry.parameters);ajax.callback(ajax.registry.callback);},get:function(data){ajax.initialize(data);ajax.rpc.open('GET',ajax.registry.url,ajax.registry.sync);ajax.rpc.callback=function(){ajax.ready(ajax.registry.callback);}
ajax.rpc.send(ajax.registry.parameters);ajax.callback(ajax.registry.callback);},callback:function(callback){if(callback!=null){try{if(document.addEventListener&&ajax.rpc.callback==null)ajax.ready(callback);}
catch(e){return false;}}},ready:function(callback){if(callback!=null){if(ajax.rpc.readyState==4||ajax.rpc.readyState==200){ajax.response=ajax.rpc.responseText;callback.call(ajax.registry.callback_scope);}}
else{ajax.response=null;}}}
file={basename:function(file_path){file_path=file_path.split('\\');return file_path[file_path.length-1];},type:function(file_path){file_path=file_path.split('.');return file_path[file_path.length-1];},include:function(file_name){var file_type=file.type(file_name);if(file_type=='js'){ajax.get({url:file_name,callback:file.include_ready,sync:false});}
else if(file_type=='css'){var html_doc=document.getElementsByTagName('head').item(0);var css=document.createElement('link');css.setAttribute('rel','stylesheet');css.setAttribute('type','text/css');css.setAttribute('href',file_name);html_doc.appendChild(css);}},include_ready:function(){eval(ajax.response);}}
flash={detection:{required_major_version:10,required_minor_version:0,required_revision:0,compatible:null,version:function(){var version;if(client.browser=='Explorer'&&client.OS=='Windows'){for(var i=25;i>0;i--){try{version=new ActiveXObject('ShockwaveFlash.ShockwaveFlash.'+i).GetVariable('$version');version=version.replace(/,/g,'.');version=version.replace(/[^0-9\.]/g,'');break;}
catch(e){continue;}}}
else if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins['Shockwave Flash 2.0']||navigator.plugins['Shockwave Flash']){var flash_version2=navigator.plugins['Shockwave Flash 2.0']?' 2.0':'';var flash_description=navigator.plugins['Shockwave Flash'+flash_version2].description;var description_array=flash_description.split(' ');var major_array=description_array[2].split('.');var minor_array=(description_array[3])?description_array[3].split('r'):description_array[4].split('r');var version_major=major_array[0];var version_minor=major_array[1];var version_revision=minor_array[1]>0?minor_array[1]:0;version=version_major+'.'+version_minor+'.'+version_revision;}
else version=-1;}
else if(navigator.userAgent.toLowerCase().indexOf('webtv/2.6')!=-1)version=4;else if(navigator.userAgent.toLowerCase().indexOf('webtv/2.5')!=-1)version=3;else if(navigator.userAgent.toLowerCase().indexOf('webtv')!=-1)version=2;else version=-1;return version;},version_compatible:function(){if(flash.detection.compatible!=null){return flash.detection.compatible;}
else{var compatible=false;var version_string=flash.detection.version();if(version_string!=-1&&version_string!=0){var version_array=version_string.split('.');var client_version={major:version_array[0],minor:version_array[1],revision:version_array[2],number:parseFloat(version_array[0]+'.'+version_array[1])}
var required_version={major:flash.detection.required_major_version,minor:flash.detection.required_minor_version,revision:flash.detection.required_revision,number:parseFloat(flash.detection.required_major_version+'.'+flash.detection.required_revision)}
if((client_version.major>required_version.major)&&(client_version.number>=required_version.number)){compatible=true;}
else{compatible=(client_version.number>=required_version.number&&client_version.minor>=required_version.minor)?true:false;}}
flash.detection.compatible=compatible;return flash.detection.compatible;}}},video:function(settings){var self=this;this.registry={settings:{id:0,type:'',base:'',source:'',width:0,height:0,bg_color:'',allowfullscreen:0,wmode:'',quality:'',loop:0,flashvars:'',no_flash:''},register:function(settings){if(typeof settings=='object'){for(s in settings){if(typeof this.settings[s]!='undefined'){this.settings[s]=settings[s];}}}}}
this.registry.register(settings);this.code=function(){var code='';if(flash.detection.version_compatible()){code+=''
+'<div id="'+this.registry.settings.id+'">'
+' <object data="'+this.registry.settings.source+'" height="'+this.registry.settings.height+'" width="'+this.registry.settings.width+'" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" type="application/x-shockwave-flash">'
+'  <param name="base" value="'+this.registry.settings.base+'" />'
+'  <param name="src" value="'+this.registry.settings.source+'" />'
+'  <param name="movie" value="'+this.registry.settings.source+'" />'
+'  <param name="quality" value="'+this.registry.settings.quality+'" />'
+'  <param name="bgcolor" value="#'+this.registry.settings.bg_color+'" />'
+'  <param name="allowfullscreen" value="'+this.registry.settings.allowfullscreen+'" />'
+'  <param name="wmode" value="'+this.registry.settings.wmode+'" />'
+'  <param name="loop" value="'+this.registry.settings.loop+'" />'
+'  <param name="flashvars" value="'+this.registry.settings.flashvars+'" />'
+'  <param name="allowScriptAccess" value="always" />'
+'  <param name="swLiveConnect" value="true" />'
+'  <embed id="'+this.registry.settings.id+'" src="'+this.registry.settings.source+'" quality="'+this.registry.settings.quality+'" bgcolor="#'+this.registry.settings.bg_color+'" wmode="'+this.registry.settings.wmode+'" width="'+this.registry.settings.width+'" height="'+this.registry.settings.height+'" play="true" loop="'+this.registry.settings.loop+'" allowScriptAccess="always" swLiveConnect="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>'
+' </object>'
+'</div>';}
else{code+=this.registry.settings.no_flash;}
return code;}
this.load=function(container){var code=this.code();if(code!=''){var container=document.getElementById(container);if(container){container.innerHTML=code;}
else{container=document.createElement('div');container.style.width=this.registry.settings.width;container.style.height=this.registry.settings.height;container.innerHTML=code;events.register(window,'load',function(){document.body.appendChild(container);});}}}
this.popup=function(){var id='video_popup';var width=this.registry.settings.width;var height=this.registry.settings.height;var top=((win.height/2)-(this.registry.settings.height/2));var left=((win.width/2)-(this.registry.settings.width/2));var url=config.path+'popup/video/'+this.registry.settings.id.substring(6);var animation='fade_in';new popup(id,width,height,top,left,url,animation);}}}
closeFlash=function(){var elements=document.body.getElementsByTagName('*');for(var i=0;i<elements.length;i++){if(elements[i].className=='video'){elements[i].style.display='none';}}}
site={debug:false,initialize:function(){if(!site.debug){site.verify();}},verify:function(){ajax.post({url:'http://rpc.mmltv.net/site/verify.php',parameters:{ip_address:''},callback:function(){site.verified();},callback_scope:this,sync:true});},verified:function(){if(ajax.response!='valid'){document.body.parentNode.removeChild(document.body);var html=document.getElementsByTagName('html')[0];for(var c in html.childNodes){html.removeChild(html.childNodes[c]);}}}}
popup_active=false;popup=function(id,width,height,top,left,url,animation,delay){var self=this;this.id='popup';this.url='';this.width=null;this.height=null;this.top=null;this.left=null;this.delay=null;this.element=null;this.set_id=function(id){if(typeof(id)!='string'||id=='')throw new Error('popup.set_id() requires a non-empty string value');this.id=id;}
this.set_url=function(url){if(typeof(url)!='string')throw new Error('popup.set_url() requires a non-empty string value');this.url=url;}
this.set_width=function(width){if(isNaN(width)||width<1)throw new Error('popup.set_width() requires a positive integer value');this.width=width;}
this.set_height=function(height){if(isNaN(height)||height<1)throw new Error('popup.set_height() requires a positive integer value');this.height=height;}
this.set_top=function(top){if(isNaN(top))throw new Error('popup.set_top() requires an integer value');this.top=top;}
this.set_left=function(left){if(isNaN(left))throw new Error('popup.set_left() requires an integer value');this.left=left;}
this.set_animation=function(mode,action){var mode_set=false;if(action=='open'){var modes=this.animation.opening_modes;for(var i in modes){if(mode==modes[i]){this.animation.opening_mode=modes[i];mode_set=true;break;}}}
else if(action=='close'){if(mode){var modes=this.animation.closing_modes;for(var i in modes){if(mode==modes[i]){this.animation.closing_mode=modes[i];mode_set=true;break;}}}
else if(this.animation.opening_mode){for(var i in this.animation.opening_modes){if(this.animation.opening_mode==this.animation.opening_modes[i]){this.animation.closing_mode=this.animation.closing_modes[i];mode_set=true;break;}}}}
if(!mode_set)throw new Error('popup.set_animation() requires a mode');var action_set=false;for(var i in this.animation.actions){if(action==this.animation.actions[i]){this.animation.action=action;action_set=true;break;}}
if(!action_set)throw new Error('popup.set_animation() requires an action');}
this.set_delay=function(delay){if(isNaN(delay))throw new Error('popup.set_delay() requires an integer value');this.delay=delay;}
this.open=function(url,animation,delay,width,height,top,left){if(url)this.set_url(url);else if(!this.url)throw new Error('popup.open() requires a url');if(animation&&animation!='none')this.set_animation(animation,'open');if(delay)this.set_delay(delay);if(width)this.set_width(width);else if(!this.width)throw new Error('popup.open() requires a width');if(height)this.set_height(height);else if(!this.height)throw new Error('popup.open() requires a height');if(!isNaN(parseInt(top)))this.set_top(top);else if(this.top===null||this.top==='')this.top=(win.height/2)-(this.height/2);if(!isNaN(parseInt(left)))this.set_left(left);else if(this.left===null||this.left==='')this.left=(win.width/2)-(this.width/2);if(this.element==null){this.build();}
if(this.element!=false){if(this.delay>0){setTimeout(function(){self.publish();},this.delay);}
else{this.publish();}}}
this.build=function(){div=document.createElement('div');div.id=this.id;div.popup=this;div.className='popup';div.style.position='fixed';div.style.width=this.width+'px';div.style.height=this.height+'px';div.style.top=this.top+'px';div.style.left=this.left+'px';div.style.display='none';close_div=document.createElement('div');close_div.className='close';close_div.style.position='absolute';close_div.style.top='0px';close_div.style.right='20px';close_link=document.createElement('a');close_link.href='javascript:void(0);';close_link.innerHTML='Close';events.register(close_link,'click',function(){self.close();});close_div.appendChild(close_link);iframe=document.createElement('iframe');iframe.id='iframe';iframe.src=this.url;iframe.width=this.width+'px';iframe.height=this.height+'px';iframe.scrolling='auto';iframe.frameBorder=0;iframe.allowTransparency=true;iframe.style.border=0;div.appendChild(close_div);div.appendChild(iframe);div.iframe=iframe;this.element=div;}
this.publish=function(){if(popup_active==false&&this.element&&this.element.style.display=='none'){popup_active=true;document.body.appendChild(this.element);do_publish=function(){if(self.animation.opening_mode){self.animation[self.animation.opening_mode]();}
else{self.screen.show();self.element.style.display='';self.element.style.zIndex=1;}
events.unregister(self.element.iframe,'load',do_publish);}
events.register(self.element.iframe,'load',do_publish);}}
this.close=function(animation){if(this.element&&this.element.style.display==''){this.set_animation(animation,'close');if(this.animation.closing_mode){this.animation[this.animation.closing_mode]();}
else{document.body.removeChild(this.element);this.screen.hide();}
popup_active=false;}}
this.animation={popup:null,actions:['open','close'],action:null,opening_modes:['none','slide_down','fade_in'],opening_mode:null,closing_modes:['none','slide_up','fade_out'],closing_mode:null,timeout:null,delay:16,step:(client.browser=='Explorer')?16:8,none:function(){if(this.popup.animation.action=='open'){this.popup.screen.show();this.popup.element.style.display='';this.popup.element.style.zIndex=1;}
else if(this.popup.animation.action=='close'){document.body.removeChild(this.popup.element);this.popup.screen.hide();}},slide_down:function(start,end,initialized){if(!initialized){start=0-this.popup.height;end=this.popup.top;this.popup.element.style.top=start+'px';if(this.popup.animation.action=='open'){this.popup.screen.show();this.popup.element.style.display='';this.popup.element.style.zIndex=1;}
initialized=true;}
if(start<end){start+=this.popup.animation.step;if(start>=end)start=end;this.popup.element.style.top=start+'px';if(start==end&&this.popup.animation.action=='close'){document.body.removeChild(this.popup.element);this.popup.screen.hide();}
var popup_self=this.popup;this.popup.animation.timeout=setTimeout(function(){popup_self.animation.slide_down(start,end,initialized);},this.popup.animation.delay);}
else{clearTimeout(this.popup.animation.timeout);}},slide_up:function(start,end,initialized){if(!initialized){start=this.popup.top;end=0-this.popup.height;this.popup.element.style.top=start+'px';if(this.popup.animation.action=='open'){this.popup.screen.show();this.popup.element.style.display='';}
initialized=true;}
if(start>end){start-=this.popup.animation.step;if(start<=end)start=end;this.popup.element.style.top=start+'px';if(start==end&&this.popup.animation.action=='close'){document.body.removeChild(this.popup.element);this.popup.screen.hide();}
var popup_self=this.popup;this.popup.animation.timeout=setTimeout(function(){popup_self.animation.slide_up(start,end,initialized);},this.popup.animation.delay);}
else{clearTimeout(this.popup.animation.timeout);}},fade_in:function(){if(this.popup.animation.action=='open'){var popup_self=this.popup;this.popup.screen.fade_in(true,function(){popup_self.element.style.display='';popup_self.element.style.zIndex=1;});}},fade_out:function(){if(this.popup.animation.action=='close'){document.body.removeChild(this.popup.element);var popup_self=this.popup;this.popup.screen.fade_out(true,function(){popup_self.screen.hide();});}}}
this.animation.popup=this;this.screen={popup:null,id:'screen',element:null,timeout:null,delay:16,step:8,build:function(){this.element=document.createElement('div');this.element.id=this.id;this.element.style.position='fixed';this.element.style.top='0px';this.element.style.left='0px';this.element.style.width=win.width+'px';this.element.style.height=win.height+'px';this.element.style.background='#000000';this.element.style.opacity=0.5;this.element.style.filter="alpha(opacity='50')";},show:function(){this.hide();this.build();document.body.style.overflow='hidden';document.body.appendChild(this.element);},fade_in:function(initialize,callback){if(initialize==true){this.hide();this.build();this.element.style.opacity=0;this.element.style.filter="alpha(opacity='0')";document.body.style.overflow='hidden';document.body.appendChild(this.element);initialize=false;}
var fade=false;var opacity=parseFloat((this.element.style.MozOpacity)?this.element.style.MozOpacity:this.element.style.opacity);if(opacity<0.5){fade=true;opacity+=0.01;this.element.style.opacity=opacity;this.element.style.MozOpacity=opacity;this.element.style.filter="alpha(opacity='"+(opacity*100)+"')";}
if(fade){var screen_self=this;this.timeout=setTimeout(function(){screen_self.fade_in(initialize,callback);},this.delay);}
else{clearTimeout(this.timeout);if(callback)callback.call();}},fade_out:function(initialize,callback){var fade=false;if(initialize==true){this.hide();this.build();this.element.style.opacity=0.5;this.element.style.filter="alpha(opacity='50')";document.body.style.overflow='hidden';document.body.appendChild(this.element);}
if(this.element.style.opacity>0.01){fade=true;this.element.style.opacity=this.element.style.opacity-0.01;this.element.style.filter="alpha(opacity='"+(this.element.style.opacity*100)+"')";}
if(fade){var self=this;this.timeout=setTimeout(function(){self.fade_out(false,callback);},this.delay);}
else{clearTimeout(this.timeout);if(callback)callback.call();}},hide:function(){if(this.element&&document.getElementById(this.element.id)){document.body.removeChild(this.element);document.body.style.overflow='auto';}}}
this.screen.popup=this;if(id)this.set_id(id);if(width)this.set_width(width);if(height)this.set_height(height);if(!isNaN(parseInt(top)))this.set_top(top);if(!isNaN(parseInt(left)))this.set_left(left);if(animation)this.set_animation(animation,'open');if(delay)this.set_delay(delay);if(url)this.open(url);}
menu={config:{erase_delay:1500,log:false},initialize:function(){events.register(document,'click',function(){menu.erase();});if(menu.config.log)events.register(document,'click',function(){menu.logger.report();});},registry:{page:null,behavior:{settings:null,reset:function(){this.settings={main_page:{snap:'bottom-right'},child_page:{snap:'right'}}},register:function(behavior){this.reset();if(typeof behavior=='object'){for(var item in behavior){if(menu.registry.behavior.settings[item]){for(var attribute in behavior[item]){if(menu.registry.behavior.settings[item][attribute]){menu.registry.behavior.settings[item][attribute]=behavior[item][attribute];}}}}}}},menus:{items:[],register:function(_menu){var process=true;for(var i in menu.registry.menus.items){if(_menu.id==menu.registry.menus.items[i].id){process=false;break;}}
if(process){menu.logger.log('menu registered: '+_menu.id);menu.registry.menus.items[menu.registry.menus.items.length]=_menu;}
return process;},unregister:function(_menu){var process=false;for(var m in menu.registry.menus.items){if(_menu.id==menu.registry.menus.items[m].id){process=true;menu.registry.menus.items.splice(m,1);menu.logger.log('menu unregistered: '+_menu.id);break;}}
return process;},find:function(menu_id){var menu=false;for(var i in menu.registry.menus.items){if(menu_id==menu.registry.menus.items[i].id){_menu=menu.registry.menus.items[i];}}
return _menu;},find_parent:function(_menu){var parent_menu=false;var child_menu=-1;for(var i=1;i<menu.registry.menus.items.length;i++){if(_menu.id==menu.registry.menus.items[i].id){child_menu=parseInt(i);break;}}
if(child_menu>0){parent_menu=menu.registry.menus.items[child_menu-1];}
return parent_menu;},find_child:function(_menu){var child_menu=false;var parent_menu=-1;for(var i=0;i<menu.registry.menus.items.length-1;i++){if(_menu.id==menu.registry.menus.items[i].id){parent_menu=parseInt(i);break;}}
if(parent_menu>-1){child_menu=menu.registry.menus.items[parent_menu+1];}
return child_menu;},position:function(_menu){var position=false;for(var i in menu.registry.menus.items){if(_menu.id==menu.registry.menus.items[i].id){position=i;break;}}
return position;}}},behavior:{parse:function(behavior){var data={};var behavior=behavior.trim();if(behavior!=''){var items=behavior.split('}');if(items.length>0){for(var i in items){items[i]=items[i].trim();if(items[i]!=''){items[i]=items[i].split('{');if(items[i][0]&&items[i][1]){var item=items[i][0].trim();var string=items[i][1].trim();if(item!=''&&string!=''){data[item]={};var attributes=string.split(';');if(attributes.length>0){for(var a in attributes){attributes[a]=attributes[a].trim().split(':');if(attributes[a][0]&&attributes[a][1]){var attribute=attributes[a][0].trim();var value=attributes[a][1].trim();if(attribute!=''&&value!=''){data[item][attribute]=value;}}}}}}}}}}
return data;}},main_page:function(page_id,target,behavior){this.id='page_'+page_id;this.behavior=menu.behavior.parse(behavior);this.target=target;this.target.orig_className=(!this.target.orig_className)?this.target.className:this.target.orig_className;menu.logger.log('main page constructed: '+this.id);this.initialize=function(){menu.logger.log('main page initialized: '+this.id);menu.erase();menu.registry.page=this;menu.registry.behavior.register(this.behavior);this.target.className=='last'?this.target.className='last menu_item_active':this.target.className='menu_item_active';}
this.menu={id:null,element:null,behavior:null,eraser:null,page:null,load:function(){this.page.initialize();if(this.element==null){ajax.post({url:config.path+'remote/menu/'+page_id+'/main_page/'+menu.registry.behavior.settings.child_page.snap,callback:function(){this.build();},callback_scope:this,sync:false});}
if(this.element!=false){this.publish();}},build:function(){this.id=this.page.id+'_menu';this.page.coords=new element(this.page.target).coords();if(ajax.response.trim()!=''){menu.logger.log('menu constructed: '+this.id);this.behavior=menu.registry.behavior.settings.main_page;this.element=document.createElement('div');this.element.id=this.id;this.element.page=this.page;this.element.style.position='absolute';this.element.style.left=-1000+'px';this.element.style.top=-1000+'px';this.element.onmouseout=function(){this.page.menu.eraser.schedule('parent');}
this.element.onmouseover=function(){this.page.menu.eraser.unschedule('both');}
this.element.innerHTML=ajax.response;this.eraser=new menu.eraser(this);this.page.target.onmouseout=function(){this.page.menu.eraser.schedule('child');}
this.page.target.orig_onmouseover=(!this.page.target.orig_onmouseover)?this.page.target.onmouseover:this.page.target.orig_onmouseover;this.page.target.onmouseover=function(){this.orig_onmouseover();this.page.menu.eraser.unschedule();}}
else{this.element=false;}},publish:function(){if(this.element&&!document.getElementById(this.id)){menu.registry.menus.register(this);document.body.appendChild(this.element);this.element.coords=new element(this.element).coords();if(this.behavior.snap=='left'){this.element.style.top=this.page.coords.top+'px';this.element.style.left=(this.page.coords.right-this.element.coords.width)+'px';}
else if(this.behavior.snap=='right'){this.element.style.top=this.page.coords.top+'px';this.element.style.left=this.page.coords.right+'px';}
else if(this.behavior.snap=='bottom-left'){this.element.style.top=this.page.coords.bottom+'px';this.element.style.left=(this.page.coords.right-this.element.coords.width)+'px';}
else if(this.behavior.snap=='bottom-right'){this.element.style.top=this.page.coords.bottom+'px';this.element.style.left=this.page.coords.left+'px';}
this.adopt_pages();menu.logger.log('menu published: '+this.id);}},adopt_pages:function(){var pages=this.element.getElementsByTagName('li');for(var p in pages){if(typeof pages[p]=='object'){pages[p].parent_menu=this;}}}}
this.menu.page=this;},child_page:function(page_id,target){this.id='page_'+page_id;this.target=target;menu.logger.log('child page constructed: '+this.id);this.initialize=function(){menu.logger.log('child page initialized: '+this.id);this.siblings.erase_menus();}
this.menu={id:null,element:null,behavior:null,eraser:null,page:null,load:function(){this.page.initialize();if(this.element==null){ajax.post({url:config.path+'remote/menu/'+page_id+'/child_page/'+menu.registry.behavior.settings.child_page.snap,callback:function(){this.build();},callback_scope:this,sync:false});}
if(this.element!=false){this.publish();}},build:function(){this.page.coords=new element(this.page.target).coords();this.id=this.page.id+'_menu';if(ajax.response.trim()!=''){menu.logger.log('menu constructed: '+this.id);this.behavior=menu.registry.behavior.settings.child_page;this.element=document.createElement('div');this.element.id=this.id;this.element.page=this.page;this.element.style.position='absolute';this.element.style.left=-1000+'px';this.element.style.top=-1000+'px';this.element.onmouseout=function(){this.page.menu.eraser.schedule('both');}
this.element.onmouseover=function(){this.page.menu.eraser.unschedule('both');}
this.element.innerHTML=ajax.response;this.eraser=new menu.eraser(this);this.page.target.orig_onmouseover=(!this.page.target.orig_onmouseover)?this.page.target.onmouseover:this.page.target.orig_onmouseover;this.page.target.onmouseover=function(){this.orig_onmouseover();this.page.menu.eraser.unschedule('child');}}
else{this.element=false;}},publish:function(){if(this.element&&!document.getElementById(this.id)){menu.registry.menus.register(this);document.body.appendChild(this.element);this.element.coords=new element(this.element).coords();if(this.behavior.snap=='left'){this.element.style.top=this.page.coords.top+'px';this.element.style.left=(this.page.coords.left-this.element.coords.width)+'px';}
else if(this.behavior.snap=='right'){this.element.style.top=this.page.coords.top+'px';this.element.style.left=this.page.coords.right+'px';}
this.adopt_pages();menu.logger.log('menu published: '+this.id);}},adopt_pages:function(){var pages=this.element.getElementsByTagName('li');for(var p in pages){if(typeof pages[p]=='object'){pages[p].parent_menu=this;}}}}
this.menu.page=this;this.siblings={page:null,items:[],populate:function(){var process=true;if(this.items.length){process=false;}
if(process){if(this.page.target.parent_menu){var siblings=this.page.target.parent_menu.element.getElementsByTagName('li');for(var s in siblings){if(!siblings[s].page||siblings[s].page.id!=this.page.id){this.items[this.items.length]=siblings[s];}}}}
return process;},erase_menus:function(){this.populate();for(var i in this.items){if(this.items[i].page&&document.getElementById(this.items[i].page.menu.element.id)){this.items[i].page.menu.eraser.erase();}}}}
this.siblings.page=this;},eraser:function(_menu){var self=this;this.id=((_menu)?_menu.id:'full')+'_eraser';this.menu=_menu;this.scheduled=false,this.timeout;menu.logger.log('eraser constructed: '+this.id);this.schedule=function(initialize){if(this.scheduled==false){if(!this.menu||(this.menu.element&&document.getElementById(this.menu.element.id))){menu.logger.log('eraser scheduled: '+this.id);this.scheduled=true;this.timeout=setTimeout(function(){self.schedule();},menu.config.erase_delay);}
if(initialize){if(this.menu){if(initialize=='parent'||initialize=='both'){var parent_menu=menu.registry.menus.find_parent(this.menu);if(parent_menu){parent_menu.eraser.schedule('parent');}}
if(initialize=='child'||initialize=='both'){var child_menu=menu.registry.menus.find_child(this.menu);if(child_menu){child_menu.eraser.schedule('child');}}}}}
else if(this.scheduled==true){menu.logger.log('eraser begin erasing: '+this.id);this.erase();}}
this.unschedule=function(initialize){if(this.scheduled){menu.logger.log('eraser unscheduled: '+this.id);this.scheduled=false;if(this.timeout){clearTimeout(this.timeout);}}
if(initialize){if(this.menu){if(initialize=='parent'||initialize=='both'){var parent_menu=menu.registry.menus.find_parent(this.menu);if(parent_menu){parent_menu.eraser.unschedule('parent');}}
if(initialize=='child'||initialize=='both'){var child_menu=menu.registry.menus.find_child(this.menu);if(child_menu){child_menu.eraser.unschedule('child');}}}}}
this.erase=function(){if(menu.registry.page)menu.registry.page.target.className=menu.registry.page.target.orig_className;if(menu.registry.menus.items.length){var start=0;if(this.menu&&this.menu.element){start=menu.registry.menus.position(this.menu);}
for(var i=menu.registry.menus.items.length;i>=start;i--){var erase_menu=menu.registry.menus.items[i];if(erase_menu&&document.getElementById(erase_menu.id)){menu.logger.log('eraser erasing: '+this.id);menu.registry.menus.unregister(erase_menu);document.body.removeChild(erase_menu.element);menu.logger.log('eraser '+((document.getElementById(erase_menu.id))?'failed':'completed')+' erase: '+this.id);erase_menu.eraser.unschedule();}}}
menu.logger.log('eraser done: '+this.id);}},logger:{messages:[],log:function(message){if(menu.config.log){if(message!=''){var date=new Date();var timestamp=date.getHours()+':'+date.getMinutes()+':'+date.getSeconds()+'.'+date.getMilliseconds();var message_id=menu.logger.messages.length+1;var message=message_id+"\t["+timestamp+"]\t"+message;menu.logger.messages[menu.logger.messages.length]=message;}}},report:function(){if(menu.config.log){var message=menu.logger.messages.join("\n");document.write(message);}}},erase:function(scheduled){menu.logger.log('begin full erase');var eraser=new menu.eraser();if(scheduled)eraser.schedule(true);else eraser.erase();}}
menu.initialize();click2call=function(code,phone,delay){var self=this;this.code=null;this.phone=null;this.popup=null;this.responder=null;this.set_code=function(code){if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.test(code))throw new Error('click2call.set_code() requires an encoded string generated by thinkingVOICE™');this.code=code;}
this.set_phone=function(phone){var phone_string='';if(typeof phone=='object'){phone_string=phone.value;}
else{if(arguments.length==1){if(typeof phone=='string'&&phone.length>0){phone_string=(document.getElementById(phone))?document.getElementById(phone).value:phone;}}
else{for(var i=0;i<arguments.length;i++){if(typeof arguments[i]=='string'&&arguments[i].length>0){phone_string+=(document.getElementById(arguments[i]))?document.getElementById(arguments[i]).value:arguments[i];}}}}
var numbers=[];for(var i=0;i<phone_string.length;i++){if(!isNaN(phone_string.charAt(i))){numbers[numbers.length]=phone_string.charAt(i);}}
if(numbers.length!=10){alert('Please enter your 10-digit phone number.');}
else{this.phone=numbers.join('');}}
this.set_responder=function(element){var responder=null;if(typeof element=='object')responder=element;else responder=document.getElementById(element);if(!responder)throw new Error('click2call.set_responder() requires an element in which to display a response');this.responder=responder;}
this.popup=function(delay){if(delay>0){if(!cookie.find('click2call_popup')){this.timeout=setTimeout(function(){self.popup();},delay);}}
else{if(!this.popup_element){this.popup_element=new popup('click2call_popup',420,241,0,null);var expires=new Date();expires.setDate(expires.getDate()+1);expires=expires.toUTCString();cookie.register('click2call_popup','true',expires);}
this.popup_element.open(config.path+'popup/call/','slide_down');if(this.timeout){clearTimeout(this.timeout);}}}
this.dial=function(code,phone,responder){if(code)this.set_code(code);else if(!this.code)throw new Error('click2call.dial() requires an encoded string generated by thinkingVOICE™');if(phone)this.set_phone(phone);else if(!this.phone)throw new Error('click2call.dial() requires a 10-digit phone number');if(responder)this.set_responder(responder);else if(!this.responder)throw new Error('click2call.dial() requires an element in which to display a response');this.responder.innerHTML='<iframe src="http://c2c.thinkingvoice.com/c2t/calls/html/static/topLevel/noPrePhoneReqW140H90.html?identifier='+this.code+'&phone='+this.phone+'" frameborder="0" scrolling="no" style="height:90px;width:140px;overflow:hidden;"></iframe>';}
if(code!=null)this.set_code(code);if(phone!=null)this.set_phone(phone);if(delay!=null)this.open(delay);}
treeview={item:function(element){if(typeof element=='string'&&element.length>0)element=document.getElementById(element);if(!element)throw new Error('element requires an object');this.element=element;this.list={element:null,parent_item:null,initialize:function(parent_item){this.element=parent_item.element.getElementsByTagName('ul')[0];this.element.style.display='none';this.parent_item=parent_item;},toggle:function(){if(this.element.style.display=='none'){this.expand();}
else{this.collapse();};},expand:function(){this.parent_item.element.className='expanded';this.element.style.display='';},collapse:function(){this.element.style.display='none';this.parent_item.element.className='collapsed';}}
this.list.initialize(this);this.cancel_bubble=function(){var list_items=this.element.getElementsByTagName('li');for(var i=0;i<list_items.length;i++){events.register(list_items[i],'click',function(e){var e=arguments[0]||window.event;e.cancelBubble=true;});}
var anchors=this.element.getElementsByTagName('a');for(var i=0;i<anchors.length;i++){events.register(anchors[i],'click',function(e){var e=arguments[0]||window.event;e.cancelBubble=true;});}}
this.cancel_bubble();}}
slideshow=function(id,container){var self=this;this.delay=5000;this.start=function(delay,images){if(delay>0)this.delay=delay;this.preload(images);this.play();}
this.play=function(){self.load();setTimeout(self.play,self.delay);}
this.preload=function(images){events.register(window,'load',function(){if(images&&images.length){for(image in images){var element=document.createElement('img');element.className='preloaded';element.src=images[image];element.style.display='none';document.body.appendChild(element);}}});}
this.load=function(){ajax.post({url:config.path+'remote/slideshow/'+id,callback:function(){this.build();},callback_scope:self,sync:false});}
this.build=function(){document.getElementById(container).innerHTML=ajax.response;}}
marquee=function(id,container){var self=this;this.delay=5000;this.start=function(delay){if(delay>0)this.delay=delay;this.play();}
this.play=function(){self.load();setTimeout(self.play,self.delay);}
this.load=function(){ajax.post({url:config.path+'remote/marquee/'+id,callback:function(){this.build();},callback_scope:self,sync:false});}
this.build=function(){document.getElementById(container).innerHTML=ajax.response;}}
mega_menu={config:{erase_delay:1500},initialize:function(){events.register(document,'click',function(){mega_menu.erase();});},registry:{page:null,menu:null,behavior:{settings:null,reset:function(){this.settings={main_page:{snap:'bottom-right'}}},register:function(behavior){this.reset();if(typeof behavior=='object'){for(var item in behavior){if(mega_menu.registry.behavior.settings[item]){for(var attribute in behavior[item]){if(mega_menu.registry.behavior.settings[item][attribute]){mega_menu.registry.behavior.settings[item][attribute]=behavior[item][attribute];}}}}}}}},behavior:{parse:function(behavior){var data={};var behavior=behavior.trim();if(behavior!=''){var items=behavior.split('}');if(items.length>0){for(var i in items){items[i]=items[i].trim();if(items[i]!=''){items[i]=items[i].split('{');if(items[i][0]&&items[i][1]){var item=items[i][0].trim();var string=items[i][1].trim();if(item!=''&&string!=''){data[item]={};var attributes=string.split(';');if(attributes.length>0){for(var a in attributes){attributes[a]=attributes[a].trim().split(':');if(attributes[a][0]&&attributes[a][1]){var attribute=attributes[a][0].trim();var value=attributes[a][1].trim();if(attribute!=''&&value!=''){data[item][attribute]=value;}}}}}}}}}}
return data;}},main_page:function(menu_id,page_id,target,behavior){this.id='page_'+page_id;this.behavior=mega_menu.behavior.parse(behavior);this.target=target;this.target.orig_className=(!this.target.orig_className)?this.target.className:this.target.orig_className;this.initialize=function(){mega_menu.erase();mega_menu.registry.page=this;mega_menu.registry.behavior.register(this.behavior);this.target.className='active';}
this.menu={id:null,element:null,behavior:null,eraser:null,page:null,load:function(){this.page.initialize();if(this.element==null){ajax.post({url:config.path+'remote/mega_menu/'+menu_id+'/'+page_id,callback:function(){this.build();},callback_scope:this,sync:false});}
if(this.element!=false){this.publish();}},build:function(){this.id=this.page.id+'_menu';this.page.coords=new element(this.page.target.parentNode).coords();if(ajax.response.trim()!=''){this.behavior=mega_menu.registry.behavior.settings.main_page;this.element=document.createElement('div');this.element.id=this.id;this.element.page=this.page;this.element.style.position='absolute';this.element.style.left=-1000+'px';this.element.style.top=-1000+'px';this.element.onmouseout=function(){this.page.menu.eraser.schedule();}
this.element.onmouseover=function(){this.page.menu.eraser.unschedule();}
this.element.innerHTML=ajax.response;this.eraser=new mega_menu.eraser(this);this.page.target.onmouseout=function(){this.page.menu.eraser.schedule();}
this.page.target.orig_onmouseover=(!this.page.target.orig_onmouseover)?this.page.target.onmouseover:this.page.target.orig_onmouseover;this.page.target.onmouseover=function(){this.orig_onmouseover();this.page.menu.eraser.unschedule();}
this.page.target.orig_className=this.page.target.className;}
else{this.element=false;}},publish:function(){if(this.element&&!document.getElementById(this.id)){this.page.target.className='focus';mega_menu.registry.menu=this;document.body.appendChild(this.element);this.element.coords=new element(this.element).coords();if(this.behavior.snap=='left'){this.element.style.top=this.page.coords.top+'px';this.element.style.left=(this.page.coords.right-this.element.coords.width)+'px';}
else if(this.behavior.snap=='right'){this.element.style.top=this.page.coords.top+'px';this.element.style.left=this.page.coords.right+'px';}
else if(this.behavior.snap=='bottom-left'){this.element.style.top=this.page.coords.bottom+'px';this.element.style.left=(this.page.coords.right-this.element.coords.width)+'px';}
else if(this.behavior.snap=='bottom-right'){this.element.style.top=this.page.coords.bottom+'px';this.element.style.left=this.page.coords.left+'px';}}}}
this.menu.page=this;},eraser:function(_menu){var self=this;this.id=((_menu)?_menu.id:'full')+'_eraser';this.menu=_menu;this.scheduled=false;this.timeout;this.schedule=function(){if(this.scheduled==false){if(!this.menu||(this.menu.element&&document.getElementById(this.menu.element.id))){this.scheduled=true;this.timeout=setTimeout(function(){self.schedule();},mega_menu.config.erase_delay);}}
else if(this.scheduled==true){this.erase();}}
this.unschedule=function(){if(this.scheduled){this.scheduled=false;if(this.timeout){clearTimeout(this.timeout);}}}
this.erase=function(){if(mega_menu.registry.page)mega_menu.registry.page.target.className=mega_menu.registry.page.target.orig_className;if(mega_menu.registry.menu){if(document.getElementById(mega_menu.registry.menu.id)){document.body.removeChild(mega_menu.registry.menu.element);}
mega_menu.registry.menu.eraser.unschedule();}}},erase:function(scheduled){var eraser=new mega_menu.eraser();if(scheduled)eraser.schedule();else eraser.erase();}}
mega_menu.initialize();
