// JavaScript Document $(document).ready(function() { /**$(".fancy").fancybox(); $("div#filmer a").fancybox({ 'frameHeight': 392, 'frameWidth': 480 }); **/ $(".chat_konf").mouseover(function() { $(".chat_picture").css("background-image", "url(/bilder/chat/chat_therese.png)"); }); $(".chat_priv").mouseover(function() { $(".chat_picture").css("background-image", "url(/bilder/chat/chat_monica.png)"); }); }); function onPageLoad(f, v, v2, v3){ if(window.addEventListener) window.addEventListener('load', function(){ f(v, v2, v3); }, false); else if(window.attachEvent) window.attachEvent('onload', function(){ f(v, v2, v3); }); } function ChangeOpacity2(e,opacity) { if(opacity >= 100) { e.style.opacity = '1.00'; e.style.filter = 'alpha(opacity=100)'; } else { e.style.opacity = '0.' + opacity + ''; } e.style.filter = 'alpha(opacity=' + opacity + ')'; } function ChangeBackground(bild, amount) { if (bild == amount) { bild = 0; } else { bild++; } document.getElementById('BackgroundHolder').style.background = document.getElementById('BackgroundDiv').style.background; ChangeOpacity2(document.getElementById('BackgroundHolder'), 100); document.getElementById('BackgroundDiv').style.background = 'url(' + document.getElementById('Background_' + bild + '').src + ')'; FadeBg(bild, amount); } var opacityNr = 100; function FadeBg(bild, amount) { if (opacityNr <= 5) { ChangeOpacity2(document.getElementById('BackgroundHolder'), 0); document.getElementById('BackgroundHolder').style.background = ''; ChangeOpacity2(document.getElementById('BackgroundHolder'), 100); opacityNr = 100; setTimeout(function(){ChangeBackground(bild, amount)},4000); } else { opacityNr = opacityNr - 10; ChangeOpacity2(document.getElementById('BackgroundHolder'), opacityNr); setTimeout(function(){FadeBg(bild, amount)},40); } } function submitThisForm(e) { var resultat = testForm(e,attTestas) if (resultat) { document.getElementById("verifyFrm").value = "verified"; e.action = window.location; } return resultat; } function startGallery(id){ AjaxRequest.open("GET", "/ajax/galleri.asp?id="+id+"", true); AjaxRequest.onreadystatechange = function(){startGallery2()}; AjaxRequest.send(null); } function startGallery2(){ if(AjaxRequest.readyState==4 || AjaxRequest.readyState=='complete'){ document.getElementById('galleryContent').innerHTML = AjaxRequest.responseText; LBsetLightbox(); //alert(AjaxRequest.responseText); document.getElementById('t_1').firstChild.style.display = 'none'; oldPic = document.getElementById('t_1').firstChild.id.replace('thumb_', ''); document.getElementById('galleryPicText_1').style.display = 'block'; oldMargin = 0; oldPicCount = 1; Cufon.refresh(); } } function LBsetLightbox2() { var h = 500; var w = 1000; if(document.getElementById('Lightbox')) { document.getElementById('Lightbox').style.display = 'block'; } else { newE = document.createElement("div"); newE.id = 'Lightbox'; newE.style.position = 'absolute'; newE.style.top = '0px'; newE.style.left = '0px'; newE.style.height = '' + document.documentElement.scrollHeight + 'px'; newE.style.width = '100%'; newE.style.cursor = 'pointer'; newE.style.zIndex = '999'; newE.style.backgroundColor = '#000000'; newE.style.filter = 'alpha(opacity=70)'; newE.style.opacity = '.70'; document.body.insertBefore(newE, document.body.firstChild); } if(document.getElementById('LightboxContent')) { e1 = document.getElementById('LightboxContent'); e1.style.display = 'block'; e1.style.top = '100px'; e1.style.left = '' + (((document.documentElement.offsetWidth / 2) - parseInt(w / 2)) - document.documentElement.scrollLeft) + 'px'; } else { newA = document.createElement("div"); newA.id = 'LightboxContent'; newA.style.position = 'absolute'; newA.style.top = '100px'; newA.style.left = '' + (((document.documentElement.offsetWidth / 2) - parseInt(w / 2)) - document.documentElement.scrollLeft) + 'px'; newA.style.height = '' + h + 'px'; newA.style.width = '' + w + 'px'; newA.style.zIndex = '1001'; newA.style.background = 'url(/bilder/design/lightbox_bg.gif)'; document.body.insertBefore(newA, document.body.firstChild); } document.getElementById('LightboxContent').innerHTML = document.getElementById('lightKarta').innerHTML; if(navigator.appName == "Microsoft Internet Explorer") { document.getElementById('Lightbox').attachEvent('onclick', LBcloseLightbox); } else { document.getElementById('Lightbox').addEventListener('click', LBcloseLightbox,false); } } function LBcloseLightbox2() { document.getElementById('Lightbox').style.display = 'none'; document.getElementById('LightboxContent').style.display = 'none'; document.getElementById('LightboxContent').innerHTML = ''; if (document.getElementById('flashcontent')) { document.getElementById('flashcontent').style.visibility = 'visible'; } } function LBsetLightbox() { var h = 667; var w = 806; if(document.getElementById('Lightbox')) { document.getElementById('Lightbox').style.display = 'block'; } else { newE = document.createElement("div"); newE.id = 'Lightbox'; newE.style.position = 'absolute'; newE.style.top = '0px'; newE.style.left = '0px'; newE.style.height = '' + document.documentElement.scrollHeight + 'px'; newE.style.width = '100%'; newE.style.cursor = 'pointer'; newE.style.zIndex = '999'; newE.style.backgroundColor = '#000000'; newE.style.filter = 'alpha(opacity=70)'; newE.style.opacity = '.70'; document.body.insertBefore(newE, document.body.firstChild); } if(document.getElementById('LightboxContent')) { e1 = document.getElementById('LightboxContent'); e1.style.display = 'block'; e1.style.top = '100px'; e1.style.left = '' + (((document.documentElement.offsetWidth / 2) - parseInt(w / 2)) - document.documentElement.scrollLeft) + 'px'; } else { newA = document.createElement("div"); newA.id = 'LightboxContent'; newA.style.position = 'absolute'; newA.style.top = '100px'; newA.style.left = '' + (((document.documentElement.offsetWidth / 2) - parseInt(w / 2)) - document.documentElement.scrollLeft) + 'px'; newA.style.height = '' + h + 'px'; newA.style.width = '' + w + 'px'; newA.style.zIndex = '1001'; newA.style.background = 'url(/bilder/design/lightbox_bg.gif)'; document.body.insertBefore(newA, document.body.firstChild); } document.getElementById('LightboxContent').innerHTML = document.getElementById('galleryContent').innerHTML; if(navigator.appName == "Microsoft Internet Explorer") { document.getElementById('Lightbox').attachEvent('onclick', LBcloseLightbox); } else { document.getElementById('Lightbox').addEventListener('click', LBcloseLightbox,false); } } function LBcloseLightbox() { _id('Lightbox').style.display = 'none'; _id('LightboxContent').style.display = 'none'; _id('LightboxContent').innerHTML = ''; if (document.getElementById('flashcontent')) { document.getElementById('flashcontent').style.visibility = 'visible'; } } var oldPic = ''; var oldMargin = 0; var oldPicCount = 1; function thumbClick(e, m){ newoldPic = e.id.replace('thumb_', ''); $('#pic_'+newoldPic+'').show(); document.getElementById('thumb_'+oldPic+'').style.display = 'block'; document.getElementById('pic_'+oldPic+'').style.zIndex = '99990'; document.getElementById('galleryPicText_'+document.getElementById('thumb_'+oldPic+'').parentNode.id.replace('t_', '')+'').style.display = 'none'; SetOpacity(document.getElementById(''+e.id.replace('thumb_', 'pic_')+''),100); if(oldMargin <= m){moveMarginLeft(oldMargin, m, e);} else {moveMarginRight(oldMargin, m, e);} document.getElementById('galleryPicText_'+e.parentNode.id.replace('t_', '')+'').style.display = 'block'; fadeOutPic(document.getElementById('pic_'+oldPic+''), 100); oldPic = e.id.replace('thumb_', ''); oldMargin = m; oldPicCount = e.parentNode.id.replace('t_', ''); } function LBNext() { if(document.getElementById('t_'+(parseInt(oldPicCount) + 1)+'')) { thumbClick(document.getElementById('t_'+(parseInt(oldPicCount) + 1)+'').firstChild, (parseInt(oldPicCount) * 79)); } } function LBPrev() { if(document.getElementById('t_'+(parseInt(oldPicCount) - 1)+'')) { thumbClick(document.getElementById('t_'+(parseInt(oldPicCount) - 1)+'').firstChild, ((parseInt(oldPicCount) * 79) - 158)); } } function moveMarginLeft(m,m2,e2){var e = document.getElementById('galleryThumbMover'); if(m>=m2){e.style.marginLeft='-'+m2+'px';e2.style.display='none';} else{e.style.marginLeft='-'+m+'px';m=m+79;setTimeout(function(){moveMarginLeft(m,m2,e2)},40);} } function moveMarginRight(m,m2,e2){var e = document.getElementById('galleryThumbMover'); if(m<=m2){e.style.marginLeft='-'+m2+'px';e2.style.display='none';} else{e.style.marginLeft='-'+m+'px';m=m-79;setTimeout(function(){moveMarginRight(m,m2,e2)},40);} } function fadeOutPic(e,f){if(f<=0){SetOpacity(e,0);e.style.zIndex=1;}else{SetOpacity(e,f);f-=15;setTimeout(function(){fadeOutPic(e,f)},30);}} function _showId(e){SetDisplayById(e, 'block'); } function _hideId(e){SetDisplayById(e, 'none'); } function SetOpacity(e,o){if(o>=100){o=100;e.style.opacity='1.00';}else{if(o<=9){e.style.opacity='.0'+o;}else{e.style.opacity='0.'+o;}}e.style.filter='alpha(opacity='+o+')';} function SetDisplay(e,show){ e.style.display = show; } function SetDisplayById(id,show){ _id(id).style.display = show; }