var addthis_config={username:"engadinstmoritz",data_use_flash:false}
var _is_layer=0;if(window!=top)_is_layer=1;var base_location;try{var tmps=parent.location.href;}
catch(err){_is_layer=0;}
if(_is_layer){base_location=removeShowPageVar(removeHash(parent.location.href))+"?showpage="+getPagePath(location.href);if(typeof(buildicons_page)!='undefined'&&buildicons_page=="pauschalen"){var tmp_season="";if(parent.location.href.indexOf(".ch/sommer")>0){tmp_season="sommer/";}
if(parent.location.href.indexOf(".ch/winter")>0){tmp_season="winter/";}
base_location="http://www.engadin.stmoritz.ch/"+tmp_season+getVarValue(print_link,"l")+"/pauschalenliste/rm4.pauschalenliste/"+"pauschale."+getVarValue(print_link,"so");}}
else{base_location=location.href;}
if(typeof(buildicons_page)!='undefined'&&buildicons_page=="weather_iframe"){base_location=location.href;}
var meta_title=document.getElementsByTagName("title")[0].innerHTML;function getPagePath(url){var tmp=url.replace("http://","");if(tmp.indexOf('/')>0){return tmp.substring(tmp.indexOf('/'));}
else{return"/";}}
function removeVars(url){if(url.indexOf('?')>0)return url.substring(0,url.indexOf('?'));return url;}
function removeShowPageVar(url){if(url.indexOf('?showpage')>0)return url.substring(0,url.indexOf('?showpage'));return url;}
function removeHash(url){if(url.indexOf('#')>0)return url.substring(0,url.indexOf('#'));return url;}
function str_replace(search,replace,subject){return subject.split(search).join(replace);}
function convertURI(url){return str_replace("/","__s__",str_replace(".","__d__",str_replace("?","__q__",url)));}
function getVarValue(url,varName){var query=url.substring(url.indexOf('?')+1);var vars=query.split("&");for(var i=0;i<vars.length;i++){var pair=vars[i].split("=");if(pair[0]==varName){return pair[1];}}
return null;}
function removeDoubleSlash(str){return str_replace("//","/",str);}
function SendLinkPopup(){var send_form_url="http://www.engadin.stmoritz.ch/winter/layer_pages/sendlink/";var sending_url_="";var parent_page="";if(typeof(buildicons_page)!='undefined'&&buildicons_page=="pauschalen"){sending_url_="is_layer."+0+"/title."+meta_title+"/url."+convertURI("/"+getVarValue(print_link,"l")+"/pauschalenliste/rm4.pauschalenliste/pauschale.")+getVarValue(print_link,"so");}
else{if(_is_layer){parent_page="/parent_url."+convertURI(getPagePath(removeVars(parent.location.href)));}
sending_url_="is_layer."+_is_layer+"/title."+meta_title+"/url."+convertURI(getPagePath(location.href))+parent_page;}
var winl=(screen.width-750)/2;var wint=(document.body.offsetHeight-100);var winprops='height='+400+',width=400,top=135,left='+winl+',resizable=1,scrollbars=1';var sendlinkwindow=window.open(send_form_url+sending_url_,"sendlink",winprops);sendlinkwindow.focus();}
function printPage(){if(typeof(buildicons_page)!='undefined'&&buildicons_page=="pauschalen"){openCentered(print_link,'print','scrollbars=1',500,700);return false;}
if(typeof(buildicons_page)!='undefined'&&buildicons_page=="weather_iframe"){var newWindow=window.open("/winter/"+lang2+"/weather_iframe/print_pdf.1",'_blank');newWindow.focus();return false;}
if(_is_layer){window.print();}
else{var newWindow=window.open(removeHash(location.href)+"?print_mode=yes",'_blank');newWindow.focus();return false;}}
function addthisConvert(url){return str_replace("/","%2F",str_replace("=","%3D",str_replace("?","%3F",str_replace(":","%3A",str_replace("&","%26",url)))));}
function buildicons(){var add_icons_0="";var add_icons="",print_link='href="javascript:void(0)" onclick="printPage();"';if(typeof(buildicons_page)!='undefined'&&buildicons_page=="weather_iframe"){add_icons_0="<a href=\"javascript:parent.hideIframeWeather();\" name=\"internal\"><img alt=\"close\" src=\"/images/design/1/close_btn.gif\"/></a>";print_link='href="print_pdf.1/" target="_blank" name="internal"';}
if(typeof(buildicons_page)!='undefined'&&(buildicons_page=="hotels"||buildicons_page=="ferienwohnungen"||buildicons_page=="ferienwohnungen_buchen"||buildicons_page=="tophit")){add_icons="<a href=\"#top\" onclick=\"OpenUrlFrame('/winter/'+ lang2 + '/forms/kontakt2/', 0, 1); setIframeHeight();\"><img src=\"/images/design/2/icon_contact.gif\" style=\"margin:0 0 1px 0\"></a>";}
if(typeof(buildicons_page)!='undefined'&&buildicons_page=="mice"){add_icons="<a href=\"#top\" onclick=\"OpenUrlFrame('/winter/'+ lang2 + '/mice/kontakt/', 0, 1); setIframeHeight();\"><img src=\"/images/design/2/icon_contact.gif\" style=\"margin:0 0 1px 0\"></a>";}
var _icons={code:' \
  <div class="addthis_toolbox" addthis:url="'+base_location+'" addthis:title="'+meta_title+'" style="float:right;padding-bottom:4px;"> \
  '+add_icons_0+' \
   <a class="addthis_button_facebook" title="Diese Seite auf Ihrem Facebook-Profil anzeigen"><img src="/winter/images/design/ii_facebook.gif" title="Diese Seite auf Ihrem Facebook-Profil anzeigen" style="margin: 0 5px;border:0;"></a> \
   <a class="addthis_button_twitter" title="Diese Seite twittern"><img src="/winter/images/design/ii_twitter.gif" title="Diese Seite twittern" style="margin: 0 5px 0 0;border:0;"></a> \
   <a href="javascript:void(0)" onclick="SendLinkPopup();"><img src="/winter/images/design/ii_email.gif" title="Diese Seite als Mail versenden" style="margin: 0 5px 0px 0;border:0;"></a> \
   <a '+print_link+'><img src="/winter/images/design/1/print.gif" title="Diese Seite drucken" style="margin: 0 5px 1px 0;border:0;"></a> \
  '+add_icons+'</div> \
  '}
var tmp_icons=document.getElementById("buildicons").innerHTML;document.getElementById("buildicons").innerHTML=_icons.code+tmp_icons;}
if(typeof(buildicons_page)!='undefined'&&buildicons_page=="pauschalen"){if(tags.indexOf(",special_offer")>0){buildicons();}}
if(typeof(buildicons_page)=='undefined'||buildicons_page!="pauschalen"){buildicons();}
if(tags.indexOf("redesign_winter")>0||tags.indexOf("redesign_sommer")>0||tags.indexOf("sommer_redesign")>0){document.write('<link href="http://estm2-test.cms.estm.xiag.ch/files/css/utils.css" type="text/css" rel="stylesheet" />');document.write('<link href="http://estm2-test.cms.estm.xiag.ch/files/css/text.css" type="text/css" rel="stylesheet" />');document.write('<link href="http://estm2-test.cms.estm.xiag.ch/files/css/soms.css" type="text/css" rel="stylesheet" />');}
