if(typeof SMC=='undefined'){SMC={};}
SMC.__q='Search...';SMC.__wch=new Array();SMC.__int_wch=null;SMC.__cur_wch=null;document.observe("dom:loaded",initGlobals);el='inter-version-win';elc='currency-win';var lang='en';var classns="";function createCookie(name,value,days){var expires="";if(days==-1){var date=new Date();date.setTime(date.getTime()-(3600));expires="; expires="+date.toGMTString();return false;}
else{if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60));expires="; expires="+date.toGMTString();}}
document.cookie=name+"="+value+expires+"; path=/";}
function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);}
return null;}
function eraseCookie(name){createCookie(name,"",-1);}
function initGlobals(){lang=document.getElementsByTagName("body")[0].getAttribute("lang");SMC.livebox=new SMC.Livebox();if($("ttaahelp"))Event.observe($("ttaahelp"),'click',function(e){$("ttaatxt").style.display="block";Event.stop(e);Event.observe(window.document,'click',function(){$("ttaatxt").style.display="none";},false);return false;},false);if($("ttaaclose"))Event.observe($("ttaaclose"),'click',function(e){$("ttaatxt").style.display="none";return false;},false);if($('inter-version')){Element.addClassName('inter-version-win','clicktohide');$$('#inter-version-win *').each(function(element){Element.addClassName(element,'clicktohide');});if(Prototype.Browser.IE){SMC.__int_wch=SMC.Utils.createWCH($('inter-version-win'));}
Event.observe($('inter-version'),'click',function(e){if(Prototype.Browser.IE){SMC.Utils.setupWCH(SMC.__int_wch,$('inter-version-win'));SMC.__int_wch.style.zIndex=-1;SMC.Utils.showWCH(SMC.__int_wch);}
Event.stop(e);Effect.run($(el),!Element.visible(el),20);Event.observe(window.document,'mousedown',HideWindow,false);return false;},false);Event.observe($("q"),'focus',function(e){if($F('q')==SMC.__q)$('q').value='';},false);Event.observe($("q"),'blur',function(e){if($F('q')=='')$('q').value=SMC.__q;},false);SMC.__q=$F('q');if(SMC.User!=undefined&&!SMC.User.myprofile.has_email){new SMC.SSRequest({namespace:'request_submit_contact'});}}
Event.observe($("nl-form"),'submit',submitRSSFeed,false);Event.observe($("nl-email"),'click',function(e){$("nl-email").value="";$("nl-status").style.display="none"},false);if($('currencies')){Element.addClassName('currency-win','clicktohide');$$('#currency-win li').each(function(element){Element.addClassName(element,'clicktohide');Event.observe(element,'click',function(){classns=$w(element.className);if(classns[0].substring(2)!="")currency=classns[0].substring(2);eraseCookie('currency');createCookie('currency',currency);},false);});if(Prototype.Browser.IE){SMC.__cur_wch=SMC.Utils.createWCH($('currency-win'));}
Event.observe($('currencies'),'click',function(e){document.getElementById('tip_currency').style.display='none';if(Prototype.Browser.IE){SMC.Utils.setupWCH(SMC.__cur_wch,$('currency-win'));SMC.__cur_wch.style.zIndex=-1;SMC.Utils.showWCH(SMC.__cur_wch);}
Event.stop(e);Effect.run($(elc),!Element.visible(elc),20);Event.observe(window.document,'mousedown',HideWindow,false);return false;},false);}
if($('livesupport')){Event.observe($('livesupport'),'click',function(e){launch_support(lang);},false);}
menu('main-menu');if($('ht-list'))hr();if($('contest_publicity')){if(readCookie('ads-contest')==0)$('contest_publicity').hide();Event.observe($('contest_publicity'),'click',function(){Effect.run($('contest_publicity'),false,20);createCookie('ads-contest',0,1);},false);}
setCalendarBP();if($('best_price'))Event.observe('submit','click',sendMail,false);}
function hr(){if($('ht-list')){$$('#ht-list .ht-top .tt-more').each(function(element){htmlnav='<img class="tt-icon plus" src="/images/icons/sign_plus.gif" width="11" height="11" />';new Insertion.Bottom(element.parentNode,htmlnav);});$$('#ht-list .tt-icon').each(function(element){Event.observe(element,'click',function(e){if(e!='undefined'&&e!=false){Event.stop(e);ele=Event.element(e);if(element.src.indexOf('sign_plus')>-1)element.src='/images/icons/sign_less.gif';else element.src='/images/icons/sign_plus.gif';Element.toggle(ele.previousSibling);Element.toggle(ele.previousSibling.previousSibling);}},false);});}}
function menu(nav){if(Prototype.Browser.IE){var k=0;$$("#"+nav+" li").each(function(li){if(li.lastChild.tagName=="UL"||li.lastChild.tagName=="ul"){li.setAttribute("num",k);SMC.__wch[k]=SMC.Utils.createWCH(li.lastChild);li.onmouseover=function(){var ul=this.lastChild;var ki=this.getAttribute("num");SMC.__wch[ki].style.zIndex=-1;ul.style.display="block";SMC.Utils.setupWCH(SMC.__wch[ki],ul);SMC.Utils.showWCH(SMC.__wch[ki]);};li.onmouseout=function(){var ki=this.getAttribute("num");this.lastChild.style.display="none";SMC.Utils.hideWCH(SMC.__wch[ki]);};k++;}});}}
function HideWindow(e){Event.stop(e);ele=Event.element(e);var ele_class=Element.classNames(ele);if(ele!=null&&ele_class!='clicktohide'&&Element.visible(el)){Effect.run($(el),false,20);Event.stopObserving(window.document,'mousedown',HideWindow);}
if(ele!=null&&ele_class!='clicktohide'&&Element.visible(elc)){Effect.run($(elc),false,20);Event.stopObserving(window.document,'mousedown',HideWindow);}
if(Prototype.Browser.IE)SMC.Utils.hideWCH(SMC.__int_wch);if(Prototype.Browser.IE)SMC.Utils.hideWCH(SMC.__cur_wch);return false;}
function setCalendar(){var lang=document.getElementsByTagName("body")[0].getAttribute("lang");Event.observe('e6','focus',function(){displayCalendar($('e6'),'yyyy-mm-dd',$('e6'),lang,$('e8'));},false);Event.observe('e7','click',function(){displayCalendar($('e6'),'yyyy-mm-dd',$('e6'),lang,$('e8'));},false);Event.observe('e8','focus',function(){displayCalendar($('e8'),'yyyy-mm-dd',$('e8'),lang);},false);Event.observe('e9','click',function(){displayCalendar($('e8'),'yyyy-mm-dd',$('e8'),lang);},false);Event.observe('e6','change',setFBDate,false);Event.observe('e8','change',setFBDate,false);Event.observe('e12','click',function(){if(setFBDate()){hhotelDispoprice($('fbcrs'));}},false);}
function setCalendar_travelpro(){var lang=document.getElementsByTagName("body")[0].getAttribute("lang");Event.observe('e6','focus',function(){displayCalendar($('e6'),'yyyy-mm-dd',$('e6'),lang,$('e8'));},false);Event.observe('e7','click',function(){displayCalendar($('e6'),'yyyy-mm-dd',$('e6'),lang,$('e8'));},false);Event.observe('e8','focus',function(){displayCalendar($('e8'),'yyyy-mm-dd',$('e8'),lang);},false);Event.observe('e9','click',function(){displayCalendar($('e8'),'yyyy-mm-dd',$('e8'),lang);},false);}
function setCalendar_travelpro_grupo(){var lang=document.getElementsByTagName("body")[0].getAttribute("lang");Event.observe('e10','focus',function(){displayCalendar($('e10'),'yyyy-mm-dd',$('e10'),lang,$('e12'));},false);Event.observe('e11','click',function(){displayCalendar($('e10'),'yyyy-mm-dd',$('e10'),lang,$('e12'));},false);Event.observe('e12','focus',function(){displayCalendar($('e12'),'yyyy-mm-dd',$('e12'),lang);},false);Event.observe('e13','click',function(){displayCalendar($('e12'),'yyyy-mm-dd',$('e12'),lang);},false);}
function setCalendarBP(){var lang=document.getElementsByTagName("body")[0].getAttribute("lang");Event.observe('e6','focus',function(){displayCalendar($('e6'),'yyyy-mm-dd',$('e6'),lang);},false);Event.observe('e7','click',function(){displayCalendar($('e6'),'yyyy-mm-dd',$('e6'),lang);},false);}
function setFBDate(){var form=$('fbcrs');var date_dat=new Array();date_dat=form['checkin'].value.split('-');var current1=new Date(date_dat[0],date_dat[1]-1,date_dat[2]);form['fromyear'].value=date_dat[0];form['frommonth'].value=date_dat[1];form['fromday'].value=date_dat[2];date1=current1.getTime();date_dat=form['checkout'].value.split('-');var current2=new Date(date_dat[0],date_dat[1]-1,date_dat[2]);date2=current2.getTime();form['nbdays'].value=(date2-date1)/86400000;var current3=new Date();var current4=new Date(current3.getFullYear(),current3.getMonth(),current3.getDate());var today=current4.getTime();var lang=document.getElementsByTagName("body")[0].getAttribute("lang");if(date1<today){alert(langText[lang]['crs'][0]);form['checkin'].focus();return false;}
if(date1>=date2){alert(langText[lang]['crs'][1]);form['checkout'].focus();return false;}
if(form['nbdays'].value>30){alert(langText[lang]['crs'][4]);form['checkout'].focus();return false;}
if((form['e6'].value=='yyyy-mm-dd')||(form['e8'].value=='yyyy-mm-dd')){alert(langText[lang]['crs'][2]);form['checkin'].focus();return false;}
return true;}
function findHotelDestiny(e){Event.stop(e);if($('e2').value=='')window.location='/cuba-hotels-resorts/';else if($F('e2').substring(0,6)=='CUBASM')window.location='/common/redirect.php?type=crs_hotels&q='+$F('e2');else window.location='/common/redirect.php?type=crs_destinations&q='+$F('e2');}
Effect={};Effect.fade=function(ref,counter){if(ref.OriginalOpacity==null&&ref.__zp_opacitySaved==null){ref.OpacitySaved=true;ref.OriginalOpacity=document.all?ref.style.filter:ref.style.opacity!=null?ref.style.opacity:ref.style.MozOpacity;}
var md=null;var currentOpacity=(!isNaN(parseFloat(ref.OriginalOpacity||1))?parseFloat(ref.OriginalOpacity||1):((md=ref.OriginalOpacity.match(/alpha\(opacity=(\d+)\)/i))?parseInt(md[1])/100:1))*counter/100;if(ref.filters){if(!ref.style.filter.match(/alpha/i)){ref.style.filter+=' alpha(opacity='+(currentOpacity*100)+')';}else if(ref.filters.length&&ref.filters.alpha){ref.style.filter=ref.style.filter.replace(/alpha\(opacity=\d+\)/ig,'alpha(opacity='+(Math.floor(currentOpacity*100))+')');}}else{if(counter>0&&counter<100){ref.style.opacity=ref.style.MozOpacity=currentOpacity;}}
if(counter<=0){ref.style.display='none';ref.style.filter=ref.style.opacity=ref.style.MozOpacity=ref.OriginalOpacity;ref.OriginalOpacity=null;ref.OpacitySaved=null;}
if(counter>=100&&ref.OpacitySaved!=null){ref.style.filter=ref.OriginalOpacity;ref.style.opacity=ref.style.MozOpacity=ref.OriginalOpacity;ref.OriginalOpacity=null;ref.OpacitySaved=null;}};Effect.run=function(ref,show,animSpeed,currVal,effectName){if(animSpeed==null)animSpeed=10;if(currVal<0){currVal=0;}
if(currVal>100){currVal=100;}
if(currVal==null){if(show){currVal=0;if(ref.style.display=="none"){ref.style.display='';}}
else{currVal=100;}}
currVal+=(show?1:-1)*animSpeed;if(effectName==null||effectName=='Fade'){Effect.fade(ref,currVal);}else if(effectName=='Slide'){Effect.slide(ref,currVal,'top');}
if(currVal>=0&&currVal<100){setTimeout(function(){Effect.run(ref,show,animSpeed,currVal,effectName);},50);}};function openWindow(earl,name,widgets){host=location.hostname;if(host.indexOf('customnews')!=-1){var url='http://customnews.cnn.com'+earl;}
else{var url=earl;}
popupWin=window.open(url,name,widgets);if(window.focus)popupWin.focus();}
function isEmpty(e){alert(e.value);if((e.value==null)||(e.value==""))return true;}
function textOk(text,msg){if(isEmpty(text)){ShowMsgEmpty(msg);text.focus();text.select();return false;}
return true;}
function mailOk(text,msg){var str=text.value;if(!str.match(/^[a-z0-9.!\#$%&\'*+-\/=?^_`{|}~]+@([0-9.]+|([^\s]+\.+[a-z]{2,6}))$/i)){alert(langText[lang]['guestbook'][0]);text.focus();text.select();return false;}
return true;}
function ValidaBannerForm(Ban){if(!textOk(Ban.name,"Name"))return false;if(!mailOk(Ban.email,"Email"))return false;if(!textOk(Ban.url,"URL"))return false;if(!textOk(Ban.size,"Banner Size"))return false;}
function ShowCubaGuide(type,destiny){openWindow('/destinations/cubaguide_popup.php?longtext=true&tguide='+type+'&destiny=\''+destiny+'\'','563x223','toolbar=yes,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=no,width=498,height=450');popupWin.opener.top.name="closed";}
matchHeight=function(){var divs,contDivs,maxHeight,divHeight,d;divs=document.getElementsByClassName('height');contDivs=[];maxHeight=0;for(var i=0;i<divs.length;i++){d=divs[i];contDivs[contDivs.length]=d;divHeight=Element.getHeight($(d.id))
maxHeight=Math.max(maxHeight,divHeight);}
for(var i=0;i<contDivs.length;i++){contDivs[i].style.height=maxHeight+"px";}}
function FormUpdateHotelnamesRegion(myForm){menuNum=myForm.hotelRegion.selectedIndex;if(menuNum==null)return;myForm.Hotelnames.value="All";myForm.region.value="";var name=myForm.hotelRegion[myForm.hotelRegion.selectedIndex].value;if(name.indexOf('CUBASM')!=-1)myForm.Hotelnames.value=name;else myForm.region.value=name;}
function launch_support(lang)
{var request_url="http://livechat.meliacuba.com/request.php?init=true&lang="+lang+"&x=1&l=solmeliacuba&deptid=0&page="+window.location;var date=new Date();newwin=window.open(request_url,date.getTime(),'scrollbars=no,menubar=no,resizable=0,location=no,screenX=50,screenY=100,width=450,height=375');newwin.focus();}
function getLabelName(ele,frm){var ret='';var req=document.getElementsByClassName('required');var len=req.length;for(var i=0;i<len;i++){if(req[i].attributes["for"].value==ele.attributes["name"].value)return ret=req[i].innerHTML.replace('*','').replace(':','');}
return ret;}
if(typeof SMC=='undefined'){SMC={};}
SMC.Utils={};SMC.Utils.createWCH=function(element){var f=null;element=element||window.self.document.body;if(Prototype.Browser.IE){var filter='filter:progid:DXImageTransform.Microsoft.alpha(style=0,opacity=0);';var id="WCH"+Math.ceil(Math.random()*1000);element.insertAdjacentHTML('beforeEnd','<iframe id="'+id+'" scroll="no" frameborder="0" '+'style="z-index:0; opacity:0; position:absolute;border:0;top:0;left:0;width:0;height:0; visibility:hidden;'+filter+' background-color: white;" '+'src="javascript:false;"  ></iframe>');f=window.self.document.getElementById(id);}
return f;};SMC.Utils.setupWCH=function(f,el){if(f){var offs=Element.cumulativeOffset(el);var dim=Element.getDimensions(el);f.style.width=dim.width+"px";f.style.height=dim.height+"px";f.visibility="inherit";}};SMC.Utils.hideWCH=function(f){if(f)f.style.visibility="hidden";};SMC.Utils.destroy=function(el){if(el&&el.parentNode)el.parentNode.removeChild(el);};SMC.Utils.showWCH=function(f){if(f)f.style.visibility="";};function loadWheather(){lang=document.getElementsByTagName("body")[0].getAttribute("lang");$('weather-status').innerHTML=langText[lang]['status'][0];var icao=Element.classNames('weather');var params="icao="+icao+"&lang="+lang+"&polo="+dn_info.name;var ajax=new Ajax.PeriodicalUpdater({success:'weather-status'},'/weather/index1.php',{method:'get',frequency:60,decay:2,parameters:params,onFailure:function(){$('weather-status').innerHTML=langText[lang]['status'][1];}});}
function submitRSSFeed(e){Event.stop(e);var pattern=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;var email=$F('nl-email');var facebook=document.getElementsByTagName("body")[0].getAttribute("facebook");if(pattern.test(email)){var params=Form.serialize('nl-form');if(facebook=="1")params=params+"&facebook=1";$('nl-status').update('<div class="snotice" style="width:150px; /*margin-left:150px;*/">'+langText[lang]['status'][2]+'</div>').show();var ajax=new Ajax.Updater({success:'nl-status'},'/newsletter/submit.php',{method:'get',parameters:params,onComplete:function(){Effect.run($('nl-status'),true,10);setTimeout(function(){Effect.run($('nl-status'),false,10);},10000);},onFailure:function(){$('nl-status').show();$('nl-status').update('<p class="error">'+langText[lang]['status'][1]+'</p>');}});}else{Effect.run($('nl-status'),true,10);$('nl-status').update('<div class="error" style="width:90%">'+langText[lang]['guestbook'][0]+'</div>');}}
function pulsar(e){tecla=(document.all)?e.keyCode:e.which;return(tecla!=13);}
SMC.Cache={__html:[],__tips:[]};Object.extend(SMC.Utils,{setAjaxIndicator:function(el,txt){var loading=new Element('div',{'class':'fbloading'}).update(txt?txt:SMC.I18n.loading).setStyle({padding:'30px',textAlign:'center'}).insert(new Element('span').setStyle({background:'url(/images/backg/fbloading.gif) no-repeat left center',fontSize:'13px',paddingLeft:'40px'}));$(el).setStyle({height:(SMC.Utils.getHiddenDimensions($(el)).height+"px")}).update(loading).setStyle({position:'relative'});loading.setStyle({left:((this.getHiddenDimensions(el).width/2-this.getHiddenDimensions(loading).width/2)+"px"),top:((this.getHiddenDimensions(el).height/2-this.getHiddenDimensions(loading).height/2)+"px"),position:'absolute'});},convertVersionString:function(A){var B=A.replace(/_.*|\./g,"");B=parseInt(B+"0".times(4-B.length));return A.indexOf("_")>-1?B-1:B},capture:function(A){if(!Prototype.Browser.IE){A=A.wrap(function(E,D){var C=Object.isElement(this)?this:this.element,B=D.relatedTarget;if(B!=C&&!$A(C.select("*")).member(B)){E(D)}})}
return A},getHiddenDimensions:function(B){B=$(B);var A=B.ancestors(),C=[],E=[];A.push(B);A.each(function(F){if(F!=B&&F.visible()){return}
C.push(F);E.push({display:F.getStyle("display"),position:F.getStyle("position"),visibility:F.getStyle("visibility")});F.setStyle({display:"block",position:"absolute",visibility:"visible"})});var D={width:B.clientWidth,height:B.clientHeight};C.each(function(G,F){G.setStyle(E[F])});return D},getBox:function(el){var left,right,top,bottom;var offset=el.cumulativeOffset();left=offset.left;top=offset.top;right=left+el.offsetWidth;bottom=top+el.offsetHeight;return{left:left,right:right,top:top,bottom:bottom};}});SMC.Livebox=Class.create({initialize:function(extra_set){this.i18n=(SMC.I18n)?SMC.I18n:{cancel:'Cancel',accept:'Accept'};this.settings={inited:true,has_close:false,has_footer:true,error:false,is_action_cancel:false,buttons:1,tpl:'pop_dialog',livebox_html:' \
                  <div id="ct-livebox" style="display:none;" class="ct-livebox"> \
                    <div class="livebox"> \
                    <div id="livebox-content" class="livebox-content" >#{body}</div> \
                    </div> \
                  </div>',tpls:{pop_dialog:' \
                 <div class="livebox-header"><h3>#{title}</h3></div> \
                 <div class="livebox-body">#{body}<div style="clear:both; height:1px; font-size:1px;"></div></div> \
                 <div class="livebox-footer">#{footer} \
                 </div> \
            ',generic:'<div style="margin: 10px 2px 10px 2px; " >#{body}<div style="clear:both; height:1px; font-size:1px;"></div></div>'},tpls_buttons:{2:' \
                  <button  class="btn-submit" id="livebox-action">#{action_name}</button> \
                  <button  class="btn-cancel" id="livebox-cancel">'+this.i18n.cancel+'</button> \
            ',1:' \
                 <button  class="btn-submit" style=" right:10px;" id="livebox-action">#{action_name}</button> \
                 '}};if(extra_set)Object.extend(this.settings,extra_set);$(document.body).insert({bottom:this.settings.livebox_html});this.preload=[];f=this;$$('.ct-livebox, .livebox-close').each(function(elem){f.preload.push(new Image());f.preload.slice(-1).src=elem.getStyle('background-image').replace(/url\((.+)\)/,'$1');});this.livebox=$('ct-livebox');this.content=$('livebox-content');document.observe('keypress',function(e){this.watchKeyPress(e);}.bind(this));},watchKeyPress:function(e){if(e.keyCode==27||!Event.element(e).descendantOf(this.livebox))this.close();},loading:function(){this.content.setStyle({'height':50+'px'});SMC.Utils.setAjaxIndicator(this.content);var pageScroll=document.viewport.getScrollOffsets();this.livebox.setStyle({'top':pageScroll.top+(document.viewport.getHeight()/10)+'px','left':document.viewport.getWidth()/2-(this.livebox.getWidth()/2)+'px'});Effect.run(this.livebox,true,20);},update:function(data,settings){if(settings)Object.extend(this.settings,settings);data=Object.extend({title:'my title',body:' my body',action_name:this.settings.is_action_cancel?SMC.I18n.cancel:SMC.I18n.accept},data);Object.extend(data,{footer:this.settings.has_footer?(this.settings.tpls_buttons[this.settings.buttons].interpolate(data)):''});this.content.update(this.settings.tpls[this.settings.tpl].interpolate(data));this.content.setStyle({'height':''});if(this.settings.error&&!this.content.hasClassName('livebox-error'))this.content.addClassName('livebox-error');else if(!this.settings.error)this.content.removeClassName('livebox-error');if($('livebox-cancel'))$('livebox-cancel').observe('click',function(e){Event.stop(e);this.close();return SMC.Callback(false);}.bind(this));if($('livebox-action'))$('livebox-action').observe('click',function(e){Event.stop(e);this.livebox.hide();return SMC.Callback(true);}.bind(this));if(this.settings.has_close){this.__btn_close=new Element("a",{href:"javascript: void(0);",className:"livebox-close",title:SMC.I18n.close}).update('X').observe('click',function(e){Event.stop(e);this.close();}.bind(this));}},close:function(){Effect.run(this.livebox,false,20);},delayedClose:function(seg){setTimeout(function(){this.close();}.bind(this),seg*1000);}});SMC.Callback=Prototype.emptyFunction;SMC.Request={initialize:function(options){this.ioptions=options;this.__init();},__init:function(){this.options={apiUrl:'/common/mytravel.php',onAccept:function(){return false;},onSuccess:function(transport,json){return false;},permalink:(SMC.User.myprofile.username||((md=window.location.href.match(/\/profile\/([a-z-_]+)\/?#?/i))?md[1]:false)),namespace:'',action_name:SMC.I18n.accept,method:'get',params:''};Object.extend(this.options,this.ioptions||{});this.default_options=Object.clone(this.options);},__jsonRequest:function(){SMC.livebox.loading();new Ajax.Request(this.options.apiUrl,{method:this.options.method,parameters:'namespace='+this.options.namespace+'&permalink='+this.options.permalink+'&r='+Math.ceil(Math.random()*1000)+'&'+this.options.params,onSuccess:function(transport,json){if(!json.error&&json.text){if(this.options.onSuccess.call(this,transport,json)!=false){return;}
SMC.livebox.update(json.text,{error:false,buttons:1,is_action_cancel:false});}else if(json.error){this.__ajaxError(json.text);}
else this.__ajaxError({body:SMC.I18n.undefined_error,title:'Error!'});}.bind(this),onFailure:function(){this.__ajaxError({body:SMC.I18n.undefined_error,title:'Error!',is_action_cancel:false});}.bind(this)});},__ajaxError:function(json){SMC.Callback=Prototype.emptyFunction;SMC.livebox.update(json,{error:true,buttons:1,is_action_cancel:false});}};SMC.LinkRequest=Class.create(Object.extend(SMC.Request,{initialize:function(C,options){this.element=$(C);if(!this.element)return;this.ioptions=options;this.__init();this.element.observe('click',function(event){this.options=Object.clone(this.default_options);this.__jsonRequest();}.bind(this));}}));SMC.SSRequest=Class.create(Object.extend(SMC.Request,{initialize:function(options){this.ioptions={onSuccess:function(transport,json){SMC.livebox.update(json.text,json.livebox);Object.extend(this.options,json.next_request);if(typeof json.livebox!='undefined'&&json.livebox.has_action_callback){SMC.Callback=function(param){if(param){this.options.params=(typeof json.form!='undefined')?$(json.form.id).serialize():'';this.__jsonRequest();}else SMC.Callback=Prototype.emptyFunction;}.bind(this);if(typeof json.form!='undefined'&&$(json.form.id)){$(json.form.id).observe('submit',function(event){Event.stop(event);SMC.Callback(true);}.bind(this));}}
else SMC.Callback=Prototype.emptyFunction;},namespace:''};Object.extend(this.ioptions,options);this.__init();this.__jsonRequest();}}));function ShowTravelInfo(path)
{openWindow(path,'563x223','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=498,height=450');popupWin.opener.top.name="closed";}
