DW={rgb:[[25,26,25],[255,255,240]],contentFade:false,lastImageFade:false,portfolioFade:false,init:function(){var watchBG=function(){var ratiob=document.body.offsetHeight/document.body.offsetWidth,cnt=1,mybg,ratioi,el=document.getElementById('imgs').getElementsByTagName('img'),l=el.length,c=0;for(c=0;c<l;c++){mybg=el[c];ratioi=mybg.offsetHeight/mybg.offsetWidth
if(ratiob<ratioi){mybg.style.width="100%";mybg.style.height="auto";mybg.style.left="0px";mybg.style.marginLeft="0px";mybg.style.top="50%";mybg.style.marginTop='-'+(Math.round(mybg.offsetHeight/2))+'px';}else{mybg.style.width="auto";mybg.style.height="100%";mybg.style.left="50%";mybg.style.marginLeft='-'+(Math.round(mybg.offsetWidth/2))+'px';mybg.style.top="0px";mybg.style.marginTop='0px';}}},watchFrag=function(){if(window.location.hash!=DW.hash){DW.revealLocation();}};if(location.href.split("danawolterinteriors.com/").length>1&&location.href.split("danawolterinteriors.com/")[1]!=''&&location.href.split("danawolterinteriors.com/")[1].indexOf("#")==-1){location.href="/#/"+location.href.split("danawolterinteriors.com/")[1].replace(/\/comment-page.*/,'');}
if(location.href.split('#').length>1){document.body.className+=' preload';}
window.onresize=watchBG;window.onload=function(){if(location.href.split('#').length==1){watchBG();DW.crossfadeHomeImages();}
DW.initNav();DW.revealLocation();setInterval(watchFrag,1000);}}(),reinit:function(){var a=document.getElementsByTagName('img'),l=a.length,c;if(document.getElementById('page_portfolio')){DW.initPortfolio();}
if(document.getElementById('page_about')){DW.initAbout();}
if(document.getElementById('blog-page')){DW.initBlog();}else{DW.initNonBlog();}
if(document.getElementById('imgs')){document.getElementById('home_logo').onclick=document.getElementById('imgs').onclick=DW.loadHome;}},initBlog:function(){var m=document.getElementById('main'),c=0,tmp=DW.rgb[1],fadeBG=function(){var again=false;if(tmp[0]>DW.rgb[0][0]){tmp[0]-=10;again=true;}
if(tmp[1]>DW.rgb[0][1]){tmp[1]-=10;again=true;}
if(tmp[2]>DW.rgb[0][2]){tmp[2]-=10;again=true;}
if(again){document.getElementById('main').style.background='rgb('+tmp[0]+','+tmp[1]+','+tmp[2]+')';setTimeout(fadeBG,1);}else{document.getElementById('main').style.background='rgb('+DW.rgb[0][0]+','+DW.rgb[0][1]+','+DW.rgb[0][2]+')';}};DW.rgb[0]=[25,26,25];fadeBG();},initNonBlog:function(){var m=document.getElementById('main'),c=0,tmp=DW.rgb[0],fadeBG=function(){var again=false;if(tmp[0]<DW.rgb[1][0]){tmp[0]+=10;again=true;}
if(tmp[1]<DW.rgb[1][1]){tmp[1]+=10;again=true;}
if(tmp[2]<DW.rgb[1][2]){tmp[2]+=10;again=true;}
if(again){document.getElementById('main').style.background='rgb('+tmp[0]+','+tmp[1]+','+tmp[2]+')';setTimeout(fadeBG,1);}else{document.getElementById('main').style.background='rgb('+DW.rgb[1][0]+','+DW.rgb[1][1]+','+DW.rgb[1][2]+')';}};DW.rgb[1]=[255,255,240];if(document.getElementById('main').style.background!=''){fadeBG();}},initAbout:function(){return false;},initPortfolio:function(){var pf=document.getElementById('page_portfolio'),a,c,l,w,h,nw,nh,pc=0,cc=0,mx=0,my=0,tmp,tmp2,getPrev=function(){var pf=document.getElementById('page_portfolio'),ims=pf.getElementsByTagName('img'),l=ims.length,c=0,curc=0,cur=ims[0],nex=ims[ims.length-1];for(c;c<l;c++){if(ims[c].className.indexOf('current')!=-1){cur=ims[c];curc=c;ims[c].className='';}}
if(cur!==ims[0]){nex=ims[curc-1];document.getElementById('curno').innerHTML=curc-1;curc=curc;}else{document.getElementById('curno').innerHTML=1;curc=ims.length;}
document.getElementById('curno').innerHTML=curc;nex.className='current';DW.fadeOut(cur,function(){DW.fadeIn(nex)});},getNext=function(){var pf=document.getElementById('page_portfolio'),ims=pf.getElementsByTagName('img'),l=ims.length,c=0,curc=0,cur=ims[0],nex=ims[1];for(c;c<l;c++){if(ims[c].className.indexOf('current')!=-1){cur=ims[c];ims[c].className='';curc=c;}}
if(cur!==ims[0]){if(curc+1<ims.length){nex=ims[curc+1];curc=curc+1;}else{nex=ims[0];curc=0;}}else{curc=1;}
document.getElementById('curno').innerHTML=curc+1;nex.className='current';DW.fadeOut(cur,function(){DW.fadeIn(nex)});};if(pf){document.getElementById('page_portfolio').style.paddingTop="20px";if(navigator.userAgent.indexOf('MSIE 6')!==-1){document.body.className=document.body.className.replace(' js','');a=pf.getElementsByTagName('img');l=a.length;for(c=0;c<l;c++){a[c].style.filter='none';}
return;}
pf.innerHTML=pf.innerHTML.replace(/<\/?[aApP].*?>/g,'');a=pf.getElementsByTagName('img');l=a.length;document.getElementById('page_portfolio').background='url('+document.getElementById('nav').getElementsByTagName('h1')[0].getElementsByTagName('a')[0].getAttribute('href')+'wp-content/themes/dataperk/images/loading.gif) no-repeat center';for(c=0;c<l;c++){pf=a[c];pf.style.position="absolute";pf.style.left="50%";pf.onload=function(){this.style.marginLeft="-"+Math.round(this.offsetWidth/2)+'px';}
if(c>0){pf.style.opacity=0;pf.style.filter='alpha(opacity=0)';}else{pf.className='current';}}
pf=document.createElement('div');pf.innerHTML='&laquo; Previous';pf.onclick=getPrev;pf.style.position="absolute";pf.style.top="0px";pf.style.left="0px";pf.style.cursor="pointer";document.getElementById('page_portfolio').appendChild(pf);pf=document.createElement('div');pf.innerHTML='Next &raquo;';pf.onclick=getNext;pf.style.position="absolute";pf.style.top="0px";pf.style.right="0px";pf.style.cursor="pointer";document.getElementById('page_portfolio').appendChild(pf);pf=document.createElement('div');pf.innerHTML='<span id="curno">1</span>/'+(c);pf.style.position="absolute";pf.style.top="0px";pf.style.left="50%";document.getElementById('page_portfolio').appendChild(pf);pf.style.marginLeft="-"+Math.round(pf.offsetWidth/2)+'px';}},initNav:function(){var nv=document.getElementsByTagName('*'),atmp=false,atmp_c,a=[],c,l=nv.length;DW.reinit();for(c=0;c<l;c++){if(nv[c]&&nv[c].className&&nv[c].className.indexOf('hijackable')!=-1){atmp=nv[c].getElementsByTagName('a');for(atmp_c=0;atmp_c<atmp.length;atmp_c++){a[a.length]=atmp[atmp_c];}}}
l=a.length;for(c=0;c<l;c++){a[c].onclick=function(e){var t;e=e||event;t=e.target||e.srcElement;DW.fadeOut(document.getElementById('content'));DW.contentFade=true;if(t.nodeName.toLowerCase()!='a'){while(t.nodeName.toLowerCase()!='a'&&t.parentNode){t=t.parentNode;}}
if(t.innerHTML.toLowerCase()=='blog'){return;}
if(t.getAttribute('href')){e.cancelBubble=true;e.returnValue=false;if(e.preventDefault){e.preventDefault();e.stopPropagation();}
location.href='#'+t.getAttribute('href').replace(/http:\/\/.*?\//,'/').replace(/http:\/\/www.danawolterinteriors.com\//,'/');setTimeout(DW.revealLocation,600);}};}},loadHome:function(thendo){var i,all=[document.getElementById('border_top'),document.getElementById('border_bottom')],undef,l=location.href.split('#');clearInterval(DW.cfint);clearTimeout(DW.sto1);clearTimeout(DW.sto2);clearTimeout(DW.sto3);for(i=0;i<all.length;i++){if(i<all.length-1||!thendo){if(thendo!=undef&&typeof thendo=='function'){DW.showContent(all[i],false);}else{DW.showContent(all[i]);}}else{DW.showContent(all[i],thendo);}}},revealLocation:function(fb){var l=location.href.split('#');DW.hash=window.location.hash;(function(){var _gaq=_gaq||[];_gaq.push(['_setAccount','UA-16453914-1']);_gaq.push(['_trackPageview',DW.hash.replace("#",'')]);(function(){var ga=document.createElement('script');ga.type='text/javascript';ga.async=true;ga.src=('https:'==document.location.protocol?'https://ssl':'http://www')+'.google-analytics.com/ga.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(ga,s);})();})();if(l.length>1){if(document.body.className.indexOf('haspage')!==-1){}else{document.body.className+=' haspage';}
DW.loadHome(function(){var l=location.href.split('#'),xhr=false;try{if(window.XMLHttpRequest&&!(window.ActiveXObject)){try{xhr=new XMLHttpRequest();}catch(err){}}else if(window.ActiveXObject){try{xhr=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{xhr=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}}
if(xhr){xhr.onreadystatechange=function(){var l=location.href.split('#');if(xhr.readyState==4){if(xhr.status==200){if(document.getElementById('page_portfolio')){document.getElementById('page_portfolio').parentNode.removeChild(document.getElementById('page_portfolio'));}
if(document.getElementById('page_portfolio_cont')){document.getElementById('page_portfolio_cont').parentNode.removeChild(document.getElementById('page_portfolio_cont'));}
document.getElementById('content').innerHTML=xhr.responseText.substring(xhr.responseText.indexOf('<!-- PAGE -->'),xhr.responseText.indexOf('<!-- ENDPAGE -->'));if(document.getElementById('main').style.opacity!=1){DW.fadeIn(document.getElementById('main'),function(){DW.contentFade=false;});}
if(document.getElementById('content').style.opacity!=1){DW.fadeIn(document.getElementById('content'),function(){DW.contentFade=false;});}
document.getElementById('main').style.filter='none';DW.initNav();}else{location.href=l[1];return;}}};xhr.open("GET",l[1],true);xhr.send('');}else{location.href=l[1];return;}}catch(err){location.href=l[1];}});}},watchBGload:function(el){var ratiob=document.body.offsetHeight/document.body.offsetWidth,cnt=1,mybg=el,ratioi;ratioi=mybg.offsetHeight/mybg.offsetWidth
if(ratiob<ratioi){mybg.style.width="100%";mybg.style.height="auto";mybg.style.left="0px";mybg.style.marginLeft="0px";mybg.style.top="50%";mybg.style.marginTop='-'+(Math.round(mybg.offsetHeight/2))+'px';}else{mybg.style.width="auto";mybg.style.height="100%";mybg.style.left="50%";mybg.style.marginLeft='-'+(Math.round(mybg.offsetWidth/2))+'px';mybg.style.top="0px";mybg.style.marginTop='0px';}},getStyle:function(el,style){if(el){if(el.currentStyle){return el.currentStyle[style];}else if(document.defaultView){return document.defaultView.getComputedStyle(el,null).getPropertyValue(style);}}else{return false;}},fadeIn:function(el,thendo){if(document.body.className.indexOf('MSIE')!==-1){if(el){el.style.filter='progid:DXImageTransform.Microsoft.Fade(duration=1.0,overlap=0.5)';el.style.visibility="hidden";el.filters[0].Apply();el.style.visibility="visible";el.filters[0].play();el.style.filter='none';}
setTimeout(function(){if(thendo){thendo.call();}},1000);return;}
var fadest=0,disp,doFadeIn=function(){if(fadest<100){disp=DW.getStyle(el,'display');el.style.display='none';el.style.opacity=(fadest/100);el.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity="+fadest+")";el.style.display=disp;fadest+=10;setTimeout(doFadeIn,5);}else{el.style.opacity=1;el.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=100)";el.style.filter='none';el.fi=false;if(thendo){thendo.call();}}};if(el.fi===true){return;}
if(!el.fo){el.fi=true;doFadeIn();}else{el.fi=false;setTimeout(doFadeIn,10);}},fadeOut:function(el,thendo){if(document.body.className.indexOf('MSIE')!==-1){if(el){el.style.filter='progid:DXImageTransform.Microsoft.Fade(duration=1.0,overlap=0.5)';el.style.visibility="visible";el.filters[0].Apply();el.style.visibility="hidden";el.filters[0].play();el.style.filter='none';}
setTimeout(function(){if(thendo){thendo.call();}},1000);return;}
var fadest=100,disp,doFadeOut=function(){if(fadest>0){disp=DW.getStyle(el,'display');el.style.display='none';el.style.opacity=(fadest/100);el.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity="+fadest+")";el.style.display=disp;fadest-=10;setTimeout(doFadeOut,5);}else{el.style.opacity=0;el.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=0)";el.fo=false;if(thendo){thendo.call();}}};if(el.fo===true){return false;}
if(!el.fi){el.fo=true;doFadeOut();}else{el.fo=false;setTimeout(doFadeOut,10);}},showContent:function(el,thendo){var way=0,gotoh=document.body.offsetHeight/2+1,undef,rgb_tmp=DW.rgb[0],doColor=function(){var tc,undef;if(rgb_tmp[0]!=DW.rgb[1][0]||rgb_tmp[1]!=DW.rgb[1][1]||rgb_tmp[2]!=DW.rgb[1][2]){for(tc=0;tc<3;tc++){if(DW.rgb[0][tc]+5<DW.rgb[1][tc]){if(rgb_tmp[tc]+=5<DW.rgb[1][tc]){rgb_tmp[tc]+=5;}else{rgb_tmp[tc]=DW.rgb[1][tc];}}else if(DW.rgb[0][tc]-5>DW.rgb[1][tc]){if(rgb_tmp[tc]-=5>DW.rgb[1][tc]){rgb_tmp[tc]-=5;}else{rgb_tmp[tc]=DW.rgb[1][tc];}}else{rgb_tmp[tc]=DW.rgb[1][tc];}}
el.style.background='rgb('+rgb_tmp[0]+','+rgb_tmp[1]+','+rgb_tmp[2]+')';setTimeout(doColor,10);}else{el.style.background='rgb('+DW.rgb[1][0]+','+DW.rgb[1][1]+','+DW.rgb[1][2]+')';document.body.className+=' preload';if(thendo!=undef){if(typeof thendo=='function'){thendo.call();}}else{DW.fadeIn(document.getElementById('main'));}}},doFull=function(){var done=false,tc=0,disp,offheight;if(DW.lastImageFade===true){if(el.offsetHeight+10<gotoh){offheight=(el.offsetHeight+10)+'px';disp=DW.getStyle(el,'display');el.style.display='none';el.style.height=offheight;el.style.display=disp;setTimeout(doFull,10);}else{el.style.height='100%';document.getElementById('main').style.display='block';doColor();}}else{setTimeout(doFull,1);}},lastFade=function(){var el=document.getElementById('imgs').getElementsByTagName('img'),l=el.length,c=0,actel='',doFadeOut=function(){var again=false,disp;if(actel){if(document.body.className.indexOf('MSIE')!=-1){actel.style.filter='progid:DXImageTransform.Microsoft.Fade(duration=0.5,overlap=0.25)';actel.style.visibility="visible";actel.filters[0].Apply();actel.style.visibility="hidden";actel.filters[0].play();actel.style.filter='none';}else{if(+actel.style.opacity>0){again=true;disp=DW.getStyle(actel,'display');actel.style.display='none';actel.style.opacity=((+actel.style.opacity*100)-10)/100;actel.style.filter='alpha(opacity='+Math.round(+actel.style.opacity*100)+')';actel.style.display=disp;}}}else{for(c=0;c<l;c++){if(document.body.className.indexOf('MSIE')!=-1){if(el[c].className.indexOf('active')===-1){el[c].style.visiblity='hidden';}else{actel=el[c];}}else{if(+el[c].style.opacity>0){again=true;if(el[c].className.indexOf('active')===-1){el[c].style.opacity=0;el[c].style.filter='alpha(opacity=0)';el[c].style.visiblity='hidden';}else{disp=DW.getStyle(el[c],'display');el[c].style.display='none';el[c].style.opacity=+el[c].style.opacity-.1;el[c].style.filter='alpha(opacity='+Math.round(+el[c].style.opacity*100)+')';el[c].style.display=disp;}}}}}
if(document.body.className.indexOf('MSIE')!=-1){actel.style.filter='progid:DXImageTransform.Microsoft.Fade(duration=0.5,overlap=0.25)';actel.style.visibility="visible";actel.filters[0].Apply();actel.style.visibility="hidden";actel.filters[0].play();actel.style.filter='none';}
if(again){setTimeout(doFadeOut,1);}else{DW.lastImageFade=true;doFull();}};for(c=0;c<l;c++){if(!el[c].style.opacity){el[c].style.opacity=DW.getStyle(el[c],'opacity');if(!el[c].style.opacity){if(el[c].className.indexOf('active')===-1){el[c].style.opacity=0;el[c].style.filter='alpha(opacity=0)';}else{el[c].style.opacity=1;el[c].style.filter='alpha(opacity=1)';el[c].style.filter='none';}}}
if(+el[c].style.opacity>0){again=true;if(el[c].className.indexOf('active')===-1){el[c].style.opacity=0;el[c].style.filter='alpha(opacity=0)';}else{el[c].style.opacity=+el[c].style.opacity-.1;el[c].style.filter='alpha(opacity='+Math.round(+el[c].style.opacity*100)+')';actel=el[c];}}}
if(actel&&actel.style.opacity>0){doFadeOut();}else{doFull();}};if(location.href.split('#').length>1){DW.lastImageFade=true;doFull();}else{if(DW.lastImageFade===false){DW.lastImageFade=-1;lastFade();}else{doFull();}}},crossfadeHomeImages:function(){var el=document.getElementById('imgs').getElementsByTagName('img'),l=el.length,c=0,f=false,n=0,doSlide=function(){if(document.body.className.indexOf('MSIE')!=-1){el[f].style.filter='progid:DXImageTransform.Microsoft.Fade(duration=0.5,overlap=0.25)';el[f].style.visibility="visible";el[f].filters[0].Apply();el[f].style.visibility="hidden";el[f].filters[0].play();el[f].style.filter='none';el[f].className=el[f].className.replace(/active/g,'');DW.sto2=setTimeout(doSlide2,500);return;}
var disp;if(el[f].style.opacity>0){disp=DW.getStyle(el[f],'display');el[f].style.display='none';el[f].style.opacity=((+el[f].style.opacity*100)-10)/100;el[f].style.filter='alpha(opacity='+Math.round(+el[f].style.opacity*100)+')';el[f].style.display=disp;DW.sto1=setTimeout(doSlide,1);}else{el[f].style.opacity=0;el[f].style.filter='alpha(opacity=0)';el[f].className=el[f].className.replace(/active/g,'');DW.sto2=setTimeout(doSlide2,500);}},doSlide2=function(){if(document.body.className.indexOf('MSIE')!=-1){el[n].style.filter='progid:DXImageTransform.Microsoft.Fade(duration=0.5,overlap=0.25)';el[n].style.visibility="hidden";el[n].filters[0].Apply();el[n].style.visibility="visible";el[n].filters[0].play();el[n].className='active';el[n].style.filter='none';return;}
var disp;if(+el[n].style.opacity<1){disp=DW.getStyle(el[n],'display');el[n].style.display='none';el[n].style.opacity=((+el[n].style.opacity)+.1);el[n].style.filter='alpha(opacity='+Math.round(+el[n].style.opacity*100)+')';el[n].style.display=disp;DW.sto3=setTimeout(doSlide2,1);}else{el[n].style.opacity=1;el[n].style.filter='alpha(opacity=100)';el[n].style.filter='none';el[n].className='active';}},doCross=function(){for(c=0;c<l;c++){if(el[c].className.indexOf('active')!==-1){f=c;el[f].style.opacity=1;if(document.body.className.indexOf('MSIE')!=-1){el[f].style.visibility="visible";}
el[f].style.filter='alpha(opacity=100)';el[f].style.filter='none';if(c+1>l-1){n=0;el[0].style.opacity=0;if(document.body.className.indexOf('MSIE')!=-1){el[0].style.visibility="hidden";}
el[0].style.filter='alpha(opacity=0)';}else{n=c+1;el[c+1].style.opacity=0;if(document.body.className.indexOf('MSIE')!=-1){el[c+1].style.visibility="hidden";}
el[c+1].style.filter='alpha(opacity=0)';}
doSlide();}else{el[c].style.opacity=0;if(document.body.className.indexOf('MSIE')!=-1){el[c].style.visibility="hidden";}
el[c].style.filter='alpha(opacity=0)';}}
if(f===false){f=l-1;n=0;el[l-1].style.opacity=1;if(document.body.className.indexOf('MSIE')!=-1){el[l-1].style.visibility="visible";}
el[l-1].style.filter='alpha(opacity=100)';el[l-1].style.filter='none';el[l-1].className='active';doCross();}}
el[l-1].className='active';DW.cfint=setInterval(doCross,4000);}};
