
var _ms_XMLHttpRequest_ActiveX="";var _ajax;var _logger=false;var _status_area;if(!window.Node||!window.Node.ELEMENT_NODE){var Node={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12};}
function getTextFromXML(oNode,deep){var s="";var nodes=oNode.childNodes;for(var i=0;i<nodes.length;i++){var node=nodes[i];if(node.nodeType==Node.TEXT_NODE){s+=node.data;}else if(deep==true&&(node.nodeType==Node.ELEMENT_NODE||node.nodeType==Node.DOCUMENT_NODE||node.nodeType==Node.DOCUMENT_FRAGMENT_NODE)){s+=getTextFromXML(node,true);};};return s;};function encode(uri){if(encodeURIComponent){return encodeURIComponent(uri);}
if(escape){return escape(uri);}}
function decode(uri){uri=uri.replace(/\+/g,' ');if(decodeURIComponent){return decodeURIComponent(uri);}
if(unescape){return unescape(uri);}
return uri;}
function ajaxEscape(str){str=Url.encode(str);str=str.replace(/\+/g,'%2B');return str;}
function logger(text,clear){if(_logger){if(!_status_area){_status_area=document.getElementById("status_area");}
if(_status_area){if(clear){_status_area.value="";}
var old=_status_area.value;_status_area.value=text+((old)?"\r\n":"")+old;}}}
function executeReturn(AJAX){if(AJAX.readyState==4){if(AJAX.status==200){}}}
function AJAXRequest(method,url,data,referer,process,async,dosend){var self=this;if(window.XMLHttpRequest){self.AJAX=new XMLHttpRequest();}else if(window.ActiveXObject){if(_ms_XMLHttpRequest_ActiveX){self.AJAX=new ActiveXObject(_ms_XMLHttpRequest_ActiveX);}else{var versions=["Microsoft.XMLHTTP","Msxml2.XMLHTTP.7.0","Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];for(var i=0;i<versions.length;i++){try{self.AJAX=new ActiveXObject(versions[i]);if(self.AJAX){_ms_XMLHttpRequest_ActiveX=versions[i];break;}}
catch(objException){};};}}
if(typeof process=='undefined'||process==null){process=executeReturn;}
self.process=process;self.AJAX.onreadystatechange=function(){self.process(self.AJAX);}
if(!method){method="POST";}
method=method.toUpperCase();if(typeof async=='undefined'||async==null){async=true;}
logger("----------------------------------------------------------------------");logger("AJAX Request: "+((async)?"Async":"Sync")+" "+method+": URL: "+url+", Data: "+data);self.AJAX.open(method,url,async);if(method=="POST"){self.AJAX.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");self.AJAX.setRequestHeader("Method","POST "+url+" HTTP/1.1");}
if(dosend||typeof dosend=='undefined'){if(!data)data="";self.AJAX.send(data);}
return self.AJAX;}
var Url={encode:function(string){return escape(this._utf8_encode(string));},decode:function(string){return this._utf8_decode(unescape(string));},_utf8_encode:function(string){var utftext="";for(var n=0;n<string.length;n++){var c=string.charCodeAt(n);if(c<128){utftext+=String.fromCharCode(c);}
else if((c>127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128);}
else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128);}}
return utftext;},_utf8_decode:function(utftext){var string="";var i=0;var c=c1=c2=0;while(i<utftext.length){c=utftext.charCodeAt(i);if(c<128){string+=String.fromCharCode(c);i++;}
else if((c>191)&&(c<224)){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;}
else{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}}
return string;}}
function FormCollect(oForm){var sRetval='',sTemp='',sCTName='',sCName='',sCType='',arrElts=[],oCurrent=null;for(var i=oForm.elements.length-1;i>=0;i--){oCurrent=oForm.elements[i];if(oCurrent.name&&!oCurrent.disabled)arrElts.push(oCurrent);}
arrElts.sort(function(a,b){return((a.name<b.name)?1:(a.name==b.name)?0:-1);});while(oCurrent=arrElts.pop()){sCTName=oCurrent.tagName.toLowerCase();sCName=oCurrent.name.toLowerCase();sCType=((oCurrent.type)?oCurrent.type:'').toLowerCase();if(sCTName=="input"&&/^(?:radio|checkbox)$/.test(sCType)){do{if(oCurrent.checked||oCurrent.selected)
sRetval=sRetval.append(ajaxEscape(oCurrent.name)+'='+
ajaxEscape(oCurrent.value),'&');}while(arrElts[arrElts.length-1].name==oCurrent.name&&(oCurrent=arrElts.pop()));}
if(sCTName=="select"&&oCurrent.multiple&&oCurrent.options){for(i=0,len=oCurrent.options.length,sTemp='';i<len;i++)
if(oCurrent.options[i].selected)
sTemp=sTemp.append(ajaxEscape(oCurrent.options[i].value?oCurrent.options[i].value:oCurrent.options[i].innerHTML),',');sRetval=sRetval.append(ajaxEscape(oCurrent.name)+'='+sTemp,'&');}
else if((sCTName=="input"&&oCurrent.className!="empty"&&/^(?:text|password|tel|email|hidden)$/.test(sCType))||/^(?:select|textarea)$/.test(sCTName)){sRetval=sRetval.append(ajaxEscape(oCurrent.name)+'='+
ajaxEscape(oCurrent.value),'&');}}
return sRetval;}
String.prototype.append=function(sAdd,sSep){return this+((this.length)?sSep:'')+sAdd;}
function Scroll(idBox,idText,boxWidth,fForceScroll){this.scrollboxid=idBox;this.scrolltextid=idText;this.msgWidth=0;this.bannerWidth=boxWidth;this.doscroll=false;this.timerID=null;this.xScrollPos=0;this.dx=4;this.msDelay=150;this.fForceScroll=false;if(fForceScroll)
this.fForceScroll=true;}
Scroll.prototype.initScroll=function(width){this.msgWidth=width;var el=document.getElementById(this.scrollboxid);if(width>this.bannerWidth||this.fForceScroll){document.getElementById(this.scrolltextid).style.left=this.bannerWidth+"px";this.doscroll=true;}else{document.getElementById(this.scrolltextid).style.left="-6px";this.doscroll=false;}
el=document.getElementById(this.scrolltextid);}
Scroll.prototype.scroll=function(type){var self=this;if(type=='start'){if(this.doscroll){this.xScrollPos=this.bannerWidth;var text=document.getElementById(this.scrolltextid);text.style.left=this.xScrollPos+"px";this.timerID=setTimeout(function(){self.loop();},this.msDelay);}}else
if(this.timerID!=null){clearTimeout(this.timerID);this.timerID=null;}}
Scroll.prototype.clearText=function(){this.scroll('stop');var el=document.getElementById(this.scrolltextid);el.style.left=this.bannerWidth+"px";}
Scroll.prototype.loop=function(){var text=document.getElementById(this.scrolltextid);this.xScrollPos-=this.dx;text.style.left=this.xScrollPos+"px";if(this.xScrollPos<-this.msgWidth){this.xScrollPos=this.bannerWidth;}
var self=this;this.timerID=setTimeout(function(){self.loop();},this.msDelay);}
function ImagePreloader(callback,data){this.callback=callback;this.oImage="";this.oData=data;}
ImagePreloader.prototype.preload=function(image,callerData){this.oImage=new Image;var self=this;this.oImage.onload=function(){self.onload(callerData);}
this.oImage.onerror=function(){self.onerror(callerData);}
this.oImage.onabort=function(){self.onabort(callerData);}
this.oImage.src=image;}
ImagePreloader.prototype.onComplete=function(fLoaded,callerData){this.callback(fLoaded,this.oImage,this.oData,callerData);}
ImagePreloader.prototype.onload=function(callerData){this.onComplete(true,callerData);}
ImagePreloader.prototype.onerror=function(callerData){this.onComplete(false,callerData);}
ImagePreloader.prototype.onabort=function(callerData){this.onComplete(false,callerData);}
function PMonEvent(location,status,visible){this.location=location;this.status=status;this.title="";this.cGuests=0;this.cMaxGuests=0;this.queueRating=0;this.scroll=new Scroll(location+"_commentbox",location+"_comment",226);this.visible=visible;}
PMonEvent.prototype.isOpened=function(){return this.status=="opened";}
PMonEvent.prototype.setStatus=function(newStatus){if(newStatus!=this.status){this.status=newStatus;if(this.status=="opened")
this.setEventOpened(true);else
this.setEventOpened(false);}}
PMonEvent.prototype.setTime=function(time){var el=document.getElementById(this.location+"_time");if(el)
el.innerHTML="klockan "+time;}
PMonEvent.prototype.setTitle=function(title){if(title!=this.title){this.title=title;var el=document.getElementById(this.location+"_title");if(el)
el.innerHTML=this.title;}}
PMonEvent.prototype.setComment=function(comment){if(comment!=this.comment){this.comment=comment;if(this.scroll!=null){var el=document.getElementById(this.location+"_comment");if(el){this.scroll.scroll('stop');el.innerHTML=comment;var elMeasuretext=document.getElementById("measuretext");elMeasuretext.innerHTML=comment;this.scroll.initScroll(elMeasuretext.clientWidth);elMeasuretext.innerHTML="";if(this.visible){el.style.visibility="visible";this.scroll.scroll('start');}}}}}
PMonEvent.prototype.setGuestCount=function(cGuests,cMaxGuests){if(cGuests!=this.cGuests||cMaxGuests!=this.cMaxGuests){this.cGuests=cGuests;this.cMaxGuests=cMaxGuests;var el=document.getElementById(this.location+"_cguests");if(el)
el.innerHTML=cGuests+" / "+cMaxGuests;}}
PMonEvent.prototype.setQueuePercentage=function(newPercentage){var newRating=Math.floor((newPercentage*18));if(newRating!=this.queueRating){this.queueRating=newRating;var el=document.getElementById(this.location+"_queuebar");if(el){el.style.width=""+(this.queueRating*7)+"px";}}}
PMonEvent.prototype.setEventOpened=function(state){if(this.visible){this.setElementsVisibility(true);}
enableIndicator();setTimeout("reloadPage()",2000);}
PMonEvent.prototype.setElementsVisibility=function(opened){if(opened){setElementsByIdsVisible(this.location+'_stats');if(document.getElementById(this.location+'_cam')){setElementsByIdsVisible(this.location+'_cambg',this.location+'_cam',this.location+'_bigcambuttonlink');}
setElementsByIdsHidden(this.location+'_stats_closed');}else{setElementsByIdsHidden(this.location+'_stats');setElementsByIdsVisible(this.location+'_stats_closed');if(document.getElementById(this.location+'_cam')){setElementsByIdsVisible(this.location+'_cambg',this.location+'_cam');setElementsByIdsHidden(this.location+'_bigcambuttonlink');}}
setElementsByIdsVisible(this.location+'_time',this.location+'_title');}
PMonEvent.prototype.setVisible=function(state){if(state){setElementsByIdsVisible(this.location+"_container");this.setElementsVisibility(this.isOpened());if(this.scroll){this.scroll.scroll('start');setElementsByIdsVisible(this.location+"_comment");}}else{setElementsByIdsHidden(this.location+"_container",this.location+"_stats_closed",this.location+"_stats",this.location+'_comment',this.location+'_time',this.location+'_title',this.location+'_cam',this.location+'_cambg');if(this.scroll){this.scroll.scroll('stop');}}
this.visible=state;}
PMonEvent.prototype.getLocation=function(){return this.location;}
PMonEvent.prototype.isVisible=function(){return this.visible;}
PMonEvent.prototype.enableIndicator=function(){if(this.visible){setElementsByIdsVisible(this.location+'_loadingindicator');}}
function enableIndicator(){findEvent('sivans').enableIndicator();findEvent('grace').enableIndicator();}
function disableIndicator(){setElementsByIdsHidden('sivans_loadingindicator');setElementsByIdsHidden('grace_loadingindicator');}
function reloadPage(){window.location.reload();}
function refreshEvents(){if(cEventsOpened>0){setTimeout('enableIndicator();',28000);setTimeout('refreshEvents();',30000);}else{setTimeout('refreshEvents();',15*60*1000);}
return new AJAXRequest("POST","/pmonevents.jspax","","http://www.vaxjopuls.se/index.jsp",processEventStatsXML);}
function findEvent(location){for(var j=0;j<pmonEvents.length;j++){if(pmonEvents[j].getLocation()==location){return pmonEvents[j];}}}
function getVisibleEvent(){for(var j=0;j<pmonEvents.length;j++){if(pmonEvents[j].isVisible()){return pmonEvents[j];}}}
function processEventStatsXML(myAJAX){if(myAJAX.readyState==4){if(myAJAX.status==200){var xml=myAJAX.responseXML;if(xml.documentElement){var events=xml.documentElement.getElementsByTagName("event");var time=xml.documentElement.getElementsByTagName("time")[0].firstChild.nodeValue;var location="";for(var i=0;i<events.length;i++){location=events[i].getElementsByTagName("location")[0].firstChild.nodeValue;for(var j=0;j<pmonEvents.length;j++){if(pmonEvents[j].getLocation()==location){var children=events[i].getElementsByTagName("title");pmonEvents[j].setTitle(children.length>0&&children[0].firstChild?unescape(children[0].firstChild.nodeValue):"");children=events[i].getElementsByTagName("comment");pmonEvents[j].setComment(children.length>0&&children[0].firstChild?unescape(children[0].firstChild.nodeValue):"");pmonEvents[j].setStatus(events[i].getAttributeNode("status").nodeValue);if(pmonEvents[j].isOpened()){pmonEvents[j].setGuestCount(events[i].getAttributeNode("cguests").nodeValue,events[i].getAttributeNode("cmaxguests").nodeValue);pmonEvents[j].setQueuePercentage(events[i].getAttributeNode("queuepercentage").nodeValue);}
pmonEvents[j].setTime(time);}}}}
disableIndicator();}}}
var currentGallerySection="";function getGalleryList(section){var el=document.getElementById("gallerylist");el.innerHTML="";return new AJAXRequest("POST","/photogalleries.jspax","section="+section,"http://www.vaxjopuls.se/index.jsp",processGetGalleryList);}
function getPreviousGalleryListPage(section,cPage,cGalleriesPerPage,cGalleries){if(cPage>1){return new AJAXRequest("POST","/photogalleries.jspax","section="+section+"&page="+(cPage-1),"http://www.vaxjopuls.se/index.jsp",processGetGalleryList);}}
function getNextGalleryListPage(section,cPage,cGalleriesPerPage,cGalleries){if(cGalleries>cPage*cGalleriesPerPage){return new AJAXRequest("POST","/photogalleries.jspax","section="+section+"&page="+(cPage+1),"http://www.vaxjopuls.se/index.jsp",processGetGalleryList);}}
function processGetGalleryList(myAJAX){if(myAJAX.readyState==4){if(myAJAX.status==200){var xml=myAJAX.responseXML;if(xml.documentElement){currentGallerySection=xml.documentElement.getAttributeNode("section").nodeValue;var el=document.getElementById("gallerylisttitle");el.innerHTML=xml.documentElement.getElementsByTagName("title")[0].firstChild.nodeValue;el=document.getElementById("gallerylist");el.innerHTML=xml.documentElement.getElementsByTagName("html")[0].firstChild.nodeValue;}}else{}}}
var gallerystrips=new Array();var currentGallery=0;var cImages=0;var currentImgOffset=0;function setOnclickPhoto(el,pgid,pid,cyExtra){el.onclick=function(){openPhotoGallery(pgid,pid,cyExtra);return false;}}
var elOpacity;var opacity;var opacityStart=0;var opacityEnd=100;var fFadeStrip=false;function changeOpacity(){elOpacity.style.filter='alpha(opacity='+opacity+')';elOpacity.style.opacity=opacity/101;opacity=opacity+10;if(opacity<opacityEnd){setTimeout("changeOpacity();",40);}else{if(fFadeStrip){setTimeout("animatePhotoStripStage2();",40);}else{animatePhotoStripStage2();elOpacity.style.filter="alpha(opacity=0)";elOpacity.style.opacity="0";elOpacity.style.visibility="hidden";opacity=0;}}}
var spDivLoad="";var loader="";function initLoader(){loader=new ImagePreloader(imageLoaderCallBack);}
function imageLoaderCallBack(bLoaded,image){if(fFadeStrip){spDivLoad.style.background="url('"+image.src+"') center no-repeat";spDivLoad.style.visibility="visible";elOpacity=spDivLoad;setTimeout("changeOpacity();",40);}else{animatePhotoStripStage2();}}
function initPhotoStrip(){var j=0;var i=0;var k=0;for(i=0;i<gallerystrips.length/4;i++){for(j=4;j>=0;j--){obj=document.getElementById('sp_a_'+i+'_'+j);for(k=0;k<obj.childNodes.length;k++){if(obj.childNodes[k].nodeType==1){gallerystrips[i*4+3][j]=obj.childNodes[k];}}}}
animatePhotoStrip();}
function animatePhotoStrip(){cImages=gallerystrips[currentGallery*4+1].length;currentImgOffset=gallerystrips[currentGallery*4+2][1];currentImgOffset+=1;if(currentImgOffset>=cImages)
currentImgOffset=0;spDivLoad=document.getElementById('sp_div_load_'+currentGallery);var nextImgOffset=currentImgOffset+4;if(nextImgOffset>=cImages){nextImgOffset=currentImgOffset+4-cImages;}
if(gallerystrips[currentGallery*4+3][nextImgOffset]!=0){animatePhotoStripStage2();}else{var filename=gallerystrips[currentGallery*4][1]+gallerystrips[currentGallery*4+1][nextImgOffset]+".jpg";loader.preload(filename);}}
function animatePhotoStripStage2(){var offset=currentImgOffset;var obj='';var j=0;var k=0;offset+=4;if(offset>=cImages){offset=offset-cImages;}
for(j=4;j>=0;j--){obj=document.getElementById('sp_a_'+currentGallery+'_'+j);setOnclickPhoto(obj,gallerystrips[currentGallery*4][0],gallerystrips[currentGallery*4+1][offset],gallerystrips[currentGallery*4][2]);for(k=0;k<obj.childNodes.length;k++){if(obj.childNodes[k].nodeType==1){var old=obj.childNodes[k];if(gallerystrips[currentGallery*4+3][offset]!=0){obj.replaceChild(gallerystrips[currentGallery*4+3][offset],old);}else{var newImg=document.createElement("img");newImg.src=gallerystrips[currentGallery*4][1]+gallerystrips[currentGallery*4+1][offset]+".jpg";obj.replaceChild(newImg,old);gallerystrips[currentGallery*4+3][offset]=newImg;}
break;}}
offset--;if(offset<0)
offset=cImages-1;}
gallerystrips[currentGallery*4+2][1]=currentImgOffset;currentGallery++;if(currentGallery>=gallerystrips.length/4)
currentGallery=0;if(fFadeStrip){elOpacity.style.filter="alpha(opacity=0)";elOpacity.style.opacity="0";elOpacity.style.visibility="hidden";opacity=0;}
setTimeout('animatePhotoStrip();',1800);}
function PhotoAnimator(idPhotoContainer,idPhotoOverContainer,idPhoto,photoDir,defaultDelay,cxPhoto,cyPhoto,fUseRegularFade){this.idPhotoContainer=idPhotoContainer;this.idPhotoOverContainer=idPhotoOverContainer;this.idPhoto=idPhoto;this.photoDir=photoDir;this.defaultDelay=defaultDelay;this.currentOffset=0;this.photos=null;this.imageTags=null;this.photoDelays=null;this.cxPhoto=cxPhoto;this.cyPhoto=cyPhoto;this.useOverContainer=true;var self=this;this.photoLoader=new ImagePreloader(function(bLoaded,image){self.loaderCallBack(bLoaded,image);});this.fUseRegularFade=fUseRegularFade;if(this.fUseRegularFade){this.effect=new OpacityFadeEffect(0.5);}else{this.effect=new OpacityCrossFadeEffectTest();}}
PhotoAnimator.prototype.setPhotos=function(){this.photos=new Array();this.imageTags=new Array();for(var i=0;i<arguments.length;i++){this.photos.push(arguments[i]);this.imageTags.push(null);}}
PhotoAnimator.prototype.setPhotoDelays=function(){this.photoDelays=new Array();for(var i=0;i<arguments.length;i++){this.photoDelays.push(arguments[i]);}}
PhotoAnimator.prototype.start=function(){this.animation();}
PhotoAnimator.prototype.animation=function(){this.currentOffset++;if(this.currentOffset>=this.photos.length)
this.currentOffset=0;if(this.imageTags[this.currentOffset]){this.startFade();}else{var filename=this.photoDir+this.photos[this.currentOffset];this.photoLoader.preload(filename);}}
PhotoAnimator.prototype.fadeDone=function(){var delay=this.photoDelays[this.currentOffset];if(delay==0)
delay=this.defaultDelay;var self=this;this.useOverContainer=!this.useOverContainer;setTimeout(function(){self.animation();},delay);}
PhotoAnimator.prototype.loaderCallBack=function(bLoaded,image){var newImg=document.createElement("img");newImg.className="anim_photo_over";newImg.id=this.idPhoto+"_"+this.currentOffset;newImg.width=image.width;newImg.height=image.height;newImg.src=image.src;newImg.style.left=Math.floor(((this.cxPhoto-image.width)/2))+"px";newImg.style.top=Math.floor(((this.cyPhoto-image.height)/2))+"px";this.imageTags[this.currentOffset]=newImg;this.startFade();}
PhotoAnimator.prototype.startFade=function(){var elNewPhoto=this.imageTags[this.currentOffset];var elContainerFadeIn=document.getElementById(this.useOverContainer?this.idPhotoOverContainer:this.idPhotoContainer);var elPhoto=null;var elContainer=document.getElementById(this.useOverContainer?this.idPhotoContainer:this.idPhotoOverContainer);for(k=0;k<elContainer.childNodes.length;k++){if(elContainer.childNodes[k].nodeType==1){elPhoto=elContainer.childNodes[k];}}
var old=null;for(k=0;k<elContainerFadeIn.childNodes.length;k++){if(elContainerFadeIn.childNodes[k].nodeType==1){old=elContainerFadeIn.childNodes[k];}}
elNewPhoto.style.opacity="0.0";elNewPhoto.style.visibility="visible";if(old){elContainerFadeIn.replaceChild(elNewPhoto,old);}else{elContainerFadeIn.appendChild(elNewPhoto);}
var self=this;if(this.fUseRegularFade){this.effect.startFadeEffect(elNewPhoto,null,false,function(){self.fadeDone();});}else{this.effect.startFadeEffect(elNewPhoto,elPhoto,function(){self.fadeDone();});}}
function getKeyCode(e){var keycode=0;if(!e)
e=window.event;if(e){if(e.keyCode)
keycode=e.keyCode;else if(e.which)
keycode=e.which;}
return keycode;}
function submitFormOnEnter(myfield,e,fnSubmit){if(getKeyCode(e)==13){if(fnSubmit)
fnSubmit();else
myfield.form.submit();return false;}else return true;}
function focusElementIdOnEnter(id,e){if(getKeyCode(e)==13){var el=document.getElementById(id);if(el)
el.focus();return false;}else return true;}
function trackclick(url,name){if(document.images){(new Image()).src="/clicktracker.jsp?name="+name;}
return true;}
function tct(id,num,action){if(document.images){(new Image()).src="/ticket.jspax?id="+id+"&num="+num+"&action="+action;}
return true;}
function buttonRollIn(button,bgcolor){button.style.background=bgcolor;button.style.cursor="pointer";}
function buttonRollOut(button,bgcolor){button.style.background=bgcolor;button.style.cursor="auto";}
function openWindowPos(x,y,width,height,url,wnd,wndname,reload,scrollbars,resizable,fullscreen){if(!fullscreen)
fullscreen="no";if(x<0)
x=0;if(y<0)
y=0;var properties="toolbar=0,location=0,status=0,menubar=0,fullscreen="+fullscreen+",scrollbars="+scrollbars+",resizable="+resizable+",width="+width+",height="+height+",left="+x+",top="+y+",screenX="+x+",screenY="+y;if(wnd&&!wnd.closed&&wnd.location){if(reload)
wnd.location.href=url;}else{wnd=window.open(url,wndname,properties);}
if(wnd.focus){wnd.focus();}
return wnd;}
function openWindow(width,height,url,wnd,wndname,reload,scrollbars,resizable,fullscreen){var x=(screen.width-width)/2;var y=(screen.height-height)/2;return openWindowPos(x,y,width,height,url,wnd,wndname,reload,scrollbars,resizable,fullscreen)}
function openWindowAt(xInner,yInner,siteCenteredWidth,width,height,url,wnd,wndname,reload,scrollbars,resizable){var winSize=getWindowSize();var sx=0;var sy=0;if(window.screenX)
sx=window.screenX;if(window.screenY)
sy=window.screenY;if(window.screenLeft)
sx=window.screenLeft;if(window.screenTop)
sy=window.screenTop;var x=sx+xInner;if(winSize[0]>siteCenteredWidth)
x=sx+xInner+(winSize[0]-siteCenteredWidth)/2;if(x+width>screen.width)
x=screen.width-width-20;var y=(screen.height-height)/2;return openWindowPos(x,y,width,height,url,wnd,wndname,reload,scrollbars,resizable)}
function getWindowSize(){var myWidth=0,myHeight=0;if(typeof(window.innerWidth)=='number'){myWidth=window.innerWidth;myHeight=window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){myWidth=document.documentElement.clientWidth;myHeight=document.documentElement.clientHeight;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){myWidth=document.body.clientWidth;myHeight=document.body.clientHeight;}
return new Array(myWidth,myHeight);}
function setMinimumWindowSize(cxMin,cyMin){var size=getWindowSize();if(parseInt(navigator.appVersion)>3){if(navigator.appName=="Netscape"){if(size[0]<cxMin)
window.innerWidth=cxMin;if(size[1]<cyMin)
window.innerHeight=cyMin;}else{if(size[0]<cxMin-16&&size[1]<cyMin){window.resizeBy(cxMin-size[0]-16,cyMin-size[1]);}else if(size[0]<cxMin-16){window.resizeBy(cxMin-size[0]-16,0);}else if(size[1]<cyMin){window.resizeBy(0,cyMin-size[1]);}}}}
function setWindowSize(cx,cy){var size=getWindowSize();if(parseInt(navigator.appVersion)>3){if(navigator.appName=="Netscape"){window.innerWidth=cx;window.innerHeight=cy;}else{if(size[0]!=cx-16||size[1]!=cy){window.resizeBy(cx-size[0]-16,cy-size[1]);}}}}
function setWindowHeight(cy){var size=getWindowSize();if(parseInt(navigator.appVersion)>3){if(navigator.appName=="Netscape"){window.innerHeight=cy;}else{if(size[1]!=cy){window.resizeBy(0,cy-size[1]);}}}}
function getPageHeight(){return document.documentElement.scrollHeight||document.body.scrollHeight;}
function getPageWidth(){return document.documentElement.scrollWidth;}
function getPageScrollTop(){var yScrolltop;var xScrollleft;if(self.pageYOffset||self.pageXOffset){yScrolltop=self.pageYOffset;xScrollleft=self.pageXOffset;}else if(document.documentElement&&document.documentElement.scrollTop||document.documentElement.scrollLeft){yScrolltop=document.documentElement.scrollTop;xScrollleft=document.documentElement.scrollLeft;}else if(document.body){yScrolltop=document.body.scrollTop;xScrollleft=document.body.scrollLeft;}
arrayPageScroll=new Array(xScrollleft,yScrolltop)
return arrayPageScroll;}
function scrollToElement(theElement,wndElement,wndHeight){var selectedPosX=0;var selectedPosY=0;var y=wndElement.document.documentElement.scrollTop||wndElement.document.body.scrollTop;if(wndElement.pageYOffset)
y=wndElement.pageYOffset;var elHeight=theElement.offsetHeight;while(theElement!=null){selectedPosX+=theElement.offsetLeft;selectedPosY+=theElement.offsetTop;theElement=theElement.offsetParent;}
if(selectedPosY!=0){if(selectedPosY<y){wndElement.scrollTo(selectedPosX,selectedPosY-(elHeight+12));}else if(selectedPosY>y+wndHeight-(elHeight+12)){wndElement.scrollTo(selectedPosX,selectedPosY-(wndHeight-(elHeight+12)));}}}
function scrollToWindowElement(el){scrollToElement(el,window,getWindowSize()[1]);}
function redirTo(url){window.location=url;}
function trimLeft(s){var whitespaces=" \t\n\r";for(n=0;n<s.length;n++){if(whitespaces.indexOf(s.charAt(n))==-1)return(n>0)?s.substring(n,s.length):s;}
return("");}
function trimRight(s){var whitespaces=" \t\n\r";for(n=s.length-1;n>-1;n=n-1){if(whitespaces.indexOf(s.charAt(n))==-1)return(n<(s.length-1))?s.substring(0,n+1):s;}
return("");}
function trim(s){return((s==null)?"":trimRight(trimLeft(s)));}
function setElementsByIdsVisible(){for(var i=0;i<arguments.length;i++){var el=document.getElementById(arguments[i]);if(el)
el.style.visibility='visible';}}
function setElementsByIdsHidden(){for(var i=0;i<arguments.length;i++){var el=document.getElementById(arguments[i]);if(el)
el.style.visibility='hidden';}}
function toggleVisibilityOfElementsByIds(){var fVisibleNow=false;for(var i=0;i<arguments.length;i++){var el=document.getElementById(arguments[i]);if(el){if(el.style.visibility=='visible'){el.style.visibility='hidden';}else{el.style.visibility='visible';fVisibleNow=true;}}}
return fVisibleNow;}
function resetElementsByIdsDisplay(){for(var i=0;i<arguments.length;i++){var el=document.getElementById(arguments[i]);if(el)
el.style.display="";}}
function setElementsByIdsDisplayInline(){for(var i=0;i<arguments.length;i++){var el=document.getElementById(arguments[i]);if(el)
el.style.display='inline';}}
function setElementsByIdsDisplayBlock(){for(var i=0;i<arguments.length;i++){var el=document.getElementById(arguments[i]);if(el)
el.style.display='block';}}
function setElementsByIdsDisplayNone(){for(var i=0;i<arguments.length;i++){var el=document.getElementById(arguments[i]);if(el)
el.style.display='none';}}
function setElementsByIdsEmpty(){for(var i=0;i<arguments.length;i++){var el=document.getElementById(arguments[i]);if(el)
el.innerHTML="";}}
function getElementAbsoluteOffsetTop(theElement){var y=0;while(theElement){y+=theElement.offsetTop;theElement=theElement.offsetParent;}
return y;}
function getElementAbsoluteOffset(theElement){var x=0,y=0;while(theElement){x+=theElement.offsetLeft;y+=theElement.offsetTop;theElement=theElement.offsetParent;}
return new Array(x,y);}
function getElementsByClassName(className,tag,elm){var testClass=new RegExp("(^|\\s)"+className+"(\\s|$)");var tag=tag||"*";var elm=elm||document;var elements=(tag=="*"&&elm.all)?elm.all:elm.getElementsByTagName(tag);var returnElements=[];var current;var length=elements.length;for(var i=0;i<length;i++){current=elements[i];if(testClass.test(current.className)){returnElements.push(current);}}
return returnElements;}
String.prototype.addClass=function(theClass)
{if(this!="")
{if(!this.classExists(theClass))
{return this+" "+theClass;}}
else
{return theClass;}
return this;}
String.prototype.classExists=function(theClass)
{var regString="(^| )"+theClass+"\W*";var regExpression=new RegExp(regString);if(regExpression.test(this))
{return true;}
return false;}
String.prototype.removeClass=function(theClass)
{var regString="(^| )"+theClass+"\W*";var regExpression=new RegExp(regString);return this.replace(regExpression,"");}
function disabledTextSelOnMouseDown(e){var srcElement=e?e.target:event.srcElement;if(srcElement.type){if(srcElement.type=='textarea'||srcElement.type=='text'||srcElement.type=='password'){return true;}}
return false;}
function disableTextSelection(){if((browser.ie4up||browser.opera6up)&&!browser.safari){document.onselectstart=disabledTextSelOnMouseDown;}else if(browser.ns6up&&!browser.safari){document.onmousedown=disabledTextSelOnMouseDown;document.onclick=new Function("return true");}}
function detectBrowser(){this.useragent=navigator.userAgent;this.appname=navigator.appName;this.appversion=navigator.appVersion;var loc_usragt=navigator.userAgent.toLowerCase();this.major_version=parseInt(navigator.appVersion);this.minor_version=parseFloat(navigator.appVersion);this.ns=((loc_usragt.indexOf("mozilla")!=-1)&&(loc_usragt.indexOf("spoofer")==-1)&&(loc_usragt.indexOf("compatible")==-1)&&(loc_usragt.indexOf("opera")==-1)&&(loc_usragt.indexOf("webtv")==-1)&&(loc_usragt.indexOf("safari")==-1)&&(loc_usragt.indexOf("hotjava")==-1));this.ns2=(this.ns&&(this.major_version==2));this.ns3=(this.ns&&(this.major_version==3));this.ns4=(this.ns&&(this.major_version==4));this.ns6=(this.ns&&this.major_version==5&&loc_usragt.indexOf("netscape 7")==-1&&loc_usragt.indexOf("netscape/7")==-1);this.ns7=(this.ns&&this.major_version==5&&(loc_usragt.indexOf("netscape 7")!=-1||loc_usragt.indexOf("netscape/7")!=-1));this.ns4up=(this.ns&&(this.major_version>=4));this.ns6up=(this.ns&&(this.major_version>=5));this.ns7up=(this.ns&&this.major_version==5&&(loc_usragt.indexOf("netscape 7")!=-1||loc_usragt.indexOf("netscape/7")!=-1));this.nsonly=(this.ns&&((loc_usragt.indexOf(";nav")!=-1)||(loc_usragt.indexOf("; nav")!=-1)));this.gecko=(loc_usragt.indexOf("gecko")!=-1&&loc_usragt.indexOf("safari")!=-1);this.ie=((loc_usragt.indexOf("msie")!=-1)&&(loc_usragt.indexOf("opera")==-1));this.ie3=(this.ie&&(this.major_version<4));this.ie4=(this.ie&&(this.major_version==4)&&(loc_usragt.indexOf("msie 4")!=-1));this.ie5=(this.ie&&(this.major_version==4)&&(loc_usragt.indexOf("msie 5.0")!=-1));this.ie5_5=(this.ie&&(this.major_version==4)&&(loc_usragt.indexOf("msie 5.5")!=-1));this.ie6=(this.ie&&(this.major_version==4)&&(loc_usragt.indexOf("msie 6.")!=-1));this.ie4up=(this.ie&&(this.major_version>=4));this.ie5up=(this.ie&&!this.ie3&&!this.ie4);this.ie5_5up=(this.ie&&!this.ie3&&!this.ie4&&!this.ie5);this.ie6up=(this.ie&&!this.ie3&&!this.ie4&&!this.ie5&&!this.ie5_5);this.ie7up=(this.ie&&!this.ie3&&!this.ie4&&!this.ie5&&!this.ie5_5&&!this.ie6);this.opera=(loc_usragt.indexOf("opera")!=-1);this.opera2=(loc_usragt.indexOf("opera 2")!=-1||loc_usragt.indexOf("opera/2")!=-1);this.opera3=(loc_usragt.indexOf("opera 3")!=-1||loc_usragt.indexOf("opera/3")!=-1);this.opera4=(loc_usragt.indexOf("opera 4")!=-1||loc_usragt.indexOf("opera/4")!=-1);this.opera5=(loc_usragt.indexOf("opera 5")!=-1||loc_usragt.indexOf("opera/5")!=-1);this.opera6=(loc_usragt.indexOf("opera 6")!=-1||loc_usragt.indexOf("opera/6")!=-1);this.opera7=(loc_usragt.indexOf("opera 7")!=-1||loc_usragt.indexOf("opera/7")!=-1);this.opera5up=(this.opera&&!this.opera2&&!this.opera3&&!this.opera4);this.opera6up=(this.opera&&!this.opera2&&!this.opera3&&!this.opera4&&!this.opera5);this.opera7up=(this.opera&&!this.opera2&&!this.opera3&&!this.opera4&&!this.opera5&&!this.opera6);this.safari=(loc_usragt.indexOf("safari")!=-1);this.ffmac=(loc_usragt.indexOf("firefox")!=-1&&loc_usragt.indexOf("macintosh")!=-1);}
var browser=new detectBrowser();var articlewnd='';function openArticle(key,altWndName){var wndName="articlewnd";if(altWndName)
wndName=altWndName;articlewnd=openWindowAt(40,50,1000,568,680,"/"+"artiklar/"+key+".html?popup",articlewnd,wndName,true,"1","1");}
function getSelectedValue(el){if(el.length){for(var i=0;i<el.length;i++){if(el[i].selected){return el[i].value.length==0?el[i].innerHTML:el[i].value;}}}
return"";}
function setSelectedValue(el,value){if(el.length){for(var i=0;i<el.length;i++){if(el[i].value.length==0&&el[i].innerHTML==value){el[i].selected="selected";break;}else if(el[i].value==value){el[i].selected="selected";break;}}}}
function getCheckedValue(el){if(el.length){for(var i=0;i<el.length;i++){if(el[i].checked){return el[i].value;}}}else if(el.checked){return el.value;}
return"";}
if(!window.JSFX)
JSFX=new Object();JSFX.FadeElemMinOpacity=50;JSFX.FadeElemMaxOpacity=100;JSFX.FadeElemAutoUp=5;JSFX.FadeElemAutoDown=5;JSFX.FadeElemSavedOver=null;JSFX.FadeElemSavedOut=null;JSFX.FadeElemIdIndex=0;JSFX.FadeElemLockList=null;JSFX.FadeElemLockListMouseOverNow=null;document.write('<STYLE TYPE="text/css">.elemFader,  .elemFaderStep10,  .elemFaderStep15,  .elemFaderStep20 {  filter:alpha(opacity='+JSFX.FadeElemMinOpacity+'); opacity:'+JSFX.FadeElemMinOpacity/101+'; -moz-opacity:'+JSFX.FadeElemMinOpacity/101+'}</STYLE>');document.write('<STYLE TYPE="text/css">.elemFader0, .elemFader0Step10, .elemFader0Step15, .elemFader0Step20 {  filter:alpha(opacity=00); opacity:0.0; -moz-opacity:0.0}</STYLE>');document.write('<STYLE TYPE="text/css">.elemFader1, .elemFader1Step10, .elemFader1Step15, .elemFader1Step20 {  filter:alpha(opacity=10); opacity:0.1; -moz-opacity:0.1}</STYLE>');document.write('<STYLE TYPE="text/css">.elemFader2, .elemFader2Step10, .elemFader2Step15, .elemFader2Step20 {  filter:alpha(opacity=20); opacity:0.2; -moz-opacity:0.2}</STYLE>');document.write('<STYLE TYPE="text/css">.elemFader3, .elemFader3Step10, .elemFader3Step15, .elemFader3Step20 {  filter:alpha(opacity=30); opacity:0.3; -moz-opacity:0.3}</STYLE>');document.write('<STYLE TYPE="text/css">.elemFader4, .elemFader4Step10, .elemFader4Step15, .elemFader4Step20 {  filter:alpha(opacity=40); opacity:0.4; -moz-opacity:0.4}</STYLE>');document.write('<STYLE TYPE="text/css">.elemFader5, .elemFader5Step10, .elemFader5Step15, .elemFader5Step20 {  filter:alpha(opacity=50); opacity:0.5; -moz-opacity:0.5}</STYLE>');document.write('<STYLE TYPE="text/css">.elemFader6, .elemFader6Step10, .elemFader6Step15, .elemFader6Step20 {  filter:alpha(opacity=60); opacity:0.6; -moz-opacity:0.6}</STYLE>');document.write('<STYLE TYPE="text/css">.elemFader7, .elemFader7Step10, .elemFader7Step15, .elemFader7Step20 {  filter:alpha(opacity=70); opacity:0.7; -moz-opacity:0.7}</STYLE>');document.write('<STYLE TYPE="text/css">.elemFader8, .elemFader8Step10, .elemFader8Step15, .elemFader8Step20 {  filter:alpha(opacity=80); opacity:0.8; -moz-opacity:0.8}</STYLE>');document.write('<STYLE TYPE="text/css">.elemFader9, .elemFader9Step10, .elemFader9Step15, .elemFader9Step20 {  filter:alpha(opacity=90); opacity:0.9; -moz-opacity:0.9}</STYLE>');JSFX.fadeElem_actionOnMouseOver=function(e)
{srcElement=e?e.target:event.srcElement;if(srcElement.className&&srcElement.className.indexOf("elemFader")!=-1){var fMatch=false;if(JSFX.FadeElemLockList!=null){for(var i=0;i<JSFX.FadeElemLockList.length;i++){if(JSFX.FadeElemLockList[i]==srcElement.id){fMatch=true;break;}}}
if(!fMatch){var step=JSFX.FadeElemAutoUp;if(srcElement.className.indexOf("Step10")!=-1)
step=10;else if(srcElement.className.indexOf("Step15")!=-1)
step=15;else if(srcElement.className.indexOf("Step20")!=-1)
step=20;JSFX.fadeUp(srcElement,step);}}
if(JSFX.FadeElemSavedOver!=null)
JSFX.FadeElemSavedOver(e);}
JSFX.fadeElem_actionOnMouseOut=function(e)
{srcElement=e?e.target:event.srcElement;if(srcElement.className&&srcElement.className.indexOf("elemFader")!=-1){var fMatch=false;if(JSFX.FadeElemLockList!=null){for(var i=0;i<JSFX.FadeElemLockList.length;i++){if(JSFX.FadeElemLockList[i]==srcElement.id){fMatch=true;break;}}}
if(!fMatch){var step=JSFX.FadeElemAutoUp;if(srcElement.className.indexOf("Step10")!=-1)
step=10;else if(srcElement.className.indexOf("Step15")!=-1)
step=15;else if(srcElement.className.indexOf("Step20")!=-1)
step=20;JSFX.fadeDown(srcElement,step);}}
if(JSFX.FadeElemSavedOut!=null)
JSFX.FadeElemSavedOut(e);}
JSFX.fadeElemAuto=function(minOpacity,stepUp,stepDown)
{if(minOpacity)
JSFX.FadeElemMinOpacity=minOpacity;if(stepUp)
JSFX.FadeElemAutoUp=stepUp;if(stepDown)
JSFX.FadeElemAutoDown=stepDown;JSFX.FadeElemSavedOver=document.onmouseover;JSFX.FadeElemSavedOut=document.onmouseout;document.onmouseover=JSFX.fadeElem_actionOnMouseOver;document.onmouseout=JSFX.fadeElem_actionOnMouseOut;}
JSFX.fadeUpElem=function(elemName,step,max)
{if(document.layers)
return;if(JSFX.FadeElemLockList!=null){for(var i=0;i<JSFX.FadeElemLockList.length;i++){if(JSFX.FadeElemLockList[i]==elemName){return;}}}
elem=document.getElementById(elemName);if(elem)
JSFX.fadeUp(elem,step,max);}
JSFX.fadeUp=function(elem,step,max)
{if(elem)
{if(!step)step=JSFX.FadeElemAutoUp;if(elem.fade==null)
{elem.fade=new Object();elem.fade.state="OFF";elem.fade.upStep=step;elem.fade.downStep=step;elem.fade.minOpacity=JSFX.FadeElemMinOpacity;if(max){elem.fade.maxOpacity=max;}
else
elem.fade.maxOpacity=JSFX.FadeElemMaxOpacity;elem.animate=JSFX.FadeElemAnimation;elem.fadeId="JSFX_FadeElem"+JSFX.FadeElemIdIndex++;window[elem.fadeId]=elem;if(elem.filters)
elem.fade.minOpacity=elem.filters.alpha.opacity;else
elem.fade.minOpacity=document.defaultView.getComputedStyle(elem,'').getPropertyValue('opacity')*100;elem.fade.index=elem.fade.minOpacity;}
if(elem.fade.state=="OFF")
{elem.fade.upStep=step;elem.fade.state="FADE_UP";elem.animate();}
else if(elem.fade.state=="FADE_UP_DOWN"||elem.fade.state=="FADE_DOWN")
{elem.fade.upStep=step;elem.fade.state="FADE_UP";}}}
JSFX.fadeDownElem=function(elemName,step)
{if(document.layers)
return;elem=document.getElementById(elemName);if(elem)
JSFX.fadeDown(elem,step);}
JSFX.fadeDown=function(elem,step)
{if(elem&&elem.fade)
{if(!step)step=JSFX.FadeElemAutoDown;if(elem.fade.state=="ON")
{elem.fade.downStep=step;elem.fade.state="FADE_DOWN";elem.animate();}
else if(elem.fade.state=="FADE_UP")
{elem.fade.downStep=step;elem.fade.state="FADE_UP_DOWN";}}}
JSFX.FadeElemAnimation=function()
{var fadeElemRunning=false;var elem=this;if(elem.fade)
{if(elem.fade.state=="FADE_UP")
{elem.fade.index+=elem.fade.upStep;if(elem.fade.index>elem.fade.maxOpacity)
elem.fade.index=elem.fade.maxOpacity;if(elem.filters)
elem.filters.alpha.opacity=elem.fade.index;else{elem.style.opacity=elem.fade.index/101;}
if(elem.fade.index==elem.fade.maxOpacity)
elem.fade.state="ON";else
fadeElemRunning=true;}
else if(elem.fade.state=="FADE_UP_DOWN")
{elem.fade.index+=elem.fade.upStep;if(elem.fade.index>elem.fade.maxOpacity)
elem.fade.index=elem.fade.maxOpacity;if(elem.filters)
elem.filters.alpha.opacity=elem.fade.index;else{elem.style.opacity=elem.fade.index/101;}
if(elem.fade.index==elem.fade.maxOpacity)
elem.fade.state="FADE_DOWN";fadeElemRunning=true;}
else if(elem.fade.state=="FADE_DOWN")
{elem.fade.index-=elem.fade.downStep;if(elem.fade.index<elem.fade.minOpacity)
elem.fade.index=elem.fade.minOpacity;if(elem.filters)
elem.filters.alpha.opacity=elem.fade.index;else{elem.style.opacity=elem.fade.index/101;}
if(elem.fade.index==elem.fade.minOpacity)
elem.fade.state="OFF";else
fadeElemRunning=true;}}
if(fadeElemRunning)
setTimeout("window['"+elem.fadeId+"'].animate()",40);}
JSFX.SetLockList=function(){JSFX.FadeElemLockList=new Array();for(var i=0;i<arguments.length;i++){JSFX.FadeElemLockList.push(arguments[i]);}}
JSFX.ResetLockList=function(){if(JSFX.FadeElemLockList){for(var i=0;i<JSFX.FadeElemLockList.length;i++){var step=JSFX.FadeElemAutoUp;var el=document.getElementById(JSFX.FadeElemLockList[i]);if(el&&el.fade){JSFX.fadeDown(el,step);}}}
JSFX.FadeElemLockList=null;}
JSFX.HasLockList=function(){return JSFX.FadeElemLockList!=null;}
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();}
Function.prototype.inherits=function(baseClass)
{function Blank(){}
this.base=Blank.prototype=baseClass.prototype;this.prototype=new Blank();this.prototype.constructor=this;};function BaseEffect(){this.effectCurrentFrame=0;this.effectStartOnTime=0;this.effectFinishOnTime=0;this.effectFPS=25.0;this.effectDelay=0.0;this.effectDuration=0.5;this.effectInterval=null;this.effectFrom=0.0;this.effectTo=1.0;this.effectRenderedFramesCount=0;this.effectEndFunction=null;}
BaseEffect.prototype.startEffect=function(){if(this.effectInterval){clearInterval(this.effectInterval);}
var timestamp=new Date().getTime();this.effectCurrentFrame=0;this.effectStartOnTime=this.effectDelay*1000;this.effectFinishOnTime=this.effectStartOnTime+(this.effectDuration*1000);this.effectStartOnTime+=timestamp;this.effectFinishOnTime+=timestamp;this.effectRenderedFramesCount=0;var self=this;this.effectInterval=setInterval(function(){self.loop();},40);}
BaseEffect.prototype.loop=function(){var timePos=new Date().getTime();if(timePos>=this.effectStartOnTime){if(timePos>=this.effectFinishOnTime){this.effectRenderedFramesCount++;this.renderFrame(1.0,this.effectRenderedFramesCount);clearInterval(this.effectInterval);this.effectInterval=null;this.renderEffectDone();return;}
var pos=(timePos-this.effectStartOnTime)/(this.effectFinishOnTime-this.effectStartOnTime);var frame=Math.round(pos*this.effectFPS*this.effectDuration);if(frame>this.effectCurrentFrame){this.effectRenderedFramesCount++;this.renderFrame(pos,this.effectRenderedFramesCount);this.effectCurrentFrame=frame;}}}
BaseEffect.prototype.renderFrame=function(pos,cFrame){pos*=(this.effectTo-this.effectFrom);pos+=this.effectFrom;this.renderEffect(pos,cFrame);}
BaseEffect.prototype.renderEffect=function(pos,cFrame){}
BaseEffect.prototype.renderEffectDone=function(){if(this.effectEndFunction)
this.effectEndFunction();}
BaseEffect.prototype.isRunning=function(){return(this.effectInterval!=null);}
BaseEffect.prototype.setDuration=function(sDuration){this.effectDuration=sDuration;}
function OpacityFadeEffect(secDuration){this.maxOpacity=1.0;OpacityFadeEffect.base.constructor.call(this);if(secDuration)
this.effectDuration=secDuration;}
OpacityFadeEffect.inherits(BaseEffect);OpacityFadeEffect.prototype.startFadeEffect=function(el,image,fadeOut,callback,maxOpacity){this.el=el;this.effectImg=image;this.effectEndFunction=callback;this.fadeOut=fadeOut;if(maxOpacity)
this.maxOpacity=maxOpacity;this.startEffect();}
OpacityFadeEffect.prototype.renderEffect=function(pos,cFrame){var el=this.el;if(cFrame==1&&this.effectImg){el.width=this.effectImg.width;el.height=this.effectImg.height;el.src=this.effectImg.src;}
var opacity=this.fadeOut?1.0-pos*this.maxOpacity:pos*this.maxOpacity;if(opacity==1.0){opacity=0.999999;}
if(el.filters)
el.filters.alpha.opacity=opacity*100;el.style.opacity=opacity;}
function OpacityCrossFadeEffect(){OpacityCrossFadeEffect.base.constructor.call(this);}
OpacityCrossFadeEffect.inherits(BaseEffect);OpacityCrossFadeEffect.prototype.startFadeEffect=function(el,el2,image,callback){this.el=el;this.el2=el2;this.effectImg=image;this.effectElement2Hidden=false;this.effectEndFunction=callback;this.startEffect();}
OpacityCrossFadeEffect.prototype.renderEffect=function(pos,cFrame){var el=this.el;var el2=this.el2;if(cFrame==1&&this.effectImg){el.width=this.effectImg.width;el.height=this.effectImg.height;el.src=this.effectImg.src;}
var opacity=pos;var fEnd=false;if(opacity==1.0){opacity=0.999999;fEnd=true;}
if(!this.effectElement2Hidden&&!fEnd&&opacity>0.9){el2.style.visibility="hidden";if(this.effectImg){el2.width=this.effectImg.width;el2.height=this.effectImg.height;el2.src=this.effectImg.src;}
this.effectElement2Hidden=true;}
if(fEnd){if(!this.effectElement2Hidden&&this.effectImg){el2.width=this.effectImg.width;el2.height=this.effectImg.height;el2.src=this.effectImg.src;}
if(el2.filters){el2.filters.alpha.opacity=100;}
el2.style.opacity="0.999999";el2.style.visibility="visible";el.style.visibility="hidden";el.style.opacity="0";if(el.filters){el.filters.alpha.opacity=0;}}else{if(el.filters){el.filters.alpha.opacity=opacity*100;}
el.style.opacity=opacity;if(!this.effectElement2Hidden){opacity=1.0-opacity;if(el2.filters){el2.filters.alpha.opacity=opacity*100;}
el2.style.opacity=opacity;}}}
function OpacityCrossFadeEffectTest(){OpacityCrossFadeEffectTest.base.constructor.call(this);}
OpacityCrossFadeEffectTest.inherits(BaseEffect);OpacityCrossFadeEffectTest.prototype.startFadeEffect=function(el,el2,callback){this.el=el;this.el2=el2;this.effectElement2Hidden=false;this.effectEndFunction=callback;this.startEffect();}
OpacityCrossFadeEffectTest.prototype.renderEffect=function(pos,cFrame){var el=this.el;var el2=this.el2;var opacity=pos;var fEnd=false;if(opacity==1.0){opacity=0.999999;fEnd=true;}
if(!this.effectElement2Hidden&&!fEnd&&opacity>0.9){el2.style.visibility="hidden";this.effectElement2Hidden=true;}
if(fEnd){if(el.filters){el.filters.alpha.opacity=100;}
el.style.opacity="0.999999";el2.style.visibility="hidden";el2.style.opacity="0";if(el2.filters){el2.filters.alpha.opacity=0;}}else{if(el.filters){el.filters.alpha.opacity=opacity*100;}
el.style.opacity=opacity;if(!this.effectElement2Hidden){opacity=1.0-opacity;if(el2.filters){el2.filters.alpha.opacity=opacity*100;}
el2.style.opacity=opacity;}}}
function SlideElementEffect(el,from,to,callback){SlideElementEffect.base.constructor.call(this);this.effectEndFunction=callback;this.effectDuration=0.3;this.el=el;this.from=from;this.to=to;}
SlideElementEffect.inherits(BaseEffect);SlideElementEffect.prototype.renderEffect=function(pos,cFrame){var scrollTop=document.body.scrollTop;if(scrollTop==0){if(window.pageYOffset)
scrollTop=window.pageYOffset;else
scrollTop=(document.body.parentElement)?document.body.parentElement.scrollTop:0;}
this.el.style.top=this.from+Math.round(pos*(this.to-this.from+scrollTop))+document.body.scrollTop+"px";}
function ScrollElementEffect(el,from,to,callback,callbackPostRender,fHasScrollTo){ScrollElementEffect.base.constructor.call(this);this.effectEndFunction=callback;this.callbackPostRender=callbackPostRender;this.effectDuration=0.5;this.el=el;this.from=from;this.to=to;this.fHasScrollTo=fHasScrollTo;}
ScrollElementEffect.inherits(BaseEffect);ScrollElementEffect.prototype.startScrollEffect=function(from,to,callback){this.from=from;this.to=to;if(callback)
this.effectEndFunction=callback;this.startEffect();}
ScrollElementEffect.prototype.renderEffect=function(pos,cFrame){var y=this.from+Math.round(pos*(this.to-this.from));if(this.fHasScrollTo)
this.el.scrollTo(0,y);else
this.el.style.marginTop=(-1*y)+"px";if(this.callbackPostRender){this.callbackPostRender();}}
function SetHeightDoubleElementEffect(el,fromHeight,toHeight,el2,fromHeight2,toHeight2,callback,setHidden,duration,setDisplayNone,keepCenteredWinHeight,centerOffsetTop){SetHeightDoubleElementEffect.base.constructor.call(this);this.effectDuration=duration?duration:0.3;this.el=el;this.el2=el2;this.fromHeight=fromHeight;this.toHeight=toHeight;this.fromHeight2=fromHeight2;this.toHeight2=toHeight2;this.effectEndFunction=callback;this.setHidden=setHidden;this.expanded=false;this.setDisplayNone=setDisplayNone;this.keepCenteredWinHeight=keepCenteredWinHeight;this.centerOffsetTop=centerOffsetTop;}
SetHeightDoubleElementEffect.inherits(BaseEffect);SetHeightDoubleElementEffect.prototype.setExpandedState=function(state){this.expanded=state;}
SetHeightDoubleElementEffect.prototype.isExpanded=function(){return this.expanded;}
SetHeightDoubleElementEffect.prototype.getElement=function(){return this.el;}
SetHeightDoubleElementEffect.prototype.quickCollapse=function(){if(this.expanded||this.effectInterval){if(this.effectInterval){clearInterval(this.effectInterval);this.effectInterval=null;}
if(this.setHidden)
this.el.style.visibility='hidden';if(this.setDisplayNone)
this.el.style.display="none";this.expanded=false;}}
SetHeightDoubleElementEffect.prototype.toggleExpansion=function(){if(this.effectInterval)
return;this.el.style.height=(this.expanded?this.toHeight:this.fromHeight)+"px";if(this.setHidden)
this.el.style.visibility='visible';var _expanded=this.expanded;this.startEffect();return _expanded;}
SetHeightDoubleElementEffect.prototype.renderEffect=function(pos,cFrame){if(this.expanded){this.el.style.height=this.toHeight+Math.round(pos*(this.fromHeight-this.toHeight))+"px";if(this.el2)
this.el2.style.height=this.toHeight2+Math.round(pos*(this.fromHeight2-this.toHeight2))+"px";}else{var height=this.fromHeight+Math.round(pos*(this.toHeight-this.fromHeight));this.el.style.height=height+"px";if(this.keepCenteredWinHeight){var y=Math.floor((this.keepCenteredWinHeight-height)/2);if(y<0)
y=0;this.el.style.top=(y+this.centerOffsetTop)+"px";}
if(this.el2)
this.el2.style.height=this.fromHeight2+Math.round(pos*(this.toHeight2-this.fromHeight2))+"px";}}
SetHeightDoubleElementEffect.prototype.renderEffectDone=function(){this.expanded=!this.expanded;if(this.setHidden&&!this.expanded){this.el.style.visibility='hidden';}
var self=this;if(this.effectEndFunction)
this.effectEndFunction(self);}
function SetWidthElementEffect(el,fromWidth,toWidth,callback,duration,keepCenteredWinWidth,centerOffsetLeft){SetWidthElementEffect.base.constructor.call(this);this.effectDuration=duration?duration:0.3;this.el=el;this.fromWidth=fromWidth;this.toWidth=toWidth;this.effectEndFunction=callback;this.expanded=false;this.keepCenteredWinWidth=keepCenteredWinWidth;this.centerOffsetLeft=centerOffsetLeft;}
SetWidthElementEffect.inherits(BaseEffect);SetWidthElementEffect.prototype.setExpandedState=function(state){this.expanded=state;}
SetWidthElementEffect.prototype.isExpanded=function(){return this.expanded;}
SetWidthElementEffect.prototype.getElement=function(){return this.el;}
SetWidthElementEffect.prototype.quickCollapse=function(){if(this.expanded||this.effectInterval){if(this.effectInterval){clearInterval(this.effectInterval);this.effectInterval=null;}
this.expanded=false;}}
SetWidthElementEffect.prototype.toggleExpansion=function(){if(this.effectInterval)
return;this.el.style.width=(this.expanded?this.toWidth:this.fromWidth)+"px";if(this.setHidden)
this.el.style.visibility='visible';var _expanded=this.expanded;this.startEffect();return _expanded;}
SetWidthElementEffect.prototype.renderEffect=function(pos,cFrame){if(this.expanded){this.el.style.width=this.toWidth+Math.round(pos*(this.fromWidth-this.toWidth))+"px";}else{var width=this.fromWidth+Math.round(pos*(this.toWidth-this.fromWidth));this.el.style.width=width+"px";if(this.keepCenteredWinWidth){var left=Math.floor((this.keepCenteredWinWidth-(width))/2)+this.centerOffsetLeft;if(left<0)
left=0;this.el.style.marginLeft=left+"px";}}}
SetWidthElementEffect.prototype.renderEffectDone=function(){var self=this;if(this.effectEndFunction)
this.effectEndFunction(self);}
function ElementShaker(idElement,repeats,arrayMovements,shakerDoneCallback,fSkipHorizontal){this.element=document.getElementById(idElement);this.repeats=repeats;this.arrayMovements=arrayMovements;this.fSkipHorizontal=fSkipHorizontal;this.cLength=arrayMovements.length/3;this.counter=-1;this.cCycle=0;this.shakerDoneCallback=shakerDoneCallback;this.callback();}
ElementShaker.prototype.callback=function(){this.counter++;if(this.counter*3>=this.arrayMovements.length){if(this.repeats!=0){this.cCycle++;if(this.cCycle==this.repeats){if(this.shakerDoneCallback)
this.shakerDoneCallback();return;}}
this.counter=0;}
var dx=this.arrayMovements[this.counter*3];var dy=this.arrayMovements[this.counter*3+1];var timeout=this.arrayMovements[this.counter*3+2];var oldX=this.element.offsetLeft;var oldY=this.element.offsetTop;if(!this.fSkipHorizontal)
this.element.style.marginLeft=(oldX+dx)+"px";this.element.style.top=(oldY+dy)+"px";var self=this;setTimeout(function(){self.callback();},timeout);}
var ua=navigator.userAgent.toLowerCase();var divw=0;var divh=0;if(document.getElementById||document.all)
document.write('<div id="imgtrailer" style="z-index: 300; position:absolute;visibility:hidden;"></div>')
function gettrailobject(){if(document.getElementById)
return document.getElementById("imgtrailer")
else if(document.all)
return document.all.trailimagid}
function gettrailobj(){if(document.getElementById)
return document.getElementById("imgtrailer").style
else if(document.all)
return document.all.trailimagid.style}
function truebody(){return(!window.opera&&document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body}
function trailOff(){document.onmousemove='';gettrailobj().visibility="hidden";}
function trailOn(thumbimg,thw,thh){if(ua.indexOf('opera')==-1&&ua.indexOf('safari')==-1){gettrailobj().left="-500px";divthw=parseInt(thw)+2;gettrailobject().innerHTML='<div style="background-color: #b2a99d; border: 1px none #808080; padding:10px; width:'+divthw+'px;"><div style="background-color: black; border: 1px solid #808080;"><img src="'+thumbimg+'" border="0" width="'+thw+'" height="'+thh+'"></div></div>';gettrailobj().visibility="visible";divw=parseInt(thw)+25;divh=parseInt(thh)+130;document.onmousemove=followmouse;}}
function followmouse(e){var xcoord=-100;var ycoord=-50;if(typeof e!="undefined"){xcoord+=e.pageX
ycoord+=e.pageY}else if(typeof window.event!="undefined"){xcoord+=truebody().scrollLeft+event.clientX
ycoord+=truebody().scrollTop+event.clientY}
var docwidth=document.all?truebody().scrollLeft+truebody().clientWidth:pageXOffset+window.innerWidth-15
var docheight=document.all?Math.max(truebody().scrollHeight,truebody().clientHeight):Math.max(document.body.offsetHeight,window.innerHeight)
gettrailobj().left=xcoord+"px"
gettrailobj().top=ycoord+"px"}
var dDiv=null;var dDivSize=null;var dDivDoMarginLeft=false;var xOff=0;var yOff=0;var xMin=0;var winSize=null;function moveDiv(e,childCall){if(dDiv){if(e.button>1){dDiv=null;return true;}
var xMouse=e.pageX||e.clientX||0;var yMouse=e.pageY||e.clientY||0;if(childCall){var theElement=dDiv;while(theElement!=null){xMouse+=theElement.offsetLeft;yMouse+=theElement.offsetTop;theElement=theElement.offsetParent;}
if(browser.ie6up){yMouse-=dScrollTop[1];}}
var x=xMouse-xOff;var y=yMouse-yOff;if(x<xMin)
x=xMin;if(y<dScrollTop[1]){y=dScrollTop[1];}
if(dDivSize){if(x+dDivSize.clientWidth-dScrollTop[0]+(browser.ns6up?20:0)>winSize[0])
x=winSize[0]-dDivSize.clientWidth+dScrollTop[0]-(browser.ns6up?20:0);if(y+dDivSize.clientHeight-dScrollTop[1]>winSize[1]){y=winSize[1]-dDivSize.clientHeight+dScrollTop[1];}}
if(dDivDoMarginLeft)
dDiv.style.marginLeft=x+"px";else
dDiv.style.left=x+"px";dDiv.style.top=y+"px";return false;}
return true;}
function catchDiv(idDiv,idDivSize,e,fDoMarginLeft){dDiv=document.getElementById(idDiv);if(idDivSize)
dDivSize=document.getElementById(idDivSize);else
dDivSize=null;xMin=0;var theElement=document.getElementById("sivans_container");while(theElement!=null){xMin+=theElement.offsetLeft;theElement=theElement.offsetParent;}
xMin+=250;if(typeof dDiv.setCapture!="undefined"){dDiv.setCapture();}
dDiv.onmouseup=releaseDiv;winSize=getWindowSize();dScrollTop=getPageScrollTop();if(fDoMarginLeft)
dDivDoMarginLeft=true;else
dDivDoMarginLeft=false;xOff=(e.pageX||e.clientX||0)-parseInt(dDiv.offsetLeft);yOff=(e.pageY||e.clientY||0)-parseInt(dDiv.offsetTop);return false;}
function releaseDiv(){if(dDiv&&typeof dDiv.releaseCapture!="undefined"){dDiv.releaseCapture();}
dDiv=null;}
var dynWindows=new Array();function onDynWindowLoad(idDiv){setElementsByIdsDisplayBlock(idDiv);}
function getDynWindow(idDiv){for(var i=0;i<dynWindows.length;i++){if(dynWindows[i].getDivID()==idDiv)
return dynWindows[i];}
return null;}
function getNewDynWindow(idDiv,cx,cy,src,fNoAutoClose){var dynWindow=getDynWindow(idDiv);if(!dynWindow)
return new DynWindow(idDiv,cx,cy,src,fNoAutoClose);else
return dynWindow;}
function hideDynWindow(idDiv){var dynWindow=getDynWindow(idDiv);if(dynWindow)
dynWindow.hide();}
function DynWindow(idDiv,cx,cy,src,fNoAutoClose){this.idDiv=idDiv;this.cx=cx;this.cy=cy;this.src=src;this.loaded=false;this.fNoAutoClose=fNoAutoClose;dynWindows.push(this);}
DynWindow.prototype.getDivID=function(){return this.idDiv;}
DynWindow.prototype.show=function(strCallbackFunction){if(!strCallbackFunction)
strCallbackFunction="onDynWindowLoad";for(var i=0;i<dynWindows.length;i++){if(dynWindows[i].getDivID()!=this.idDiv&&!dynWindows[i].isNoAutoClose()){dynWindows[i].hide();}}
if(!this.loaded){var el=document.getElementById(this.idDiv);var d=document.createElement('DIV');d.innerHTML='<iframe id="'+this.idDiv+'_iframe" allowtransparency="true" width="'+this.cx+'" height="'+this.cy+'" frameborder="0" src="'+this.src+'" onload="'+strCallbackFunction+'(\''+this.idDiv+'\');"></iframe>';el.appendChild(d);this.loaded=true;}else{setElementsByIdsVisible(this.idDiv+"_iframe",this.idDiv);setElementsByIdsDisplayBlock(this.idDiv);}}
DynWindow.prototype.isLoaded=function(){return this.loaded;}
DynWindow.prototype.isNoAutoClose=function(){return this.fNoAutoClose;}
DynWindow.prototype.hide=function(){setElementsByIdsHidden(this.idDiv+"_iframe",this.idDiv);if(browser.ie)
setElementsByIdsDisplayNone(this.idDiv);}
DynWindow.prototype.getIFrame=function(){return document.getElementById(this.idDiv+"_iframe");}
var adEffects=new Array();var adsOverlappingCam=new Array();var yCam=0;var cyCam=0;function adBoxOnLoad(idBox){setElementsByIdsDisplayBlock(idBox);setElementsByIdsVisible(idBox+"_iframe");toggleAdBox(idBox,function(){adBoxCloseCallback(idBox);});}
function openAdBox(idBox){if((browser.ffmac)&&idBox=="adbox_sunfleet"){JSFX.SetLockList("banner_ernstson","banner_sunfleet","banner_synsam","arrow_sunfleet","arrow_ernstson","arrow_synsam");}
var cy=360;var dynWnd=getNewDynWindow(idBox,150,cy,"/leftad.jsp?id="+idBox,true);if(dynWnd.isLoaded()){adBoxOnLoad(idBox);}else{dynWnd.show("adBoxOnLoad");}}
function openAdBox2(idBox){var dynWnd=null;if(idBox=='adbox_amhair_2')
dynWnd=getNewDynWindow(idBox,294,414,"/amhairtjejkvall.jsp",true);else if(idBox=="adbox_complett_12man_2")
dynWnd=getNewDynWindow(idBox,673,479,"/isfitnessmars10.jsp",true);else if(idBox=="adbox_sunfleet_2")
dynWnd=getNewDynWindow(idBox,334,470,"/sunfleetvideum.jsp",true);else if(idBox=="adbox_synsam_2")
dynWnd=getNewDynWindow(idBox,345,570,"/synsam_converse.jsp",true);else if(idBox=="adbox_studioc_2")
dynWnd=getNewDynWindow(idBox,406,520,"/studioc.jsp",true);dynWnd.show();}
function closeAdBox(e,idBox){var srcElement=e?(e.target?e.target:e.srcElement):event.srcElement;if(srcElement&&srcElement.nodeName=='A'){return true;}
toggleAdBox(idBox,function(){adBoxCloseCallback(idBox);});return false;}
function adBoxCloseCallback(id){var currentCamLocation=(typeof getVisibleEvent!='undefined'&&getVisibleEvent!=null?getVisibleEvent().getLocation():"");var el=document.getElementById(id);if(currentCamLocation&&el.style.visibility=='hidden'){setElementsByIdsVisible(currentCamLocation+'_cam',currentCamLocation+'_cambg');setElementsByIdsDisplayBlock(currentCamLocation+'_cam');setElementsByIdsDisplayNone(currentCamLocation+'_camimg');}
if((browser.ffmac)&&id=="adbox_sunfleet"){if(el.style.visibility=='hidden'){JSFX.ResetLockList();}
var dynwnd=getDynWindow(id);if(dynwnd){var el2=dynwnd.getIFrame().contentWindow.document.getElementById("sunfleet_flash");if(el2){el2.style.visibility=el.style.visibility=='hidden'?"hidden":"visible";}}}}
function toggleAdBox(idShow,callback){var i;for(i=0;i<adEffects.length;i++){if(adEffects[i]!=adEffects[idShow]){adEffects[i].quickCollapse();if((browser.ffmac)&&idShow!='adbox_sunfleet'&&JSFX.HasLockList()){JSFX.ResetLockList();}}}
var iframe=document.getElementById(idShow+"_iframe");var elHeight=0;if(iframe.contentWindow){var box=iframe.contentWindow.document.getElementById(idShow);if(box){elHeight=box.clientHeight;iframe.style.height=elHeight+"px";}}
var el=document.getElementById(idShow);var currentCamLocation=(typeof getVisibleEvent!='undefined'&&getVisibleEvent!=null?getVisibleEvent().getLocation():"");if(!adEffects[idShow]){if(currentCamLocation){var elCam=document.getElementById(currentCamLocation+'_cam');if(elCam){if(!yCam){yCam=getElementAbsoluteOffsetTop(elCam);cyCam=elCam.clientHeight;}
if(elCam&&(el.offsetTop>yCam&&el.offsetTop<yCam+cyCam)||(el.offsetTop<yCam&&el.offsetTop+elHeight>yCam)){adsOverlappingCam[idShow]=true;}}}
adEffects[idShow]=new SetHeightDoubleElementEffect(el,0,elHeight,null,0,0,callback,true,0.2,true);adEffects.push(adEffects[idShow]);}
if(el.style.visibility!='visible'){if(adsOverlappingCam[idShow]){setElementsByIdsHidden(currentCamLocation+'_cam',currentCamLocation+'_cambg');setElementsByIdsDisplayNone(currentCamLocation+'_cam');setElementsByIdsDisplayBlock(currentCamLocation+'_camimg');}}
if(adEffects[idShow].toggleExpansion()){}
if(!adsOverlappingCam[idShow]){setElementsByIdsVisible(currentCamLocation+'_cam',currentCamLocation+'_cambg');setElementsByIdsDisplayBlock(currentCamLocation+'_cam');setElementsByIdsDisplayNone(currentCamLocation+'_camimg');}}
var dw_Event={add:function(obj,etype,fp,cap){cap=cap||false;if(obj.addEventListener)obj.addEventListener(etype,fp,cap);else if(obj.attachEvent)obj.attachEvent("on"+etype,fp);},remove:function(obj,etype,fp,cap){cap=cap||false;if(obj.removeEventListener)obj.removeEventListener(etype,fp,cap);else if(obj.detachEvent)obj.detachEvent("on"+etype,fp);},DOMit:function(e){e=e?e:window.event;if(!e.target)e.target=e.srcElement;if(!e.preventDefault)e.preventDefault=function(){e.returnValue=false;return false;}
if(!e.stopPropagation)e.stopPropagation=function(){e.cancelBubble=true;}
return e;}}
function addLoadEvent(func){var oldQueue=window.onload?window.onload:function(){};window.onload=function(){oldQueue();func();}}
