﻿
var radPetDetailsId;function moveWindow(id)
{dd.elements[id].moveTo(dd.elements[id].ToMoveToLeft,dd.elements[id].ToMoveToTop);}
function positionWindow(id)
{var myWidth=dd.getWndW();var dialogWidth=dd.elements[id].w;var myHeight=dd.getWndH();var dialogHeight=dd.elements[id].h;var scrollyPosition=0;try
{if(window.pageYOffset)
{scrollyPosition=window.pageYOffset;}
else if(document.documentElement&&document.documentElement.scrollTop)
{scrollyPosition=document.documentElement.scrollTop;}
else if(document.body&&window.body.scrollTop)
{scrollyPosition=document.body.scrollTop;}}
catch(exc)
{}
var left=Math.abs((myWidth/2)-(dialogWidth/2));var top=Math.abs((myHeight/2)-(dialogHeight/2))+scrollyPosition;dd.elements[id].ToMoveToLeft=left;dd.elements[id].ToMoveToTop=top;setTimeout("moveWindow('"+id+"');",1);}
function positionCenterTop(id)
{var myWidth=dd.getWndW();var dialogWidth=dd.elements[id].w;var myHeight=dd.getWndH();var dialogHeight=dd.elements[id].h;var left=Math.abs((myWidth/2)-(dialogWidth/2));dd.elements[id].moveTo(left,0);}
function showWindow(id)
{var window=document.getElementById(id);if(!dd.elements[id])
{window.style.display="block";try
{ADD_DHTML(id+MAXHEIGHT+RESIZABLE);}
catch(e)
{}}
window.style.display="block";if(dd.elements[id])
{dd.elements[id].maximizeZ();}
positionWindow(id);try
{if(radPetDetailsId)
{if(dd.elements[radPetDetailsId])
{dd.elements[radPetDetailsId].del();ADD_DHTML(radPetDetailsId+NO_DRAG);}}}
catch(f)
{}}
function hideWindow(id)
{var window=document.getElementById(id);if(dd.elements[id])
{dd.elements[id].del();}
window.style.display="none";}
function showAuthenticationContainer(id)
{var outerWindow=document.getElementById("signInWindow");var innerWindow=document.getElementById(id);if(outerWindow.style.display!="block"){outerWindow.style.display="block";}
innerWindow.style.display="block";}
function updateWindow(id,containerId)
{var window=document.getElementById(id);var container=document.getElementById(containerId);if(window)
{if(dd.elements[id])
{dd.elements[id].resizeTo(dd.elements[id].w,container.offsetHeight+22);}}}
var registrationArgs;function refreshPage()
{var href=location.href;var poundIndex=href.indexOf('#');if(poundIndex!=-1)
{href=href.substr(0,poundIndex);}
if(href.indexOf('?')!=-1)
{if(href[href.length-1]=="&"){if(registrationArgs){href=href+registrationArgs;}
else{href=href.substr(0,href.length-1);}}
else{if(registrationArgs){href=href+"&"+registrationArgs;}else{href=href+"&";}}}
else{if(registrationArgs){href=href+"?"+registrationArgs;}
else{href=href+"?";}}
location.href=href;}
function postLogin()
{try
{if(_hbLink)
{_hbLink("Sign+In+Success");}}catch(e)
{}
hideWindow('loginWindow');refreshPage();}
function postRegister()
{try
{_hbLink("Simple+Registrations+Completed");}
catch(e)
{}
hideWindow('registerWindow');refreshPage();}
function updateLogin(currentContainer)
{updateWindow('loginWindow',currentContainer);if(IsLoggedIn()=="True")
{hideWindow('loginWindow');}}
function hideLoginWindows(keepMainOpen){if(keepMainOpen){}
else{var mainWindows=document.getElementById("signInWindow");mainWindows.style.display="none";}
hideWindow('loginWindow');hideWindow('registerWindow');hideWindow('forgotPasswordWindow');}
function showRegistration()
{hideLoginWindows();if(registrationArgs){location.href="citizen.aspx?"+registrationArgs;}
else{location.href="citizen.aspx";}}
function showLogin(args)
{try
{if(_hbLink)
{_hbLink("Sign+In+Click");}}
catch(e)
{}
if(args){registrationArgs=args;}
else{registrationArgs=null;}
hideLoginWindows(true);showAuthenticationContainer('loginWindow');}
function toggleLogin(){var loginWindow=document.getElementById("loginWindow");if(loginWindow.style.display!="block"){hideLoginWindows();}
var mainWindows=document.getElementById("signInWindow");if(mainWindows.style.display=="block"){mainWindows.style.display="none";}
else{mainWindows.style.display="block";loginWindow.style.display="block";try{if(_hbLink){_hbLink("Sign+In+Click");}}
catch(e){}}}
function showForgotPassword()
{hideLoginWindows();showAuthenticationContainer("forgotPasswordWindow");try
{if(_hbLink)
{_hbLink("Forgot+Password");}}
catch(e)
{}}
var cammercialAdded=false;var profileInnerHTML;function showCommercial()
{showWindow('commercialWindow');var swf1=document.getElementById("swf1");if(swf1)
{if(navigator.userAgent.indexOf("Firefox")!=-1)
{profileInnerHTML=swf1.innerHTML;swf1.innerHTML="";}
else
{swf1.style.display="none";}}
if(!cammercialAdded)
{ADD_DHTML('comercialWindowContainer'+NO_DRAG);cammercialAdded=true;}}
function hideCommercial()
{hideWindow('commercialWindow');var swf1=document.getElementById("swf1");if(swf1)
{if(navigator.userAgent.indexOf("Firefox")!=-1)
{swf1.innerHTML=profileInnerHTML;}
else
{swf1.style.display="block";}}
try
{callFlash("stopVideo");}
catch(e)
{}}
function showDownload(imgName)
{document.getElementById('downloadLink').innerHTML="Right-click the preview and choose 'Set as Desktop Background' or download the wallpaper as a <a href='images/downloads/wallpaper_"+imgName+".zip' onclick='_hbLink(\"Wallpaper+Download+"+fixTrackingString(imgName)+"\")'>zip file</a>";document.getElementById('imgContainer').innerHTML="<img src='images/downloads/wallpaper_"+imgName+".jpg' width='408' height='323' style='margin-left:19px;' />";showWindow('downloadWindow');try
{_hbLink("Wallpaper+Popup+"+fixTrackingString(imgName));}
catch(e)
{}}
function shirtDetail(shirtName)
{var titleText;var shirtDesc;titleText=document.getElementById(shirtName+'Title').innerHTML;shirtDesc=document.getElementById(shirtName+'Desc').innerHTML;document.getElementById('popTitle').innerHTML='<strong>'+titleText+'</strong><p>'+shirtDesc+'</p>';document.getElementById('popFront').innerHTML="<table border='0' cellspacing='0' cellpadding='0'><tr><td align='center'><strong>FRONT</strong></td><td align='center'><strong>BACK</strong></td></tr><tr><td><img class='popImg' src='/images/tShirts/pop_up/TShirt_"+shirtName+".png' height='185' width='177' /></td><td><img class='popImg' src='/images/tShirts/pop_up/TShirt_back.png' height='185' width='177' /></td></tr></table>";var zazzleURL;zazzleURL=document.getElementById(shirtName+'Zazzle').href;document.getElementById('buyPopup').innerHTML="<a href='"+zazzleURL+"' target='_blank'><img src='images/btn_buynow_off.png' alt='Buy Now' border='0' onmouseover='swapimages(this, \"/images/btn_buynow_on.png\")' onmouseout='swapimages(this, \"/images/btn_buynow_off.png\")' height='24' width='80' /></a>"
showWindow('tshirtWindow');try
{_hbLink("T-Shirt+Zooms+"+fixTrackingString(shirtName));}
catch(e)
{}}
function sendPopup(url)
{showWindow('sendWindow');}