/* function startGallery(id){ //alert(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'){ _id('galleryContent').innerHTML = AjaxRequest.responseText; LBsetLightbox(); //alert(AjaxRequest.responseText); //_id('bannerleft').style.display = 'none'; _id('t_1').firstChild.style.display = 'none'; oldPic = _id('t_1').firstChild.id.replace('thumb_', ''); _id('galleryPicText_1').style.display = 'block'; oldMargin = 0; oldPicCount = 1; } } function LBsetLightbox() { var h = 714; var w = 856; if(_id('Lightbox')) { _id('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 = '#ffffff'; newE.style.filter = 'alpha(opacity=70)'; newE.style.opacity = '.70'; document.body.insertBefore(newE, document.body.firstChild); } if(_id('LightboxContent')) { e1 = _id('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 = '50px'; 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/lightBoxBG.png)'; newA.style.overflow = 'hidden'; newA.style.textAlign = 'center'; document.body.insertBefore(newA, document.body.firstChild); } _id('LightboxContent').innerHTML = _id('galleryContent').innerHTML; if(navigator.appName == "Microsoft Internet Explorer") { _id('Lightbox').attachEvent('onclick', LBcloseLightbox); } else { _id('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){ _id('thumb_'+oldPic+'').style.display = 'block'; _id('pic_'+oldPic+'').style.zIndex = '99990'; _id('galleryPicText_'+_id('thumb_'+oldPic+'').parentNode.id.replace('t_', '')+'').style.display = 'none'; SetOpacity(_id(''+e.id.replace('thumb_', 'pic_')+''),100); if(oldMargin <= m){moveMarginLeft(oldMargin, m, e);} else {moveMarginRight(oldMargin, m, e);} _id('galleryPicText_'+e.parentNode.id.replace('t_', '')+'').style.display = 'block'; fadeOutPic(_id('pic_'+oldPic+''), 100); oldPic = e.id.replace('thumb_', ''); oldMargin = m; oldPicCount = e.parentNode.id.replace('t_', ''); } function LBNext() { if(_id('t_'+(parseInt(oldPicCount) + 1)+'')) { thumbClick(_id('t_'+(parseInt(oldPicCount) + 1)+'').firstChild, (parseInt(oldPicCount) * 79)); } } function LBPrev() { if(_id('t_'+(parseInt(oldPicCount) - 1)+'')) { thumbClick(_id('t_'+(parseInt(oldPicCount) - 1)+'').firstChild, ((parseInt(oldPicCount) * 79) - 158)); } } function moveMarginLeft(m,m2,e2){var e = _id('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 = _id('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);}} */ // Start socialmedia function sociala_media() { $.ajax({ url: '/ajax/facebook.asp', cache: false, dataType: "html", async: true, success: function(data) { $("#facebook .content").html(data); }, error: function() { $("#youtube .content .information").html("Begäran gjorde timeout"); } }); $.ajax({ url: '/ajax/flickr.asp', cache: false, dataType: "html", async: true, success: function(data) { $("#flickr .content").html(data); makeFlickrLinks(); }, error: function() { $("#youtube .content .information").html("Begäran gjorde timeout"); } }); $.ajax({ url: '/ajax/youtube.asp', cache: false, dataType: "html", async: true, success: function(data) { $("#youtube .content").html(data); makeYoutubeLinks(); }, error: function() { $("#youtube .content .information").html("Begäran gjorde timeout"); } }); $.ajax({ url: '/ajax/bloggar.asp', cache: false, dataType: "html", async: true, success: function(data) { $("#bloggar .content").html(data); }, error: function() { $("#youtube .content .information").html("Begäran gjorde timeout"); } }); } $(document).ready(function() { // sociala_media(); $("#btnTipsa").click(function() { if ($("#tipsa").is(":hidden")) { $("#tipsa").slideDown("slow"); } else { $("#tipsa").slideUp("slow"); } }); $("#sendTip").click(function() { if ($("#form_tipsa").valid() == true){ $.ajax({ type: "POST", url: "/ajax/tips.asp?form=YEY", cache: false, data: $("#form_tipsa").serialize(), success: function(html){ if(html=="nogo") { alert("Ej skickat. Kontrollera dina uppgifter."); }else{ $('#tipsa').html(html); } }, error: function() { alert('Något gick fel!'); } }); } return false; }); }); function makeYoutubeLinks() { $(".lightbox_youtube").colorbox({ inline: false, iframe:true, innerWidth:"640px", innerHeight:"480px" }); } function makeFlickrLinks() { $('.flickrlink').each(function(i){ $(this).colorbox({ inline: true, href: ".userdata:eq(" + i + ")", initialWidth: "320", initialHeight: "280", opacity: 0.9, speed: 400, transition: "elastic", rel: "flickr", current: "{current} av {total}", next: "Nästa", previous: "Förra", close: "Stäng" }); }); } function makeSMNavigation() { $(".btn_prev").click(function() { var target = "#" + $(this).parent().parent().attr("id"); $(target + " .content .data:first").hide(); var movePost = $(target + " .content .data:last"); $(target + " .content .data:last").remove(); $(movePost).prependTo($(target + " .content")); $(target + " .content .data:first").show(); makeFlickrLinks(); makeYoutubeLinks(); }); $(".btn_next").click(function() { var target = "#" + $(this).parent().parent().attr("id"); var movePost = $(target + " .content .data:first"); $(target + " .content .data:first").remove(); $(movePost).appendTo($(target + " .content")); $(target + " .content .data:last").hide(); $(target + " .content .data:first").show(); makeFlickrLinks(); makeYoutubeLinks(); }); } // Slut socialmedia function showElement(Element) { //document.getElementById(Element).style.display = 'block'; document.getElementById(Element).style.visibility = 'visible'; } function hideElement(Element) { //document.getElementById(Element).style.display = 'none'; document.getElementById(Element).style.visibility = 'hidden'; } var steg2 = false; var steg3 = false; function processSteg1(obj) { if (obj.value == "gruppe") { if (steg2) { opacity("spaguide_2", 100, 0, 500); setTimeout("hideElement('spaguide_2')", 500); steg2 = false; } if (steg3) { opacity("spaguide_3", 100, 0, 500); setTimeout("hideElement('spaguide_3')", 500); steg3 = false; } checkall("spaguide_form", "kon", false); document.getElementById('onskar').selectedIndex = "0" hideResult(); setTimeout("makeRequest('/spaguide-do.asp', '?typ=" + obj.value + "')", 200); } else { //(obj.value == "self") if (!steg2) { hideResult(); showElement("spaguide_2"); opacity("spaguide_2", 0, 100, 500); setTimeout("document.getElementById('spaguide_2').style.filter = 'none'", 500); steg2 = true; } } } function hideResult() { opacity("result", 100, 0, 200); setTimeout("document.getElementById('result').innerHTML = ''", 200); } var throwawayNode; function processSteg2(obj) { var onskar = document.getElementById("onskar"); var selected = onskar.selectedIndex; if (obj.value == "kvinna") { if(document.getElementById("option_barbering")){ var barbering = document.getElementById("option_barbering"); throwawayNode = onskar.removeChild(barbering); if (selected == 6){ selected = 0; onskar.selectedIndex = selected; hideResult(); return false; } onskar.selectedIndex = selected; } //hideElement("option_barbering"); } else { if(!document.getElementById("option_barbering")){ onskar.appendChild(throwawayNode); onskar.selectedIndex = selected; } //showElement("option_barbering"); } if (!steg3) { showElement("spaguide_3"); opacity("spaguide_3", 0, 100, 500); steg3 = true; } else if (selected != 0) { hideResult(); //get(document.getElementById('spaguide_form')); setTimeout("get(document.getElementById('spaguide_form'))", 200); } } function processSteg3(obj) { var onskar = document.getElementById("onskar"); var selected = onskar.selectedIndex; hideResult(); if (selected != 0) { setTimeout("get(document.getElementById('spaguide_form'))", 200); } } function checkall(formname,checkname,thestate){ var el_collection=eval("document.forms."+formname+"."+checkname); //var el_collection=eval("document.getElementById('"+id+"')"); for (c=0;c opacEnd) { for(i = opacStart; i >= opacEnd; i--) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } else if(opacStart < opacEnd) { for(i = opacStart; i <= opacEnd; i++) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } } //change the opacity for different browsers function changeOpac(opacity, id) { var object = document.getElementById(id).style; object.opacity = (opacity / 100); object.MozOpacity = (opacity / 100); object.KhtmlOpacity = (opacity / 100); object.filter = "alpha(opacity=" + opacity + ")"; } var http_request = false; function makeRequest(url, parameters) { http_request = false; if (window.XMLHttpRequest) { // Mozilla, Safari,... http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { //http_request.overrideMimeType('text/xml; charset=iso-8859-1'); // set type accordingly to anticipated content type //http_request.overrideMimeType('text/xml'); http_request.overrideMimeType('text/html'); } } else if (window.ActiveXObject) { // IE try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!http_request) { alert('Cannot create XMLHTTP instance'); return false; } http_request.onreadystatechange = alertContents; http_request.open('GET', url + parameters, true); http_request.send(null); } function alertContents() { if (http_request.readyState == 4) { if (http_request.status == 200) { var result = http_request.responseText; //alert(URLDecode(result)); document.getElementById('result').innerHTML = URLDecode(result); opacity("result", 0, 100, 500); } else { document.getElementById('result').innerHTML = '

There was a problem with the request.

'; opacity("result", 0, 100, 500); } } } function get(obj) { var getstr = "?"; var inputs = obj.getElementsByTagName("input"); for (i=0; i= 8)) { alert('You have not entered a correct date'); } else { datein = datum.substr(3,2) + "/" + datum.substr(0,2) + "/" + datum.substr(6,4); window.open('https://booking.ihotelier.com/istay/istay.jsp?adults=' + vuxna + '&children=' + barn + '&rooms=' + rum + '&DateIn=' + datein + '&length=' + natter + '&hotelid=72725&languageid=' + lang + '', '_blank',',width=920,height=650,scrollbars=no,resizable=yes,status=no,toolbar=no,menubar=no,location=no'); } }