﻿var _A=0,_I=0,goURL,lsh='',pageint,work=1,curImg='',d=document;if(d.getElementById)_I=1;if(d.all&&!window.opera)_A=1;
function DOM(i,s){if(s)return DOM(i).style;if(_I)return d.getElementById(i);if(_A)return d.all[i];return d.layers[i]}
function AC(a,b){a.appendChild(b)}function RC(a,b){return a.removeChild(b)}function IB(a,b,c){a.insertBefore(b,c)}
function IAH(a,p,b){if(_A)a.insertAdjacentHTML(p,b);else{var r=a.ownerDocument.createRange();r.setStartBefore(a);b=r.createContextualFragment(b);switch(p){case'beforeBegin':IB(a.parentNode,b,a);break;case'afterBegin':IB(a,b,a.firstChild);break;case'afterEnd':if(a.nextSibling)IB(a,b,a.nextSibling);else AC(a.parentNode,b);break;default:return AC(a,b)}}}
function cOpac(ob,a){if(_A)ob.filter='progid:DXImageTransform.Microsoft.Alpha(opacity='+a+')';else ob.opacity=''+(a/100)}function fPX(s){return s.substr(0,s.length-2)-0}
function GHTTP(){if(window.XMLHttpRequest){var h=new XMLHttpRequest();if(h.overrideMimeType)h.overrideMimeType('text/xml');return h}if(window.ActiveXObject){try{return new ActiveXObject('Msxml2.XMLHTTP')}catch(e){try{return new ActiveXObject('Microsoft.XMLHTTP')}catch(e){}}}work=0;return 0}
var mnu=new Array(),imlurl;
function prep(){imlurl=DOM('imager2').src;var m=DOM('menu'),i=m.firstChild,j=0;while(i){if(i.tagName=='A'){i.onmouseover=mo;i.onmouseout=mf;i.onclick=mc;i.p=0;i.style.paddingRight='0px';mnu[j]=i;i.j=j;j++}i=i.nextSibling}if(!CH()){proc(DOM('content2'));procB(DOM('content2'));if(DOM('gallery'))homeSpecial()}setInterval('CCH()',400)}
function mo(e){e=e?e.target:window.event.srcElement;try{clearInterval(e.inv)}catch(e){}e.style.color='#994433';e.inv=setInterval('mo2('+e.j+')',20)}function mo2(j){var t=mnu[j];if(t.p>=6)clearInterval(t.inv);else t.p++;t.style.paddingRight=t.p+"px"}
function mf(e){e=e?e.target:window.event.srcElement;try{clearInterval(e.inv)}catch(e){}e.style.color='#333333';e.inv=setInterval('mf2('+e.j+')',20)}function mf2(j){var t=mnu[j];if(t.p<=0)clearInterval(t.inv);else t.p--;t.style.paddingRight=t.p+"px"}
function mc(e){e=e?e.target:window.event.srcElement;return !SP(e.getAttribute('href'))}
var ldi=null,ldh=0,ldw=960,ldf=590,ldt=20,llg=0,torep='';
function CCH(){if(work)if(GH()!=lsh)CH()}
function CH(){lsh=GH();var t=GHpg();if(t!=curURL&&(t!=''||curURL!=meURL))SP(t);t=GHim();if(t!=curImg){if(t=='')HI();else SI(t)}}
function GH(){var h=window.location.hash;if(h.charAt(0)=='#')return h.substr(1);return h}
function GHpg(){var h=GH();if(h.indexOf('/image/')==-1)return h;return h.substr(0,h.indexOf('/image/'))}
function GHim(){var h=GH();if(h.indexOf('/image/')==-1)return '';h=h.substr(h.indexOf('/image/')+7);if(h.indexOf('://')==-1)return h;return ''}
function SH(url,im){if(url.indexOf('://')!=-1)url=url.substr(url.indexOf('/',url.indexOf('://')+3));if(im.indexOf('://')!=-1)im=im.substr(im.indexOf('/',im.indexOf('://')+3));if(im!='')url+='/image/'+im;if(url=='')url=meURL;window.location.hash=lsh=url}
function SP(url){if(llg)return;if(url==curURL)return 1;work=0;goURL=url;llg=1;var h=GHTTP();if(!h)return 0;h.onreadystatechange=function(){if(h.readyState!=4)return;torep=h.responseText;if(!llg)CL();llg=0};h.open('GET',url+'?raw',true);h.send(null);DOM('loadCont',1).display='block';var a=DOM('loader',1);a.top=ldt+'px';a.height=ldh+'px';try{clearInterval(ldi)}catch(e){}ldi=setInterval('ldh=Math.min(ldf,ldh+40);var t=DOM("loader",1);cOpac(t,ldh*100/ldf);t.height=ldh+"px";if(ldh==ldf){clearInterval(ldi);if(!llg)CL();llg=0}',20);return 1}
function SI(url){curImg=url;SH(curURL,url);DOM('imgCont',1).display='block';DOM('imager2').src=imlurl;setTimeout('DOM("imager2").src="'+url.replace('"','&quot;')+'"',100);var a=DOM('imager',1);a.top=ldt+'px';a.height=ldh+'px';try{clearInterval(ldi)}catch(e){}ldi=setInterval('ldh=Math.min(ldf,ldh+40);var t=DOM("imager",1);cOpac(t,ldh*100/ldf);t.height=ldh+"px";if(ldh==ldf)clearInterval(ldi)',20);return 1}
function HI(){curImg='';SH(curURL,'');var a=DOM('imager',1);a.top=ldt+'px';a.height=ldh+'px';try{clearInterval(ldi)}catch(e){};ldi=setInterval('ldh=Math.max(0,ldh-40);var t=DOM("imager",1);cOpac(t,ldh*100/ldf);t.height=ldh+"px";if(ldh==0){DOM("imgCont",1).display="none";clearInterval(ldi)}',20)}
function CL(){if(torep.indexOf('<div id="content2">')!=-1){try{clearInterval(pageint)}catch(e){}RC(DOM('content'),DOM('content2'));IAH(DOM('content'),'beforeEnd',torep);if(DOM('gallery'))homeSpecial();proc(DOM('content2'));curURL=goURL;SH(curURL,'');work=1}llg=0;var a=DOM('loader',1);a.top=(ldt+ldf-ldh)+'px';a.height=ldh+'px';try{clearInterval(ldi)}catch(e){};ldi=setInterval('ldh=Math.max(0,ldh-40);var t=DOM("loader",1);cOpac(t,ldh*100/ldf);t.height=ldh+"px";t.top=(ldt+ldf-ldh)+"px";if(ldh==0){DOM("loadCont",1).display="none";clearInterval(ldi);procB(DOM("content2"))}',20)}
function CLP(){if(llg)return;llg=1;var a=DOM('loader',1);a.top=ldt+'px';a.height=ldh+'px';try{clearInterval(ldi)}catch(e){};ldi=setInterval('ldh=Math.max(0,ldh-40);var t=DOM("loader",1);cOpac(t,ldh*100/ldf);t.height=ldh+"px";if(ldh==0){DOM("loadCont",1).display="none";clearInterval(ldi)}',20)}
function proc(o){var i=o.firstChild;while(i){if(i.tagName){if(i.tagName=='A'){if(i.getAttribute('href').indexOf('mailto:')==-1){if(i.getAttribute('href').lastIndexOf('.')>i.getAttribute('href').lastIndexOf('/'))proc3(i);else proc2(i)}}else proc(i)}i=i.nextSibling}}
function proc2(o){o.onclick=function(e){e=e?e.target:window.event.srcElement;while(e.tagName!='A')e=e.parentNode;return !SP(e.getAttribute('href'))}}
function proc3(o){o.onclick=function(e){e=e?e.target:window.event.srcElement;while(e.tagName!='A')e=e.parentNode;return !SI(e.getAttribute('href'))}}
function procB(o){var i=o.firstChild;while(i){if(i.tagName){if(i.tagName=='IMG'&&i.className=='googmap')procB2(i);else procB(i)}i=i.nextSibling}}
function procB2(o){var w=o.getAttribute('mwidth'),h=o.getAttribute('mheight'),s=o.getAttribute('msrc'),p=o.parentNode;IAH(o,'beforeBegin','<div class="noprint" style="padding-right:2px;margin-top:20px"><iframe width="'+w+'" height="'+h+'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'+s+'" style="border:1px solid #666666"></iframe></div>');o.className='print'}

var galSW=50-(_A?3:0),galMW=165-(_A?2:0),galBW=395,galMax=galMW*3,galCur,galo,galany=0,galspeed=0.2;
galupd=function(){if(!galany)return;galany=0;var ttl=0,t,i=galo.firstChild;while(i){if(i.className=='homeitem'){if(i.p!=i.pp){galany=1;if(i.p>i.pp-1.1&&i.p<i.pp+1.1)i.p=i.pp;else i.p=i.p*(1-galspeed)+i.pp*galspeed}t=Math.round(i.p);if(ttl+t>galMax-3)i.style.width=(galMax-ttl)+'px';else i.style.width=t+'px';ttl+=t}i=i.nextSibling}}
galmo=function(e){e=e?e.target:window.event.srcElement;while(!e.pp){if(!e.parentNode)return;e=e.parentNode}e.pp=galBW;galany=1}
galmf=function(e){e=e?e.target:window.event.srcElement;while(!e.pp){if(!e.parentNode)return;e=e.parentNode}if(e.pp==galBW){e.pp=galSW;galany=1}}
function homeSpecial(){galo=DOM('gallery');galo.onmouseover=function(e){var i=galo.firstChild,j,t;while(i){if(i.className=='homeitem')if(i.pp==galMW)i.pp=galSW;i=i.nextSibling};galany=1};galo.onmouseout=function(e){var i=galo.firstChild,j,t;while(i){if(i.className=='homeitem')i.pp=galMW;i=i.nextSibling};galany=1};var j,t,i=galo.firstChild;while(i){if(i.className=='homeitem'){i.style.width=galMW+'px';i.onmouseover=galmo;i.onmouseout=galmf;i.p=i.pp=galMW;j=i.firstChild;while(j){if(j.tagName=='DIV')j.style.display='none';if(j.tagName=='P'){j.onmouseover=galmo;j.onmouseout=galmf;t=j.style;t.display='block';t.position='static';t.marginLeft='200px';t.marginTop='5px';t.width='190px'}j=j.nextSibling}}i=i.nextSibling}pageint=setInterval('galupd()',20)}
