var it_IFrameClass=function(){this.decodeUrl=function(d){return decodeURIComponent(unescape(d).replace(/%/g,"%25"))};this.insertIFrame=function(f,e,g,d){if(g==null){g=1}if(d==null){d=1}document.writeln('<iframe name="'+f+'" id="'+f+'" width="'+g+'" height="'+d+'" src="about:blank" marginheight="0" marginwidth="0" frameborder="0" scrolling="no"></iframe>\n');document.writeln("<SCRIPT>frames['"+f+"'].location.href = '"+this.escapeQuotes(e)+"';</SCRIPT>\n")};this.getParams=function(e,g){if(g==null){g=new Array()}var k=this.getQueryString(e);if(k){var j=k.split("&");for(var f=0;f<j.length;f++){var h=j[f];var d=h.indexOf("=");if(d!=-1){this.addParam(g,this.decodeUrl(h.substring(0,d)),this.decodeUrl(h.substring(d+1)))}}}return g};this.getQueryString=function(e){var d=e.indexOf("?");return d!=-1?e.substring(d+1):null};this.addParam=function(e,d,f){var g=new Object();g.name=d;if(e[g.name]!=null){return}g.value=f;e[g.name]=g.value;e[e.length]=g};var a=/\\/i;var b=/'/i;var c=/"/i;this.escapeQuotes=function(d){d=d.replace(a,"\\\\");d=d.replace(b,"\\'");d=d.replace(c,'\\"');return d};this.removeStartingSlash=function(d){if(d.charAt(0)=="/"){d=d.substring(1,d.length)}return d};this.removeEndingSlash=function(d){if(d.charAt(d.length-1)=="/"){d=d.substring(0,d.length-1)}return d};this.getBasePath=function(d){return this.extractBasePathParts(d).basePath};this.extractBasePathParts=function(d){if(d==null){d=window.it_location?window.it_location:document.location.href}var j;var i="http://".length;if(d.length>i&&d.substring(0,i)=="http://"){j=i}else{j=0}var h=d.indexOf("/",j);if(h==-1){return null}var e=d.substring(j,h);if(e.indexOf("localhost")===0){e+="/illico";h+="/illico".length}var g;var f=d.indexOf("/",h+1);if(f==-1){g=null}else{g=d.substring(h+1,f);if(g.length!=2){g=null}}if(g==null){if(e.indexOf("illicotravel.com")!=-1){g="fr"}}var k="http://"+e+"/";if(g!=null){k+=g+"/"}return{host:e,subSite:g,basePath:k}};this.getLastElementWithId=function(g,e){var f=document.getElementsByTagName("*");for(var d=f.length-1;d>=0;d--){if(f[d].id==g){return f[d]}}return e?null:this.getLastElementWithId(g.toLowerCase(),true)};this.toQueryString=function(f){var g=[];for(var d=0;d<f.length;d++){var e=f[d];g.push(encodeURIComponent(e.name)+"="+encodeURIComponent(e.value))}return g.join("&")}};var it_IFrame=new it_IFrameClass();var it_PageParams=function(c){this.params=[];this.elementSrc=null;if(c!=null){if(c.indexOf("http://")===0){this.elementSrc=c}else{this.elementSrc=it_IFrame.getLastElementWithId(c).src}it_IFrame.getParams(this.elementSrc,this.params)}var b=window.it_location?window.it_location:document.location.href;it_IFrame.getParams(b,this.params);var a=this;this.get=function(f,e,h){var g=null;if(h!=null){h=h.charAt(0).toUpperCase()+h.slice(1);g=d(f+h)}if(g==null){g=d(f)}if(g==null&&e!=null){g=e}return g};this.getBoolean=function(e){var f=this.get(e);if(f==null){return null}else{return f==="true"}};this.getMandatory=function(e,g){var f=this.get(e,null,g);if(f==null){it_Utils.throwError("The parameter '"+e+"' is missing")}return f};var d=function(e){var f=a.params[e];if(f==null){f=window[e]}return f}};var lzwDecode=function(k){if(k==null){return null}var b={};var j=(k+"").split("");var d=j[0];var c=d;var g=[d];var a=256;var e;for(var h=1;h<j.length;h++){var f=j[h].charCodeAt(0);if(f<256){e=j[h]}else{e=b[f]?b[f]:(c+d)}g.push(e);d=e.charAt(0);b[a]=c+d;a++;c=e}return g.join("")};if(typeof(it_frameWidth)=="undefined"){var it_frameWidth="100%"}if(typeof(it_frameHeight)=="undefined"){var it_frameHeight="1500"}if(typeof(it_minHeight)=="undefined"){var it_minHeight="300"}if(typeof(it_debug)=="undefined"){var it_debug=false}var it_receiverSize=1;if(it_debug){it_receiverSize=200}var it_scriptUrl=it_IFrame.getLastElementWithId("it_include").src;var it_scriptBasePathParts=it_IFrame.extractBasePathParts(it_scriptUrl);if(typeof(it_webAppRoot)=="undefined"){var it_webAppRoot=it_scriptBasePathParts.host}it_webAppRoot=it_IFrame.removeEndingSlash(it_webAppRoot);var it_localTest=(it_webAppRoot.indexOf("localhost")!=-1||it_webAppRoot.indexOf("127.0.0.1")!=-1);var it_pageParams=new it_PageParams("it_include");if(typeof(it_path)=="undefined"){var it_path=""}else{it_path=it_IFrame.removeStartingSlash(it_path)}var it_subSite=it_scriptBasePathParts.subSite;if(it_subSite==null){it_subSite="fr"}var it_heightChanged=function(b){var a=parseInt(b)+30;if(a<it_minHeight){a=it_minHeight}document.getElementById("it_autoResizeContent").style.height=a+"px"};var it_getIFramePosition=function(){var c=0;var b=0;var a=document.getElementById("it_autoResizeContent");do{c+=a.offsetLeft||0;b+=a.offsetTop||0;a=a.offsetParent}while(a);return{x:c,y:b}};var it_frameContentUrlChanged=function(a){if(typeof(it_frameUrlChanged)!="undefined"){it_frameUrlChanged(a)}};var it_scroll=function(b){b=parseInt(b);var a=it_getIFramePosition().y;document.body.scrollTop=a+b};var it_sendResults=function(dataStr){if(typeof(it_resultsChanged)!="undefined"){var data=eval("("+dataStr+")");var iFramePosition=it_getIFramePosition();var iFrameWidth=document.getElementById("it_autoResizeContent").offsetWidth;var elements=data.elements;for(var i=0;i<elements.length;i++){var element=elements[i];element.x=iFramePosition.x;element.y+=iFramePosition.y;element.width=iFrameWidth}it_resultsChanged(data)}};var it_FrameUrlBuilder=function(c,b,a,d){this.webAppRoot=d;this.buildUrl=function(){var n=null;var j=null;if(c.affilType!=undefined){n=c.affilType}if(c.affilId!=undefined){j=c.affilId}var o="flight";if(c.section!=undefined){o=c.section}if(b==""){b=o+"/index.html"}var f=null;if(j!=null){if(n=="pi760"){var g={name:"src"};if(o=="car"){g.value="picar760";f=308}else{g.value="publicidees760";f=204}if(!it_localTest){this.webAppRoot="www.illicotravel.com"}c[g.name]=g.value;c[c.length]=g}}var m="http://"+this.webAppRoot+"/"+a+"/"+b;var e="";var l=false;for(var k=0;k<c.length;k++){var g=c[k];if(g.name=="affilId"||g.name=="affilTracker"||g.name=="src"||g.name=="css"){m=m+";"+g.name+"="+g.value}else{if(g.name!="affilType"&&g.name!="section"&&g.name!="tracking"){if(!l){e+="?";l=true}else{e+="&"}e=e+g.name+"="+escape(g.value)}}}if(typeof(it_resultsChanged)!="undefined"){m=m+";sendResults=true"}var h=document.location.href;var p=h.indexOf("?");if(p!=-1){h=h.substring(0,p)}if(!l){e="?"}else{e+="&"}e+="referer="+escape(h);m=m+e;if(j!=null){if(!it_localTest&&n=="pi760"){var m="http://tracking.publicidees.com/clic.php?partid="+j+"&progid="+f+"&url="+escape(m);if(c.tracking!=undefined){m=m+"&cb="+escape(c.tracking)}}}return m}};var it_frameUrlBuilder=new it_FrameUrlBuilder(it_pageParams.params,it_path,it_subSite,it_webAppRoot);var it_frameUrl=it_frameUrlBuilder.buildUrl();it_webAppRoot=it_frameUrlBuilder.webAppRoot;var it_indexSlash=it_webAppRoot.indexOf("/");var it_indexColon=it_webAppRoot.indexOf(":");if(it_indexSlash===-1){it_indexSlash=10000}if(it_indexColon===-1){it_indexColon=10000}var it_webAppHost=it_webAppRoot.substring(0,Math.min(it_indexSlash,it_indexColon));var it_connectionId=new Date().getTime();var it_autoResizeUrl="http://"+it_webAppRoot+"/"+it_subSite+"/affil/whitelabel/common/autoResize.jsp?connectionId="+it_connectionId+"&frameUrl="+escape(it_frameUrl);it_IFrame.insertIFrame("it_autoResizeContent",it_autoResizeUrl,it_frameWidth,it_frameHeight);var it_receiverFlashUrl="http://"+it_webAppRoot+"/"+it_subSite+"/common/bridge/receiver.swf?connectionId="+it_connectionId+"&friendDomain="+it_webAppHost;var source='<OBJECT id="receiver" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+it_receiverSize+'" height="'+it_receiverSize+'" align="middle">\n<PARAM name="allowScriptAccess" value="always" />\n<PARAM name="movie" value="'+it_receiverFlashUrl+'" />\n<PARAM name="quality" value="high" />\n<PARAM name="bgcolor" value="#ffffff" />\n<EMBED name="receiver" src="'+it_receiverFlashUrl+'" quality="high" bgcolor="#ffffff" width="'+it_receiverSize+'" height="'+it_receiverSize+'" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n</OBJECT>\n';document.write(source);var it_messageReceived=function(a,b){b=lzwDecode(b);if(window[a]){window[a](b)}};if(it_debug){alert("it_frameWidth: "+it_frameWidth+"\nit_frameHeight: "+it_frameHeight+"\nit_minHeight: "+it_minHeight+"\nit_path: "+it_path+"\nscript src: "+document.getElementById("it_include").src+"\nit_webAppRoot: "+it_webAppRoot+"\nit_webAppHost: "+it_webAppHost+"\nit_connectionId: "+it_connectionId+"\nit_frameUrl: "+it_frameUrl+"\nit_autoResizeUrl: "+it_autoResizeUrl)};