var skUrl="";var skUrlSrt="http://iframe-";var skUrlLst=".skiset.com/";var skRegexp1=/[^\w|\-]/gi;var skRegexp2=/http(s)?:\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;var skWidth=410;var skHeight=410;var skLang={fr:"com",gb:"co.uk",es:"es",de:"de",it:"it",dk:"dk",nl:"nl",cat:"cat",us:"us"};var skError=[];var isSafari=(/Safari/.test(navigator.userAgent));var ftSession=0;function concatUrl(a){skUrl=skUrl.concat(a)}function submitSkSessionForm(){if(ftSession==0){ftSession=1;document.getElementById("form_skiset").submit();setTimeout("affSkFrame()",2000)}}function affSkFrame(){document.getElementById("iframe_skiset").src=skUrl}function checkParams(a){if(typeof(a.env)!="undefined"&&a.env=="dev"){skUrlLst=".skiset.dev.com/"}if(typeof(a.partner)!="undefined"){a.partner=a.partner.replace(skRegexp1,"");concatUrl(skUrlSrt+a.partner+skUrlLst+"partner/"+a.partner+"/")}else{skError.push("partner not set")}createUri(a)}function showSk(a){checkParams(a);if(skError.length==0){if(typeof(a.width)!="undefined"){skWidth=a.width}if(typeof(a.height)!="undefined"){skHeight=a.height}var d=skUrl;var c="";var b="";if(isSafari){d=skUrlSrt+a.partner+skUrlLst+"blank.php";c="<form id='form_skiset' enctype='application/x-www-form-urlencoded' action='"+skUrlSrt+a.partner+skUrlLst+"session.php' target='iframe_skiset' method='post'></form>";b="onload='submitSkSessionForm()'"}document.write("<iframe id='iframe_skiset' src='"+d+"' "+b+" frameborder='0' width='"+skWidth+"' height='"+skHeight+"' allowtransparency='true' scrolling='no'></iframe>"+c)}else{document.write("<div style='padding: 20px'><span style='color:#444444; font-weight: bold'>Some Error repertoried :</span><ul style='list-style-type:circle;	margin:10px 20px;'><li><span style='color:#FF0000;'>"+skError.join("</span></li><li><span style='color:#FF0000;'>")+"</span></li></ul></div>")}}function createUri(a){concatUrl("?zfd=1&setUrl=1");if(typeof(a.urlMotor)!="undefined"&&skRegexp2.test(a.urlMotor)){concatUrl("&urlMotor="+encodeURIComponent(a.urlMotor))}else{skError.push("Url Motor not set or not well formated")}if(typeof(a.urlResa)!="undefined"&&skRegexp2.test(a.urlResa)){concatUrl("&urlResa="+encodeURIComponent(a.urlResa))}else{skError.push("Url Resa not set or not well formated")}if(typeof(a.shop)!="undefined"&&parseInt(a.shop)){concatUrl("&shop_id="+a.shop)}else{if(typeof(a.resort)!="undefined"&&parseInt(a.resort)){concatUrl("&resort="+parseInt(a.resort))}else{if(typeof(a.state)!="undefined"&&parseInt(a.state)){concatUrl("&state_id="+parseInt(a.state))}else{if(typeof(a.country)!="undefined"&&parseInt(a.country)){concatUrl("&country_id="+parseInt(a.country))}}}}if(typeof(a.lang)!="undefined"&&typeof(skLang[a.lang])!="undefined"){concatUrl("&sklang="+a.lang)}};
