
function FavoriteSliderPanelManager()
{this.isFavoritePanelCollapsed=true;this.contentHeight=60;this.speed=10;this.stepHeight=10;this.divFavoritListContentContainer=$get("divFavoritListContentContainer");this.divFavoritePanelBottom=$get("FavoritePanelBottom");this.divFavoritesContentBlock=$get("divFavoritesContentBlock");this.divFavoritesContentBlockScrollStopX=null;this.divFavoritesContentBlockScrollBeginX=(this.divFavoritesContentBlock.style.left=="")?"0px":parseInt(this.divFavoritesContentBlock.style.left);this.divFavoritesContentBlockScrollEndX=null;this.animationIntervalID=null;this.scrollIntervalID=null;this.currentPage=1;this.isScrolling=false;this.httpRequestObj=null;this.maxNumberOfElements=20;this.season=0;this.remoteCallResult=null;this.birdImagePath="";this.txtAlertExistsInFavoriteList="";this.txtAlertMaximumFavoriteList="";this.isSearchResultPage=false;this.isFavoriteListPage=false;this.isMyCataloguePage=false;this.isSearchPanelPage=false;this.isTellAFriendPage=false;this.yesButtonText="";this.noButtonText="";this.birdIsFlying=false;this.comparePageUrl="";this.isAddingProcessRunning=false;this.btnViewListUrl="";this.btnMyBrochureUrl="";this.btnTellAFriendUrl="";this.reportSuiteCode="";this.SwitchFavoritePanel=function()
{if(this.isFavoritePanelCollapsed)
{$("#divFavoritListContentContainer").slideDown(400,function(target){return function(){target.OnFavoritePanelOpened();};}(this));this.isFavoritePanelCollapsed=false;$("#lnkOpenFavoriteList").attr("class","SwitchFavoritePanel_close");if(this.isSearchResultPage)
document.cookie="IsFavoriteListCollapsed=no;";}
else
{$("#divFavoritListContentContainer").slideUp(400);this.isFavoritePanelCollapsed=true;$("#lnkOpenFavoriteList").attr("class","SwitchFavoritePanel_open");if(this.isSearchResultPage)
document.cookie="IsFavoriteListCollapsed=yes;";}
return false;}
this.OnFavoritePanelOpened=function()
{if(this.GetNumberOfFavorites()==0&&this.isSearchResultPage&&this.isAddingProcessRunning==false)
{this.ShowIntroduction1();this.SetScrollBtnVisibility("right",false);}
else if(this.GetNumberOfFavorites()==0&&this.isAddingProcessRunning==false)
{this.ShowIntroduction2();this.SetScrollBtnVisibility("right",false);}
else
this.SetScrollBtnVisibility("right",true);}
this.Scroll=function(direction)
{if(this.isScrolling)
return false;this.isScrolling=true;if(direction=="right")
{if(this.GetFavoritesContentBlockLeft()==0)
return false;$("#divFavoritesContentBlock").animate({"left":"+="+this.GetScrollDistancePerPage()+"px"},"slow",function(target){target.isScrolling=false;}(this));}
else
{if(this.currentPage==5)
return false;$("#divFavoritesContentBlock").animate({"left":"-="+this.GetScrollDistancePerPage()+"px"},"slow",function(target){target.isScrolling=false;}(this));}
if(direction=="right")
{if(this.currentPage>1)
this.currentPage--;}
else
{if(this.currentPage<5)
this.currentPage++;}
if(this.currentPage==5)
this.SetScrollBtnVisibility("right",false);else if(this.currentPage==1)
this.SetScrollBtnVisibility("left",false);else
{this.SetScrollBtnVisibility("right",true);this.SetScrollBtnVisibility("left",true);}
return false;}
this.DoSiteCatalystCommand=function(command)
{if(this.reportSuiteCode=="")
return;try
{var s=s_gi(this.reportSuiteCode);switch(command)
{case"View":if(this.isFavoriteListPage)
return;s.linkTrackVars="events";s.linkTrackEvents="scView";s.events="scView";s.tl(true,"o","Short list - View");break;case"Add":s.linkTrackVars="products,events";s.products=this.remoteCallResult.CountryCode.toUpperCase()+"-"+this.remoteCallResult.Region+";"+this.remoteCallResult.AccommodationCode;if(this.remoteCallResult.NbrStoredFavorites==1)
{s.linkTrackEvents="scOpen,scAdd";s.events="scOpen,scAdd";s.tl(true,"o","Short list - New");}
else
{s.linkTrackEvents="scAdd";s.events="scAdd";s.tl(true,"o","Short list - Add");}
break;case"Delete":s.linkTrackVars="products,events";s.linkTrackEvents="scRemove";s.products=this.remoteCallResult.CountryCode.toUpperCase()+"-"+this.remoteCallResult.Region+";"+this.remoteCallResult.AccommodationCode;s.events="scRemove";s.tl(true,"o","Short list - Remove");break;}}
catch(ex){}}
this.EnsureFunctionButtonState=function()
{var functionButtons=$("#heart a");functionButtons.eq(0).attr("class","favoritePanelButtonInActive").removeAttr("href");functionButtons.eq(1).attr("class","favoritePanelButtonInActive").removeAttr("href");functionButtons.eq(2).attr("class","favoritePanelButtonInActive").removeAttr("href");functionButtons.eq(3).attr("class","favoritePanelButtonInActive").removeAttr("href");if(this.GetNumberOfFavorites()>0)
{functionButtons.eq(0).attr("class","favoritePanelButtonActive").attr("href",this.btnViewListUrl);functionButtons.eq(2).attr("class","favoritePanelButtonActive").attr("href",this.btnMyBrochureUrl);functionButtons.eq(3).attr("class","favoritePanelButtonActive").attr("href",this.btnTellAFriendUrl);if(this.GetNumberOfFavorites()>1)
{functionButtons.eq(1).attr("class","favoritePanelButtonActive").attr("href","");}
var button=null
if(this.isFavoriteListPage)
button=functionButtons.eq(0);else if(this.isMyCataloguePage)
button=functionButtons.eq(2);else if(this.isTellAFriendPage)
button=functionButtons.eq(3);if(button!=null)
{button.attr("class","favoritePanelButtonInActive");button.removeAttr("href");}}}
this.GetScrollDistancePerPage=function()
{var favoriteWidth=this.GetFavoriteObjectWidth();return(4*favoriteWidth);}
this.GetFavoriteObjectWidth=function()
{return parseInt(this.divFavoritesContentBlock.getElementsByTagName("div")[0].style.width);}
this.GetFavoritesContentBlockLeft=function()
{return(this.divFavoritesContentBlock.style.left=="")?"0":parseInt(this.divFavoritesContentBlock.style.left);}
this.SetFavoritesContentBlockLeft=function(position)
{this.divFavoritesContentBlock.style.left=parseInt(position)+"px";}
this.SetScrollBtnVisibility=function(btnType,isVisible)
{var divScrollButton=(btnType=="right")?$get("divlnkMoveRight"):$get("divlnkMoveLeft");divScrollButton.getElementsByTagName("a")[0].style.display=(isVisible)?"block":"none";}
this.DeleteFavorite=function(param)
{var selectedAccoCode="";this.ShowFavoriteThumbs();if(typeof(param)=="object")
{hiddenFields=param.parentNode.getElementsByTagName("input");selectedAccoCode=hiddenFields[0].getAttribute("value");}
else if(typeof(param)=="string")
{selectedAccoCode=param;}
if(selectedAccoCode!="")
{this.FavoriteListRemoteCall("delete",selectedAccoCode);}
return false;}
this.ShowMessage=function(senderElement,alertMessage,origin,aCode,isConfirmation)
{if($("#favoriteItemAlert"))
$("#favoriteItemAlert").remove();if(origin=='List')
{$(senderElement).parent().append("<div id='favoriteItemAlert' style='padding:5px; position: absolute; top: -5px; left: -16px; width: 420px;'><b>"+alertMessage+"</b></div>");$("#favoriteItemAlert").css({'background-color':'White','color':'Black','border':'solid 2px #CDCDCD','padding-left':'5px','padding-right':'5px','display':'none','text-align':'center'});}
else if(origin=='Map')
{$(senderElement).before("<div id='favoriteItemAlert'><b>"+alertMessage+"</b></div>");$("#favoriteItemAlert").css({'background-color':'White','color':'Black','border':'solid 2px #CDCDCD','padding-left':'5px','padding-right':'5px','display':'none','text-align':'left'});}
else if(origin=='ObjectDetailHeader')
{$(senderElement).before("<div id='favoriteItemAlert'><b>"+alertMessage+"</b></div>");$("#favoriteItemAlert").css({'background-color':'White','color':'Black','border':'solid 2px #CDCDCD','padding-left':'5px','padding-right':'5px','display':'none','text-align':'left'});}
if(isConfirmation)
$("#favoriteItemAlert").append("&nbsp;&nbsp;&nbsp;&nbsp;<b><a href='#' onClick=\"fspManager.DeleteFavorite('"+aCode+"'); $(this).parent().parent().eq(0).hide(); return false;\">"+this.yesButtonText+"</a>&nbsp;&nbsp;/&nbsp;&nbsp;<a href='#' onClick='$(this).parent().parent().eq(0).hide(); return false;'>"+this.noButtonText+"</a></b>");$("#favoriteItemAlert").fadeIn(250);}
this.AddFavorite=function(btnAddFavorite,aCode,pictureID,origin)
{if(this.birdIsFlying)
return;this.ShowFavoriteThumbs();if(this.GetNumberOfFavorites()==this.maxNumberOfElements)
{if(this.isFavoritePanelCollapsed)
this.SwitchFavoritePanel();this.ShowMessage(btnAddFavorite,this.txtAlertMaximumFavoriteList,origin,aCode,false);return;}
if(this.FavoriteListContains(aCode))
{if(this.isFavoritePanelCollapsed)
this.SwitchFavoritePanel();this.ShowMessage(btnAddFavorite,this.txtAlertExistsInFavoriteList,origin,aCode,true);return;}
this.SetScrollBtnVisibility("right",true);this.isAddingProcessRunning=true;this.FavoriteListRemoteCall("add",aCode,pictureID);if(this.isFavoritePanelCollapsed)
this.SwitchFavoritePanel();this.JumpToFirstPageWithEmptyFavorites();this.LetBirdFly(btnAddFavorite);this.SwitchAddToFavoriteLinksStyle(aCode,"added");}
this.SwitchAddToFavoriteLinksStyle=function(aCode,action)
{var addFavoriteButtons=null;if(!aCode)
{addFavoriteButtons=$("a[onClick*='fspManager.AddFavorite']");var accommodationInFavoriteList=new Array();var hiddenFieldAccommodations=$("#divFavoritesContentBlock div input");if(hiddenFieldAccommodations==null)
return;for(var i=0;i<hiddenFieldAccommodations.length;i++)
{if(hiddenFieldAccommodations.eq(i).attr('value')!='')
accommodationInFavoriteList[i]=hiddenFieldAccommodations.eq(i).attr('value');}
for(var i=0;i<accommodationInFavoriteList.length;i++)
{for(var x=0;x<addFavoriteButtons.length;x++)
{var onClickString=String(addFavoriteButtons.eq(x).attr('onClick'));if(onClickString.indexOf(accommodationInFavoriteList[i])!=-1)
addFavoriteButtons.eq(x).css('background-position','bottom');}}}
else
{addFavoriteButtons=$("a[onClick*='fspManager.AddFavorite'][onClick*='"+aCode+"']");if(action=='delete')
addFavoriteButtons.css('background-position','top');else if(action=='added')
addFavoriteButtons.css('background-position','bottom');}}
this.FavoriteListRemoteCall=function(command,aCode,pictureID)
{var favoriteListInputValues={AccommodationCode:aCode,Season:this.season,PictureID:(pictureID?pictureID:0)};if(command=="add")
Interhome.Web.WebFramework.Ajax.FavoriteList.AddToFavorites(favoriteListInputValues,Function.createDelegate(this,this.OnAddToFavoritesSuccessful));else
Interhome.Web.WebFramework.Ajax.FavoriteList.DeleteFromFavorites(favoriteListInputValues,Function.createDelegate(this,this.OnDeleteFromFavoritesSuccessful));}
this.OnGetFavoriteItemsSuccessful=function(remoteCallResult)
{$("#divFavoritesContentBlock").children().remove();for(var i=0;i<remoteCallResult.length;i++)
{var favoriteItemContent="";favoriteItemContent+="<div style=\"background-color:#EFEFEF; float:left; width:145px; margin:0px; padding:0px; text-align:center; position:relative;\">";var favoriteDesc=remoteCallResult[i].favoritDesc;if(favoriteDesc.length>20)
favoriteDesc=favoriteDesc.substr(0,17)+"...";favoriteItemContent+="<div><span>"+favoriteDesc+"</span></div>";if(remoteCallResult[i].aCode=="")
favoriteItemContent+="<a href=\"#\" onClick=\"return false;\">";else
favoriteItemContent+="<a href=\""+remoteCallResult[i].favoritThumbUrl+"\">";favoriteItemContent+="<img src=\""+remoteCallResult[i].favoritThumbSrc+"\" id=\"imgFavoritThumb\" style=\"width:40px; height:40px; border:none;\" alt=\"\"/>";favoriteItemContent+="</a>";if(remoteCallResult[i].aCode=="")
favoriteItemContent+="<a style=\"display:none\" onClick=\"fspManager.DeleteFavorite(this); return false;\" href=\"#\" class=\"FavoritListBtnDelete\" id=\"lnkBtnDelete\">";else
favoriteItemContent+="<a onClick=\"fspManager.DeleteFavorite(this); return false;\" href=\"#\" class=\"FavoritListBtnDelete\" id=\"lnkBtnDelete\">";favoriteItemContent+="<img src=\""+remoteCallResult[i].btnDeleteSrc+"\" border=\"0\">";favoriteItemContent+="</a>";if(remoteCallResult[i].aCode=="")
favoriteItemContent+="<input type=\"hidden\" id=\"aCode\" />";else
favoriteItemContent+="<input type=\"hidden\" id=\"aCode\" value=\""+remoteCallResult[i].aCode+"\" />";favoriteItemContent+="</div>";$("#divFavoritesContentBlock").append(favoriteItemContent)}
this.SwitchAddToFavoriteLinksStyle();this.SetNumberOfFavoritesDisplay(this.GetNumberOfFavorites());this.SetScrollBtnVisibility("left",false);if(this.isSearchResultPage)
{if(this.GetNumberOfFavorites()==0)
{this.ShowIntroduction1();this.SetScrollBtnVisibility("right",false);}
else
{this.ShowFavoriteThumbs();}
var makeSwitch=false;var isPanelCollapsedForUser=(document.cookie.indexOf('IsFavoriteListCollapsed=yes')>=0)?true:false;if(this.isFavoritePanelCollapsed!=isPanelCollapsedForUser)
makeSwitch=true;if(makeSwitch||document.cookie.indexOf('IsFavoriteListCollapsed')==-1)
this.SwitchFavoritePanel();}
else if(this.isMyCataloguePage)
{if(this.GetNumberOfFavorites()==0)
{this.ShowIntroduction2();this.SetScrollBtnVisibility("right",false);}
else
this.ShowFavoriteThumbs();if(this.isFavoritePanelCollapsed)
this.SwitchFavoritePanel();}
else if(this.isFavoriteListPage||this.isTellAFriendPage)
{if(this.GetNumberOfFavorites()==0)
{this.ShowIntroduction1();this.SetScrollBtnVisibility("right",false);}
else
this.ShowFavoriteThumbs();if(this.isFavoritePanelCollapsed)
this.SwitchFavoritePanel();}
else
{if(this.GetNumberOfFavorites()==0)
{this.ShowIntroduction2();this.SetScrollBtnVisibility("right",false);}
else
this.ShowFavoriteThumbs();}
this.EnsureFunctionButtonState();}
this.OnAddToFavoritesSuccessful=function(remoteCallResult)
{if(!remoteCallResult.OK)
{alert(remoteCallResult.Error);return;}
this.remoteCallResult=remoteCallResult;this.DoSiteCatalystCommand("Add");}
this.OnDeleteFromFavoritesSuccessful=function(remoteCallResult)
{this.remoteCallResult=remoteCallResult;var favorites=this.GetFavoriteElements();var favoriteToDelete=null;for(var i=0;i<favorites.length;i++)
{if(favorites[i].getElementsByTagName("input")[0].getAttribute("value")==remoteCallResult.AccommodationCode)
favoriteToDelete=favorites[i];}
favoriteToDelete=this.divFavoritesContentBlock.removeChild(favoriteToDelete);$(favoriteToDelete).children("a").eq(0).attr("href","#").one("click",function(){return false;});favoriteToDelete.getElementsByTagName("span")[0].innerHTML="&nbsp;";favoriteToDelete.getElementsByTagName("img")[0].src=remoteCallResult.EmptyFavoritePictureUrl;favoriteToDelete.getElementsByTagName("a")[1].style.display="none";favoriteToDelete.getElementsByTagName("input")[0].setAttribute("value","");this.divFavoritesContentBlock.appendChild(favoriteToDelete);this.SetNumberOfFavoritesDisplay(this.GetNumberOfFavorites());this.SwitchAddToFavoriteLinksStyle(remoteCallResult.AccommodationCode,"delete");if(this.isFavoriteListPage)
{$(".ListObjectBoxInfoImage span:contains('"+remoteCallResult.AccommodationCode+"')").parent().parent().parent().remove();$("table[class='ThumbnailsPerPage'] tbody tr td span:contains('"+remoteCallResult.AccommodationCode+"')").parent().html('');}
this.DoSiteCatalystCommand("Delete");this.EnsureFunctionButtonState();}
this.FavoriteListContains=function(aCode)
{var favorites=this.GetFavoriteElements();for(var i=0;i<favorites.length;i++)
{if(favorites[i].getElementsByTagName("input")[0].getAttribute("value")==aCode)
return true;}
return false;}
this.JumpToFirstPageWithEmptyFavorites=function()
{var favorites=this.GetFavoriteElements();var foundOnPage=0;for(var i=0;i<favorites.length;i++)
{if(i%4==0)
foundOnPage++;if(favorites[i].getElementsByTagName("input")[0].getAttribute("value")==null||favorites[i].getElementsByTagName("input")[0].getAttribute("value")==""||favorites[i].getElementsByTagName("input")[0].getAttribute("value")=="&nbsp;")
break;}
this.SetFavoritesContentBlockLeft(((foundOnPage-1)*this.GetScrollDistancePerPage())*-1);this.currentPage=foundOnPage;if(this.currentPage==1)
{this.SetScrollBtnVisibility("left",false);this.SetScrollBtnVisibility("right",true);}
else if(this.currentPage==5)
{this.SetScrollBtnVisibility("right",false);this.SetScrollBtnVisibility("left",true);}
else
{this.SetScrollBtnVisibility("left",true);this.SetScrollBtnVisibility("right",true);}}
this.SetNumberOfFavoritesDisplay=function(numberOfFavorites)
{var display=this.divFavoritePanelBottom.getElementsByTagName("strong");display[0].innerHTML=numberOfFavorites;}
this.GetNumberOfFavorites=function()
{var favorites=this.GetFavoriteElements();var numbers=0;for(var i=0;i<favorites.length;i++)
{var hiddenfields=favorites[i].getElementsByTagName("input");if(hiddenfields[0].getAttribute("value")!=null&&hiddenfields[0].getAttribute("value")!=""&&hiddenfields[0].getAttribute("value")!="&nbsp;")
{numbers++;}}
return numbers;}
this.GetFavoriteElements=function()
{var allDivs=this.divFavoritesContentBlock.getElementsByTagName("div");var favorites=new Array();for(var i=0;i<allDivs.length;i++)
{if(allDivs[i].getElementsByTagName("div").length==1)
{favorites.push(allDivs[i]);}}
return favorites;}
this.Initialize=function()
{this.BindFavorites();}
this.BindFavorites=function()
{Interhome.Web.WebFramework.Ajax.FavoriteList.GetFavoriteItems(this.season,Function.createDelegate(this,this.OnGetFavoriteItemsSuccessful));}
this.ShowFavoriteThumbs=function()
{$("#idFavoritesIntroduction1").css("visibility","hidden");$("#idFavoritesIntroduction1").css("display","none");$("#idFavoritesIntroduction2").css("visibility","hidden");$("#idFavoritesIntroduction2").css("display","none");$("#divFavoritesContentBlock").css("visibility","visible");$("#divFavoritesContentBlock").css("display","block");}
this.ShowIntroduction1=function()
{$("#divFavoritesContentBlock").css("visibility","hidden");$("#divFavoritesContentBlock").css("display","none");$("#idFavoritesIntroduction2").css("visibility","hidden");$("#idFavoritesIntroduction2").css("display","none");$("#idFavoritesIntroduction1").css("visibility","visible");$("#idFavoritesIntroduction1").css("display","block");$("#idFavoritesIntroduction1").css("text-align","center");}
this.ShowIntroduction2=function()
{$("#divFavoritesContentBlock").css("visibility","hidden");$("#divFavoritesContentBlock").css("display","none");$("#idFavoritesIntroduction1").css("visibility","hidden");$("#idFavoritesIntroduction1").css("display","none");$("#idFavoritesIntroduction2").css("visibility","visible");$("#idFavoritesIntroduction2").css("display","block");}
this.CompareFavorites=function()
{var favElements=this.GetFavoriteElements();var aCodes=new Array();for(var i=0;i<favElements.length;i++)
{if($(favElements[i]).children("input").attr("value")!="")
aCodes[i]=$(favElements[i]).children("input").attr("value");}
if(aCodes.length<2)
return false;if(aCodes.length!=0)
window.open(this.comparePageUrl+"&aCodes="+aCodes.join(','),"CompareWindow","height=600, width=800, menubar=no, resizable=yes, scrollbars=yes, status=yes, location=yes");return false;}
this.LetBirdFly=function(btnAddFavorite)
{var birdManager=new BirdManager();var bird=birdManager.CreateBirdIcon(this.birdImagePath);var birdTargetElement=this.GetBirdTargetElement();Sys.UI.DomElement.setLocation(bird,Sys.UI.DomElement.getLocation(btnAddFavorite).x,Sys.UI.DomElement.getLocation(btnAddFavorite).y);var birdLocationX=Sys.UI.DomElement.getLocation(bird).x;var birdTargetLocationX=Sys.UI.DomElement.getLocation(birdTargetElement).x;var birdLocationY=Sys.UI.DomElement.getLocation(bird).y;var birdTargetLocationY=Sys.UI.DomElement.getLocation(birdTargetElement).y
var disX=Math.abs(birdLocationX-birdTargetLocationX);var disY=Math.abs(birdLocationY-birdTargetLocationY);if(disY>=2200)
time=3000;else if(disY>=1900&&disY<2200)
time=2500;else if(disY>=1000&&disY<1900)
time=2000;else if(disY>=700&&disY<1000)
time=1500;else
time=1000;this.birdIsFlying=true;if(birdLocationX>birdTargetLocationX&&birdLocationY>birdTargetLocationY)
$(bird).animate({"left":"-="+disX+"px","top":"-="+disY+"px"},time,function(target){return function(){target.OnBirdLanded(target);};}(this));else if(birdLocationX<birdTargetLocationX&&birdLocationY<birdTargetLocationY)
$(bird).animate({"left":"+="+disX+"px","top":"+="+disY+"px"},time,function(target){return function(){target.OnBirdLanded(target);};}(this));else if(birdLocationX<birdTargetLocationX&&birdLocationY>birdTargetLocationY)
$(bird).animate({"left":"+="+disX+"px","top":"-="+disY+"px"},time,function(target){return function(){target.OnBirdLanded(target);};}(this));else if(birdLocationX>birdTargetLocationX&&birdLocationY<birdTargetLocationY)
$(bird).animate({"left":"-="+disX+"px","top":"+="+disY+"px"},time,function(target){return function(){target.OnBirdLanded(target);};}(this));}
this.GetBirdTargetElement=function()
{var favorites=this.GetFavoriteElements();var emptyFavorite=this.GetFirstEmptyFavoriteFromList(favorites);return emptyFavorite.getElementsByTagName("img")[0];}
this.GetFirstEmptyFavoriteFromList=function(favorites)
{var foundOnPage=0;for(var i=0;i<favorites.length;i++)
{if(i%4==0)
foundOnPage++;if(favorites[i].getElementsByTagName("input")[0].getAttribute("value")==null||favorites[i].getElementsByTagName("input")[0].getAttribute("value")==""||favorites[i].getElementsByTagName("input")[0].getAttribute("value")=="&nbsp;")
return favorites[i];}
return null;}
this.OnBirdLanded=function(favPanel)
{if(favPanel==null||favPanel.remoteCallResult==null)
return;$("#divFlyBirdIcon").fadeOut(1000,function(target){return function(){target.ShowAccommodationPicture(target);};}(this));this.isAddingProcessRunning=false;}
this.ShowAccommodationPicture=function(favPanel)
{var birdManager=new BirdManager();birdManager.RemoveBirdIcon();var emptyFavorite=favPanel.GetFirstEmptyFavoriteFromList(favPanel.GetFavoriteElements());var houseName=favPanel.remoteCallResult.HouseName;if(houseName.length>20)
houseName=houseName.substr(0,17)+"...";emptyFavorite.getElementsByTagName("span")[0].innerHTML=houseName;emptyFavorite.getElementsByTagName("img")[0].setAttribute("src",favPanel.remoteCallResult.FavoritePictureUrl);emptyFavorite.getElementsByTagName("input")[0].setAttribute("value",favPanel.remoteCallResult.AccommodationCode);emptyFavorite.getElementsByTagName("a")[1].style.display="inline";$(emptyFavorite).children("a").eq(0).removeAttr("onclick");$(emptyFavorite).children("a").eq(0).attr("href",favPanel.remoteCallResult.detailUrl);favPanel.SetNumberOfFavoritesDisplay(favPanel.GetNumberOfFavorites())
this.EnsureFunctionButtonState();this.birdIsFlying=false;}}
function BirdManager()
{this.CreateBirdIcon=function(birdImagePath)
{var birdIcon=$('<div></div>').css({width:"40px",height:"40px",position:"absolute",left:"0px",top:"0px"}).attr('id','divFlyBirdIcon');birdIcon.append($('<img>').attr('src',birdImagePath));$('body').append(birdIcon);return birdIcon[0];}
this.RemoveBirdIcon=function()
{$('#divFlyBirdIcon').remove();}}