
function animatePuls1(){new ElementPulsator('puls2',0,new Array(100,100,100,1000*40));}
var s54wnd='';function openStudio54(){s54wnd=openWindow(838,650,"/"+"studio54/studio54.jsp",s54wnd,"s54wnd",true,"0","0");}
function s54RollIn(id){var obj=document.getElementById(id);obj.style.backgroundPosition="left top";}
function s54RollOut(id){var obj=document.getElementById(id);obj.style.backgroundPosition="-175px top";}
var ernstsonwnd='';function openErnstsonTicket(){ernstsonwnd=openWindowAt(660,200,1000,366,500,"/ernstson.jsp",ernstsonwnd,"ernstsonwnd",true,"0","1");}
var posterwnd='';function openPosterWindow(dx,dy,cx,cy,url){posterwnd=openWindowAt(dx,dy,1000,cx,cy,url,posterwnd,"posterwnd",true,"0","1");}
function openSivansPresBox(){closeGracePresBox();closeOleoNattklubbPresBox();closeVaxjoParkenPresBox();setElementsByIdsVisible('sivans_mainbox','sivans_presbox_bg','sivans_presbox_bg','sivans_bg_text');trackclick(null,'sivansbanner');setTimeout(openSivansInfoBox,700);}
var heightEffectSivans=null;var heightEffectGrace=null;var heightEffectOleoNattklubb=null;var heightEffectVaxjoParken=null;function toggleSivansInfoBox(){var el=document.getElementById("sivans_presbox_calendar");if(heightEffectSivans==null){var el2=document.getElementById("sivans_presbox_calendar_bg_top");var elContent=document.getElementById("sivans_presbox_calendar_content");var cy=elContent.clientHeight+22;heightEffectSivans=new SetHeightDoubleElementEffect(el,0,cy+28,el2,0,cy-6,null,true);}
if(!heightEffectSivans.toggleExpansion()){}}
function openGraceInfoBox(){var el=document.getElementById("grace_presbox_calendar");if(el.style.visibility!="visible"&&document.getElementById("grace_mainbox").style.visibility=="visible"){toggleGraceInfoBox();}}
function openSivansInfoBox(){var el=document.getElementById("sivans_presbox_calendar");if(el.style.visibility!="visible"&&document.getElementById("sivans_mainbox").style.visibility=="visible"){toggleSivansInfoBox();}}
function openOleoNattklubbInfoBox(){var el=document.getElementById("oleonattklubb_presbox_calendar");if(el.style.visibility!="visible"&&document.getElementById("oleonattklubb_mainbox").style.visibility=="visible"){toggleOleoNattklubbInfoBox();}}
function openVaxjoParkenInfoBox(){var el=document.getElementById("vaxjoparken_presbox_calendar");if(el.style.visibility!="visible"&&document.getElementById("vaxjoparken_mainbox").style.visibility=="visible"){toggleVaxjoParkenInfoBox();}}
function toggleGraceInfoBox(){var el=document.getElementById("grace_presbox_calendar");if(heightEffectGrace==null){var el2=document.getElementById("grace_presbox_calendar_bg_top");var elContent=document.getElementById("grace_presbox_calendar_content");var cy=elContent.clientHeight+22;heightEffectGrace=new SetHeightDoubleElementEffect(el,0,cy+28,el2,0,cy-6,null,true);}
if(!heightEffectGrace.toggleExpansion()){}}
function toggleOleoNattklubbInfoBox(){var el=document.getElementById("oleonattklubb_presbox_calendar");if(heightEffectOleoNattklubb==null){var el2=document.getElementById("oleonattklubb_presbox_calendar_bg_top");var elContent=document.getElementById("oleonattklubb_presbox_calendar_content");var cy=elContent.clientHeight+22;heightEffectOleoNattklubb=new SetHeightDoubleElementEffect(el,0,cy+28,el2,0,cy-6,null,true);}
if(!heightEffectOleoNattklubb.toggleExpansion()){}}
function toggleVaxjoParkenInfoBox(){var el=document.getElementById("vaxjoparken_presbox_calendar");if(heightEffectVaxjoParken==null){var el2=document.getElementById("vaxjoparken_presbox_calendar_bg_top");var elContent=document.getElementById("vaxjoparken_presbox_calendar_content");var cy=elContent.clientHeight+22;heightEffectVaxjoParken=new SetHeightDoubleElementEffect(el,0,cy+28,el2,0,cy-6,null,true);}
if(!heightEffectVaxjoParken.toggleExpansion()){}}
function closeSivansPresBox(){if(heightEffectSivans)
heightEffectSivans.quickCollapse();setElementsByIdsHidden('sivans_mainbox','sivans_presbox_bg','sivans_presbox_bg_long','sivans_bg_text');}
function openGracePresBox(){closeSivansPresBox();closeOleoNattklubbPresBox();closeVaxjoParkenPresBox();setElementsByIdsVisible('grace_mainbox','grace_presbox_bg','grace_presbox_bg','grace_bg_text');var el=document.getElementById('username');if(el)el.blur();trackclick(null,'gracebanner');setTimeout(openGraceInfoBox,700);}
function closeGracePresBox(){if(heightEffectGrace)
heightEffectGrace.quickCollapse();setElementsByIdsHidden('grace_mainbox','grace_presbox_bg','grace_presbox_bg_long','grace_bg_text');}
function openOleoNattklubbPresBox(){closeGracePresBox();closeSivansPresBox();setElementsByIdsVisible('oleonattklubb_mainbox','oleonattklubb_presbox_bg','oleonattklubb_presbox_bg','oleonattklubb_bg_text');trackclick(null,'oleonattklubbbanner');setTimeout(openOleoNattklubbInfoBox,700);}
function closeOleoNattklubbPresBox(){if(heightEffectOleoNattklubb)
heightEffectOleoNattklubb.quickCollapse();setElementsByIdsHidden('oleonattklubb_mainbox','oleonattklubb_presbox_bg','oleonattklubb_presbox_bg_long','oleonattklubb_bg_text');}
function openVaxjoParkenPresBox(){closeGracePresBox();closeSivansPresBox();setElementsByIdsVisible('vaxjoparken_mainbox','vaxjoparken_presbox_bg','vaxjoparken_presbox_bg','vaxjoparken_bg_text');trackclick(null,'vaxjoparkenbanner');setTimeout(openVaxjoParkenInfoBox,700);}
function closeVaxjoParkenPresBox(){if(heightEffectVaxjoParken)
heightEffectVaxjoParken.quickCollapse();setElementsByIdsHidden('vaxjoparken_mainbox','vaxjoparken_presbox_bg','vaxjoparken_presbox_bg_long','vaxjoparken_bg_text');}
var griffelcamwnd='';function openGriffelCam(){griffelcamwnd=openWindow(666,514,"/griffelcam.jsp",griffelcamwnd,"griffelcamwnd",true,"0","0");}
function initGriffelCam(version){var griffelFilename="/images/griffelcam/griffelcam.jpg";if(version&&version=='big')
griffelFilename="/images/griffelcam/griffelcamBig.jpg";new ImageWebCam(griffelFilename,60*1000,"griffelcam","griffel_time");}
function initSivansCamJPG(){new ImageWebCam("/images/sivanscam/sivanscam.jpg",10*1000,"sivanscamjpg",null);}
function initGraceCamJPG(){new ImageWebCam("/images/gracecam/gracecam.jpg",10*1000,"gracecamjpg",null);}
function ImageWebCam(filename,msInterval,idImage,idTime){this.filename=filename;this.msInterval=msInterval;this.idImage=idImage;this.idTime=idTime;var self=this;this.imgLoader=new ImagePreloader(function(bLoaded,image){self.imageCallBack(bLoaded,image)});setTimeout(function(){self.updateCam()},this.msInterval);}
ImageWebCam.prototype.updateCam=function(){var now=new Date();this.imgLoader.preload(this.filename+'?'+now);var self=this;setTimeout(function(){self.updateCam()},this.msInterval);}
ImageWebCam.prototype.imageCallBack=function(bLoaded,image){var el=document.getElementById(this.idImage);if(el&&bLoaded){el.src=image.src;if(this.idTime){el=document.getElementById(this.idTime);if(el){var now=new Date();var h=now.getHours();var m=now.getMinutes();h=this.checkTime(h);m=this.checkTime(m);el.innerHTML=""+h+":"+m;}}}}
ImageWebCam.prototype.checkTime=function(i){return(i<10?"0"+i:i);}
var pollwnd='';function showPollResults(id){pollwnd=openWindow(462,348,"/"+"poll.jsp?id="+id,pollwnd,"pollwnd",true,"1","1");}
function submitVote(){var checked=false;if(document.webpoll.c_1.length){for(i=0;i<document.webpoll.c_1.length;i++){if(document.webpoll.c_1[i].checked==true){checked=true;break;}}}else{var i=1;var name="c_"+i;while(document.webpoll[name]){if(document.webpoll[name].checked){checked=true;break;}
i++;name="c_"+i;}}
if(checked){pollwnd=openWindow(462,348,"",pollwnd,"pollwnd",true,"1","1");document.webpoll.submit();}else{alert("Jamen! ok att vi tjatar, men du kan ju inte svara helt blankt!");}}
var gallerywnd='';var pgRootURI='/mingelbilder/';function openPhotoGallery(pgid,pid,cyExtra){if(pgRootURI!="/mingelbilder/")
gallerywnd=openPhotoGalleryWindowWithComments(pgRootURI+pgid+"/"+pid+"/popup");else
gallerywnd=openWindow(832,579+(cyExtra?cyExtra:0),pgRootURI+pgid+"/"+pid+"/popup",gallerywnd,"gallerywnd",true,"0","1");}
function openPhotoGalleryComment(pgid,pid,cid,isAnon){gallerywnd=openPhotoGalleryWindowWithComments(pgRootURI+pgid+"/"+pid+"/"+"popup/comments");}
function openPhotoGalleryWindowWithComments(url){var cx=852;var cy=588;var x=(screen.width-cx)/2;var y=(screen.height-cy)/5;return openWindowPos(x,y,cx,cy,url,gallerywnd,"gallerywnd",true,"1","1");}
var photoCommentsEffect=null;var commentsLastModified="";function showMorePhotoComments(){if(photoCommentsEffect==null){var el=document.getElementById('LastCommentBoxContent');var el2=document.getElementById('LastCommentBoxInnerContent');photoCommentsEffect=new SetHeightDoubleElementEffect(el,26,206,el2,46,226,null,false);}
photoCommentsEffect.toggleExpansion();}
function initCommentTicker(lastModified){setTimeout('refreshLastPhotoComments();',5000);commentsLastModified=lastModified;}
function refreshLastPhotoComments(){return new AJAXRequest("POST","/photolastcomments.jspax","","http://www.vaxjopuls.se/index.jsp",processLastPhotoCommentsXML);}
function processLastPhotoCommentsXML(myAJAX){if(myAJAX.readyState==4){if(myAJAX.status==200){var xml=myAJAX.responseXML;var el=document.getElementById('lastphotocommenttext');if(xml.documentElement){var comments=xml.documentElement.getElementsByTagName("comment");if(comments&&comments.length>0){var lastmodified=xml.documentElement.getAttributeNode("lastmodified").nodeValue;for(var i=0;i<comments.length;i++){var poster=comments[i].getElementsByTagName("poster")[0].firstChild.nodeValue;var text=comments[i].getElementsByTagName("text")[0].firstChild.nodeValue;var pid=comments[i].getAttributeNode("pid").nodeValue;var pgid=comments[i].getAttributeNode("pgid").nodeValue;var cid=comments[i].getAttributeNode("id").nodeValue;var cxThumbnail=comments[i].getAttributeNode("cxthumbnail").nodeValue;var cyThumbnail=comments[i].getAttributeNode("cythumbnail").nodeValue;var datetime=comments[i].getAttributeNode("datetime").nodeValue;var time=comments[i].getAttributeNode("time").nodeValue;var isAnon=comments[i].getAttributeNode("isanon").nodeValue;el=document.getElementById('lpct_'+i);el.innerHTML="<span class='commenttime'>"+time+"</span> "+poster;el=document.getElementById('lpcm_'+i);el.innerHTML="<a href='javascript:void(0);' onclick=\"openPhotoGalleryComment("+pgid+", "+pid+", "+cid+", "+isAnon+"); return false;\" onmouseover=\"trailOn('/imgdb/"+pgid+"/tn/"+pid+".jpg','"+cxThumbnail+"','"+cyThumbnail+"');\" onmouseout=\"trailOff();\">"+text+"</a>";}
if(lastmodified!=commentsLastModified){commentsLastModified=lastmodified;startNewCommentsNotification();}}
setTimeout('refreshLastPhotoComments();',120*1000);}}}}
function startNewCommentsNotification(){new ElementPulsator('commentnotification',3,new Array(200,200,200,200,200,1000*5));}
function ElementPulsator(idElement,repeats,arrayTimings){this.element=document.getElementById(idElement);this.repeats=repeats;this.arrayTimings=arrayTimings;this.counter=-1;this.cCycle=0;this.fVisible=false;this.callback();}
ElementPulsator.prototype.callback=function(){this.counter++;if(this.counter>=this.arrayTimings.length){if(this.repeats!=0){this.cCycle++;if(this.cCycle==this.repeats){return;}}
this.counter=0;}
this.element.style.visibility=this.fVisible?'hidden':'visible';this.fVisible=!this.fVisible;var self=this;setTimeout(function(){self.callback();},this.arrayTimings[this.counter]);}
var autoLoginInitiated=false;var autoLoginEnabled=false;function toggleAutoLogin(){if(!autoLoginInitiated){autoLoginEnabled=readCookie("alogin")!=null;autoLoginInitiated=true;}
return new AJAXRequest("POST","/login.jspax",autoLoginEnabled?"disableautologin":"enableautologin","http://www.vaxjopuls.se/index.jsp",processToggleAutoLoginXML);}
function processToggleAutoLoginXML(myAJAX){if(myAJAX.readyState==4){if(myAJAX.status==200){var xml=myAJAX.responseXML;if(xml.documentElement){var status=xml.documentElement.getElementsByTagName("status")[0].firstChild.nodeValue;if(status=='autologinenabled'){autoLoginEnabled=true;setElementsByIdsVisible("autologin");setElementsByIdsHidden("autologin2");}else if(status=='autologindisabled'){autoLoginEnabled=false;setElementsByIdsHidden("autologin");setElementsByIdsVisible("autologin2");}}}}}
function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);}
return null;}
function eventOnLoggedIn(){setElementsByIdsDisplayInline("cclogginginindicator");window.location.reload();}
function eventOnLoginError(){setElementsByIdsDisplayInline("forgotpasswdlink");}
function openRegisterWindow(){closeForgotPasswdBox();getNewDynWindow("register_box",245,320,"/register.jsp").show();}
