$(document).ready(function(){Z.CarCtz={createPrePopWinLimit:1,prepop:new Array(),prepopIndex:0,init:function(tab){var ie='Microsoft Internet Explorer';var El=this;var item_selected=0;var sArray=new Array();var checkPopupBlocker=false;var winpop=new Array();var selectedLink=0;var currentTime=new Date();currentTime.setDate(currentTime.getDate()+20);var month=currentTime.getMonth()+1;var day=currentTime.getDate();var year=currentTime.getFullYear();if(currentTime.getMonth()>month){year++;}
var today=month+"/"+day+"/"+year;currentTime.setDate(currentTime.getDate()+7);var month2=currentTime.getMonth()+1;var day2=currentTime.getDate();var year2=currentTime.getFullYear();if(currentTime.getMonth()>month2){year2++;}
var today2=month2+"/"+day2+"/"+year2;$('div#tab-3 #cardate1').val(today);$('div#tab-3 #cardate2').val(today2);var try1=false;var dates=$("#cardate1, #cardate2").datepicker({defaultDate:"+1w",showButtonPanel:true,minDate:0,changeMonth:true,changeYear:true,numberOfMonths:2,showOn:"both",buttonImage:"http://hotels.asia.com/images/icon-cal.gif",buttonImageOnly:true,onSelect:function(selectedDate){if(this.id=="cardate1"&&!try1){var dd=selectedDate.split('/');var tmpdate=new Date(dd[2],parseInt(dd[0],10)-1,dd[1]);tmpdate.setDate(tmpdate.getDate()+7);var m=tmpdate.getMonth()+1;var d=tmpdate.getDate();var y=tmpdate.getFullYear();var t=m+"/"+d+"/"+y;$('div#tab-3 #cardate2').val(t);}
if(this.id=="cardate1"){var option="minDate",instance=$(this).data("datepicker"),date=$.datepicker.parseDate(instance.settings.dateFormat||$.datepicker._defaults.dateFormat,selectedDate,instance.settings);dates.not(this).datepicker("option",option,date);}
El.createPrePopWin();},beforeShow:function(input,inst){var dateMin=0;if(input.id==="cardate2"){var dd=$('#cardate1').val().split('/');var dd2=$('#cardate2').val().split('/');var tmpdate=new Date(dd[2],parseInt(dd[0],10)-1,dd[1]);tmpdate.setDate(tmpdate.getDate()+1);dateMin=tmpdate;inst.drawMonthEx=0;if(parseInt(dd[2],10)<parseInt(dd2[2],10)){inst.drawMonthEx=-1;inst.txtboxclick=true;}else if(parseInt(dd[0],10)<parseInt(dd2[0],10)){inst.drawMonthEx=-1;inst.txtboxclick=true;}}
return{minDate:dateMin};},beforeShowDay:function(date){var dd1=dates[0].value.split('/');var dd2=dates[1].value.split('/');var dates1=[new Date(dd1[2],parseInt(dd1[0],10)-1,dd1[1]),new Date(dd2[2],parseInt(dd2[0],10)-1,dd2[1])];if(dates1[0]<=date&&dates1[1]>=date){return[true,'ui-state-highlight'];}else{}
return[true,''];},onClose:function(input,inst){if(!date2Popup){date2Popup=true;if(inst.id=='cardate1'){setTimeout(function(){$("#cardate2").datepicker("show");},300);}}}});var date2Popup=false;$('div#tab-3 .chck').change(function(){if($(this).is(':checked'))
El.createPrePopWin(true);});$('div#tab-3 #cardate1').blur(function(){var currentTime=new Date();var dd=$('div#tab-3 #cardate1').val().split('/');var tmpdate=new Date(dd[2],parseInt(dd[0],10)-1,dd[1]);if(tmpdate<currentTime)$('div#tab-3 #cardate1').val(today);});$('div#tab-3 #cardate2').blur(function(){var currentTime=new Date();var dd=$('#cardate2').val().split('/');var tmpdate=new Date(dd[2],parseInt(dd[0],10)-1,dd[1]);if(tmpdate<currentTime)$('#cardate2').val(today2);});$('div#tab-3 #city1').blur(function(){var a=$('div#tab-3 #city1').val();var b=$('div#tab-3 #city2').val();});$('div#tab-3 #city2').blur(function(){var a=$('div#tab-3 #city1').val();var b=$('div#tab-3 #city2').val();});$('div#tab-3 #city1').dblclick(function(){$(this).val('');});$('div#tab-3 #city2').dblclick(function(){$(this).val('');});$('div#tab-3 #city1').click(function(){if($(this).val()!='Enter a City or Airport Code'&&$(this).val()!=''){$(this).focus();$(this).select();}});$('div#tab-3 #city2').click(function(){if($(this).val()!='Enter a City or Airport Code'&&$(this).val()!=''){$(this).focus();$(this).select();}});$('div#tab-3 #cardate1').click(function(){El.createPrePopWin();});$('div#tab-3 #cardate2').click(function(){El.createPrePopWin();});$('div#tab-3 #btn-check-all').click(function(){$('div#tab-3 .chck').each(function(){$(this).attr('checked','checked');$(this).trigger('updateState');});$('div#tab-3 #btn-check-all').css('display','none');$('div#tab-3 #btn-uncheck-all').css('display','block');return false;});$('div#tab-3 #btn-uncheck-all').click(function(){$('div#tab-3 .chck').each(function(){$(this).attr('checked',false);$(this).trigger('updateState');});$('div#tab-3 #btn-uncheck-all').css('display','none');$('div#tab-3 #btn-check-all').css('display','block');});var supplierClick=new Array();$('div#tab-3 .search-btn').click(function(){checkPopupBlocker=false;El.createPrePopWinLimit=1;sArray=new Array();$('#more-supplier').hide();supplierClick=new Array();var count_selected=0;var lastItemID='';var ii=0;var exit=false;var searchtype=(this.id=='search-btn')?'air':'air_hotel';$('.vtip').each(function(){if($(this).is(":visible")){$(this).fadeOut('fast',function(){$(this).fadeIn('fast');});exit=true;}});if(exit){exit=false;return exit;}
var city1=$('div#tab-3 #city1').val();var city2=$('div#tab-3 #city2').val();var date1=$('div#tab-3 #cardate1').val();var date2=$('div#tab-3 #cardate2').val();var time1=$('div#tab-3 #time1').val();var time2=$('div#tab-3 #time2').val();if(city1==''||city1.length<3||city1=='Enter a City or Airport Code'){alert('Enter a City or Airport Code');$('div#tab-3 #city1').fadeOut('fast');$('div#tab-3 #city1').fadeIn('fast');$('div#tab-3 #city1').focus();$('div#tab-3 #city1').select();return false;}
if(city2==''||city2.length<3||city2=='Enter a City or Airport Code'){alert('Enter a City or Airport Code');$('div#tab-3 #city2').fadeOut('fast');$('div#tab-3 #city2').fadeIn('fast');$('div#tab-3 #city2').focus();$('div#tab-3 #city2').select();return false;}
if(!isDate(date1)){date1=today;$('div#tab-3 #cardate1').val(date1);$('div#tab-3 #cardate1').focus();$('div#tab-3 #cardate1').select();}
if(!isDate(date2)){date2=today;$('div#tab-3 #cardate2').val(date2);$('div#tab-3 #cardate2').focus();$('div#tab-3 #cardate2').select();}
var d1=new Date(date1.split('/')[2],date1.split('/')[0]-1,date1.split('/')[1],23,59);var d2=new Date(date2.split('/')[2],date2.split('/')[0]-1,date2.split('/')[1],23,59);var curDate=new Date();if(d1.getTime()<curDate.getTime()){alert('Some required values are not correct.');$('div#tab-3 #cardate1').focus();return false;}
if(d2.getTime()<curDate.getTime()){alert('Some required values are not correct.');$('div#tab-3 #cardate2').focus();return false;}
if((d2.getTime()-d1.getTime())<0){alert('The departure date is later than the return date. Please enter correct values.');$('div#tab-3 #cardate2').focus();return false;}
if((d2.getTime()-d1.getTime())==0){$('div#tab-3 #cardate1').val(today);$('div#tab-3 #cardate2').val(today2);}
$('#gointo').html(city1+', '+city1+' '+'Depart: '+date1+' Return: '+date2);var n=$('div#tab-3 .chck:checked').length;if(n<1){$('#error2').show();setTimeout(function(){$('#error2').fadeOut('slow');},3500);return false;}else if(n<3){$('#error1').show();setTimeout(function(){$('#error1').fadeOut('slow');},3500);return false;}
if(this.id=='search-btn-fh'){}else{var pattern=new RegExp(/\(([^}]+)\)/);var newString1=pattern.exec(city1);var newString2=pattern.exec(city2);var c1=(newString1!=undefined)?newString1[1]:city1;var c2=(newString2!=undefined)?newString2[1]:city2;var d1=$('div#tab-3 #cardate1').val();var d2=$('div#tab-3 #cardate2').val();if(c1!=""&&c2!=""){var n=$('div#tab-3 .chck:checked').length;var nWindowsHor=n;var nWindowsVer=1;var winLeft=(10+parseInt(window.screen.availWidth/4));var windowWidth=50+(window.screen.availWidth-(60+parseInt(window.screen.availWidth/4)))/nWindowsHor;var windowHeight=screen.availHeight/nWindowsVer;for(i=0;i<n;i++){var c=new Object;c.left=Math.floor(winLeft+((i%nWindowsHor)*windowWidth+0.5));c.top=Math.floor(Math.floor(i/nWindowsHor)*windowHeight+0.5);c.width=Math.floor(windowWidth);c.height=Math.floor(windowHeight+0.5);sArray[i]=c;}
var ii=0;$('.tabs').html('');$('.tab_container').html('');popw=new Array();popX=1;popY=1;$('#various1').trigger('click');$('#item-checked').html('').show();$('#mb-top-check-right-selected').html('');$('#mb-top-check-right-unselected').html('');var count_unselected=0;ii=0;var arr=getAvailablePopWin();var guid=globalObj.guidGenerator();$('div#tab-3 ul.title-flights li div.tile').each(function(i,v){var obj=$(v).find('.url');var chk=$(v).find('.chck');if(obj[0]!=undefined&&$(chk).is(':checked')){var title__=$(v).find('.title').val();var img=$(v).find('.img').val();var type__='Cars';var _id_=this.id;var url=obj.val();var referralURL=encodeURIComponent(""+document.domain);referralURL=referralURL.replace('www.','');var url="loader.php?template="+encodeURIComponent(category_name)+"&advertiser="+encodeURIComponent(title__)+"&widget_type=car&memberid="+memberid+"&visitor="+guid+"&from="+c1+"&to="+c2+"&url="+encodeURIComponent("click_car.php?pickUpDate="+d1+"&dropOffDate="+d2+"&pickUpLoc="+c1+"&pickUpTime="+time1+"&dropOffTime="+time2+"&dropOffLoc="+c2+"&publisherID="+g_ctz+"&advertiserID="+_id_+"&referralURL="+referralURL);var divClass='def-tab';var winpopId_='';if(navigator.appName==ie){winpopId_=arr.pop();if(El.prepop[winpopId_]){}else{divClass='.def-unpopped';}}
var sup='<div class="mb-check-icon '+divClass+'"><a id="sup-win'+
$(this).parent()[0].id+'" href="javascript:;" class="sup"><img width="80" height="34" alt=" " src="'+img+'">'+'<input type="hidden" class="_url" value="'+url+'" />'+'</a>'+'<span class="search-type" >'+type__+'</span>'+'</div>';$('#mb-top-check-right-selected').append(sup);if($('#dispCompare_sbs').is(':checked')===true){popSBS(ii,url,$(this).parent()[0].id,sArray);}else{if(navigator.appName==ie){$('#mb-top-check-right-selected').children(':last').find('.sup').data('prepop',winpopId_);popStackedIE(ii,url,winpopId_);}else{popStacked(ii,url,$(this).parent()[0].id);}}
supplierClick[$(this).parent()[0].id]=false;ii++;count_selected++;lastItemID=$(this).parent()[0].id;}});var count_unselected=0;$('div#tab-3 li div.tile').each(function(i,v){var obj=$(v).find('.url');var chk=$(v).find('.chck');var title__=$(v).find('.title').val();if(obj[0]!=undefined&&$(chk).is(':checked')==false){var _id_=this.id;var referralURL=encodeURIComponent(""+document.domain);referralURL=referralURL.replace('www.','');var type__='Cars';var url="loader.php?template="+encodeURIComponent(category_name)+"&advertiser="+encodeURIComponent(title__)+"&widget_type=car&memberid="+memberid+"&visitor="+guid+"&from="+c1+"&to="+c2+"&url="+encodeURIComponent("click_car.php?pickUpDate="+d1+"&dropOffDate="+d2+"&pickUpLoc="+c1+"&pickUpTime="+time1+"&dropOffTime="+time2+"&dropOffLoc="+c2+"&publisherID="+g_ctz+"&advertiserID="+_id_+"&referralURL="+referralURL);var img=$(v).find('.img').val();var sup='<div class="mb-box-icon"><a id="sup-win'+
$(this).parent()[0].id+'" href="javascript:;" class="sup-unselected"><img width="80" height="34" alt=" " src="'+img+'">'+'<input type="hidden" class="_url" value="'+url+'" />'+'</a>'+'<span class="search-type" >'+type__+'</span>'+'</div>';$('#mb-top-check-right-unselected').append(sup);count_unselected++;}});if(navigator.appName==ie){$('#mb-top-check-right-selected').children().each(function(i,v){var val=$(this).find('.sup').data('prepop');if(val==undefined){$('.mb-check-icon:eq('+(i-1)+')').removeClass('def-tab').addClass('active-tab');lastItemID=$('.mb-check-icon:eq('+(i-1)+')').find('.sup')[0].id.replace('sup-win','');$('.mb-check-icon:eq('+(i-1)+')').find('.sup').data('click',true);supplierClick[lastItemID]=true;return false;}});}else{$('.mb-check-icon:last').removeClass('def-tab').addClass('active-tab');$('.mb-check-icon:last').find('.sup').data('click',true);supplierClick[lastItemID]=true;}
item_selected=count_selected-1;$('#item-checked').html(item_selected+' more sites to check');$('#checking-sites').html('Checking '+count_selected+' sites');$('.sup').click(function(){if($(this).data('click')==undefined){item_selected--;if(item_selected<=0)
$('#item-checked').hide();else
$('#item-checked').html(item_selected+' more sites to check');$(this).data('click',true);}
$('.mb-check-icon').removeClass('active-tab');$('.mb-box-icon').removeClass('active-tab');$(this).parent().removeClass('def-tab');$(this).parent().addClass('active-tab');$(this).parent().find('.def-tab2-img').hide();var id=$(this)[0].id.replace('sup-win','');supplierClick[id]=true;if(navigator.appName==ie){var prePopId=$(this).data('prepop');if(El.prepop[prePopId]!=undefined){El.prepop[prePopId].focus();}else{var url=$(this).find('._url').val();var myWidth=(screen.availWidth>800)?(screen.availWidth-100):screen.availWidth;var myHeight=(screen.availHeight>600)?(screen.availHeight-100):(screen.availHeight-70);var myTop=Math.round((screen.availHeight-myHeight)/2)-25;var winLeft=10+parseInt($('#fancybox-wrap').css('width').replace('px',''));var windowWidth=(screen.width*.5);var windowHeight=(screen.height*.5);var strOptions='toolbar=no,scrollbars=no,resizable,location,height='+windowHeight+',width='+
windowWidth+',left='+winLeft+',top='+myTop+',screenX='+winLeft+',screenY='+myTop;El.prepopIndex++;var new_id=El.prepopIndex;$(this).data('prepop',new_id);El.prepop[new_id]=window.open(url,'win_'+new_id,strOptions);}}else{if(winpop[id]!=undefined){winpop[id].focus();}else{var url=$(this).find('._url').val();var myWidth=(screen.availWidth>800)?(screen.availWidth-100):screen.availWidth;var myHeight=(screen.availHeight>600)?(screen.availHeight-100):(screen.availHeight-70);var myTop=Math.round((screen.availHeight-myHeight)/2)-25;var winLeft=10+parseInt($('#fancybox-wrap').css('width').replace('px',''));var windowWidth=(screen.width*.5);var windowHeight=(screen.height*.5);var strOptions='toolbar=no,scrollbars=no,resizable,location,height='+windowHeight+',width='+
windowWidth+',left='+winLeft+',top='+myTop+',screenX='+winLeft+',screenY='+myTop;winpop[id]=window.open(url,'win_'+id,strOptions);}}
var allClicked=true;for(var o=0;o<supplierClick.length;o++){if(supplierClick[o]==false){allClicked=false;break;}}
if(allClicked){if($('#mb-top-check-right-unselected').children().length>0)
$('#more-supplier').slideDown();}
return false;});$('#sites-to-check').html(count_unselected+' more sites to check');$('.sup-unselected').click(function(i,v){if($(this).data('click')==undefined){count_unselected--;if(count_unselected<=0)
$('#sites-to-check').hide();else
$('#sites-to-check').html(count_unselected+' more sites to check');$(this).data('click',true);}
$('.mb-check-icon').removeClass('active-tab');$('.mb-box-icon').removeClass('active-tab');$(this).parent().removeClass('def-tab');$(this).parent().addClass('active-tab');var id=$(this)[0].id.replace('sup-win','');var obj=$(this).find('._url');var url=obj.val();if(winpop[id]!=undefined){winpop[id].focus();}else{var myWidth=(screen.availWidth>800)?(screen.availWidth-100):screen.availWidth;var myHeight=(screen.availHeight>600)?(screen.availHeight-100):(screen.availHeight-70);var myTop=Math.round((screen.availHeight-myHeight)/2)-25;var winLeft=10+parseInt($('#fancybox-wrap').css('width').replace('px',''));var windowWidth=(screen.width*.5);var windowHeight=(screen.height*.5);var strOptions='toolbar=no,scrollbars=no,resizable,location,height='+windowHeight+',width='+
windowWidth+',left='+winLeft+',top='+myTop+',screenX='+winLeft+',screenY='+myTop;try{if(winpop[id]){winpop[id].focus();}else{winpop[id]=window.open(url,'win_'+id,strOptions);}}catch(e){return false;}}
return false;});$('div#tab-3 .chck:checked').each(function(){$(this).removeAttr('checked');$(this).trigger('updateState');});$('div#tab-3 #btn-uncheck-all').css('display','none');$('div#tab-3 #btn-check-all').css('display','block');}}
return false;});$('body').append('<p class="vtip" style="display: none" id="compare-msg-p"><img id="compare-vtipArrow" />Please select 2 sites to compare.</p>');function findPosEx(obj){var curleft=obj.offsetLeft||0;var curtop=obj.offsetTop||0;while(obj=obj.offsetParent){curleft+=obj.offsetLeft
curtop+=obj.offsetTop}
return{x:curleft,y:curtop};}
$("div#tab-3 #city1").autocomplete("post/flight-post.php",{delay:10,minChars:3,matchSubset:1,matchContains:1,cacheLength:10,selectFirst:true,width:'450px',errormsg:'Enter City or Airport Code or Name',onItemSelect:function(){$("div#tab-3 #city2").focus();}});$("div#tab-3 #city2").autocomplete("post/flight-post.php",{delay:10,minChars:3,matchSubset:1,matchContains:1,cacheLength:10,selectFirst:true,width:'450px',errormsg:'Enter City or Airport Code or Name',onItemSelect:function(){$("div#tab-3 #cardate1").focus();}});function bindCheckbox(){$('div#tab-3 .chck').click(function(){});}
bindCheckbox();function isDate(dateStr){var datePat=/^(\d{1,2})(\/|-)(\d{1,2})(\/|-)(\d{4})$/;var matchArray=dateStr.match(datePat);if(matchArray==null){return false;}
var month=matchArray[1];var day=matchArray[3];var year=matchArray[5];if(month<1||month>12){alert("Month must be between 1 and 12.");return false;}
if(day<1||day>31){alert("Day must be between 1 and 31.");return false;}
if((month==4||month==6||month==9||month==11)&&day==31){alert("Month "+month+" doesn`t have 31 days!")
return false;}
if(month==2){var isleap=(year%4==0&&(year%100!=0||year%400==0));if(day>29||(day==29&&!isleap)){alert("February "+year+" doesn`t have "+day+" days!");return false;}}
return true;}
var iid=0;function popSBS(rec,url,_id){var self=this;var topX=_sArray[rec].left;var topY=_sArray[rec].top;var sWidth=_sArray[rec].width;var sHeight=_sArray[rec].height;var strOptions='toolbar=no,scrollbars=no,resizable,location,height='+sHeight+',width='+
sWidth+',left='+topX+',top='+topY+',screenX='+topX+',screenY='+topY;if(winpop[_id]){try{winpop[_id].moveTo(topX,topY);winpop[_id].resizeTo(sWidth,sHeight);winpop[_id].focus();winpop[_id].location.href=url;winpop[_id].focus();}catch(e){}}else{var w=window.open(url,'win_'+_id,strOptions);if(w!=null||typeof(w)!='undefined'){winpop[_id]=w;}else{}}}
var iid2=0;function popStacked(rec,url,_id){var self=this;var topX=200*rec;var topY=100*rec;var sWidth=400;var sHeight=400;var to=100;if(navigator.appName=='Microsoft Internet Explorer'){to=window.screenTop;}else if(navigator.appName=='Netscape'){to=window.mozInnerScreenY;}else{to=window.outerHeight-window.innerHeight;}
var myWidth=(screen.availWidth>800)?(screen.availWidth-100):screen.availWidth;var myHeight=(screen.availHeight>600)?(screen.availHeight-100):(screen.availHeight-70);var myLeft=Math.round((screen.availWidth-myWidth)/2);var myTop=Math.round((screen.availHeight-myHeight)/2)-25;to=myTop;var w1=$('#fancybox-wrap').css('width');var w2=(w1*window.screen.availWidth/100);var s=10+parseInt(w1);topX=s+(100*rec);topY=to+(20*rec);sWidth=window.screen.availWidth-topX;sHeight=window.screen.availHeight-topY;sWidth=(screen.width*.5);sHeight=(screen.height*.5);var strOptions='toolbar=no,scrollbars=no,resizable,location,height='+sHeight+',width='+
sWidth+',left='+topX+',top='+topY+',screenX='+topX+',screenY='+topY;if(winpop[_id]){try{winpop[_id].moveTo(topX,topY);winpop[_id].resizeTo(sWidth,sHeight);winpop[_id].focus();winpop[_id].location.href=url;winpop[_id].focus();}catch(e){}}else{var w=window.open(url,'win_'+_id,strOptions);if(checkPopupBlocker==false){checkPopupBlocker=true;var l=screen.width;var t=screen.height;var popup=window.open('','_blank','width=10, height=10, left='+l+', top='+t+',toolbar=no,scrollbars=no');if(popup==null||typeof(popup)=='undefined'){$.blockUI({message:$('#popup-blocker-msg'),baseZ:2000,css:{top:'41px',margin:'0 0 0 250px',border:'none',padding:'0px',cursor:'default'}});setTimeout(function(){$.unblockUI();},5000);}else{popup.close();}}
if(w!=null||typeof(w)!='undefined'){winpop[_id]=w;}else{}}}
function popStackedIE(rec,url,_id){var self=this;var topX=200*rec;var topY=100*rec;var sWidth=400;var sHeight=400;var to=100;if(navigator.appName=='Microsoft Internet Explorer'){to=window.screenTop;}else if(navigator.appName=='Netscape'){to=window.mozInnerScreenY;}else{to=window.outerHeight-window.innerHeight;}
var myWidth=(screen.availWidth>800)?(screen.availWidth-100):screen.availWidth;var myHeight=(screen.availHeight>600)?(screen.availHeight-100):(screen.availHeight-70);var myLeft=Math.round((screen.availWidth-myWidth)/2);var myTop=Math.round((screen.availHeight-myHeight)/2)-25;to=myTop;var w1=$('#fancybox-wrap').css('width');var w2=(w1*window.screen.availWidth/100);var s=10+parseInt(w1);topX=s+(100*rec);topY=to+(20*rec);sWidth=window.screen.availWidth-topX;sHeight=window.screen.availHeight-topY;sWidth=(screen.width*.5);sHeight=(screen.height*.5);var strOptions='toolbar=no,scrollbars=no,resizable,location,height='+sHeight+',width='+
sWidth+',left='+topX+',top='+topY+',screenX='+topX+',screenY='+topY;try{El.prepop[_id].moveTo(topX,topY);El.prepop[_id].resizeTo(sWidth,sHeight);El.prepop[_id].focus();El.prepop[_id].location.href=url;El.prepop[_id].focus();}catch(e){}}
$("#various1").fancybox({'type':'inline','showCloseButton':false,'autoDimensions':true,'autoScale':true,'height':screen.availHeight-170,onClosed:function(){winpop=new Array();},'onComplete':function(){$("#fancybox-wrap").css({'left':'0px','top':'0px','bottom':'auto'});},onStart:function(){$("#fancybox-wrap").css({'left':'0px !important','top':'0px !important','bottom':'auto'});}});$('#popup-close').click(function(){$.fancybox.close();});$('.close12').click(function(){$.unblockUI();return false;});function popup_blocked(){var popup1=window.open('','_blank','width=10, height=10, left=0, top=0,toolbar=no,scrollbars=no,location');var popup=window.open('','_blank','width=10, height=10, left=0, top=0,toolbar=no,scrollbars=no,location');if(popup==null||typeof(popup)=='undefined'){return true;}else{popup.close();return false;}}
$('.error-notification').click(function(){$(this).fadeOut();return false;});$(document).keyup(function(e){if(e.keyCode==27){$.unblockUI();}});$('.ads-img').click(function(){var chk=$(this).parent().find('.chck');if(chk.is(':checked')){chk.removeAttr('checked');}else{chk.attr('checked','checked');}});function getAvailablePopWin(){var retVal=new Array();for(var x=1;x<El.prepop.length;x++){try{if(El.prepop[x].location.hostname==''){retVal.push(x);}}catch(e){}}
return retVal;}
function showCtzResult(){$('div#tab-3 input').customInput();$('div#tab-3 .result-container').show();$('div#tab-3 #search-btn').show();$('div#tab-3 #right-side-banner').hide();$('div#tab-3 .front-banner-ctz').css({background:'url("http://fliasia.s3.amazonaws.com/widget-wide/images/desc-trip-mama6.png") no-repeat scroll 0 0 transparent'});}
showCtzResult();},onItemSelect:function(e){var city1=$('div#tab-3 #city1').val();var city2=$('div#tab-3 #city2').val();var date1=$('div#tab-3 #cardate1').val();var date2=$('div#tab-3 #cardate2').val();pattern=new RegExp(/\(([^}]+)\)/);var newString1=pattern.exec(city1);var newString2=pattern.exec(city2);var a=(newString1!=undefined)?newString1[1]:city1
var b=(newString2!=undefined)?newString2[1]:city2
if(a!=""&&b!=""&&a!="Enter a City or Airport Code"&&b!="Enter a City or Airport Code"){$("div#tab-3 .chck").each(function(i){if(i==1||i==3||i==6||i==7||i==5){$(this).attr('checked','checked');$(this).trigger('updateState');}});$('div#tab-3 .result-container').fadeIn();$('div#tab-3 #search-btn').fadeIn();$('div#tab-3 #right-side-banner').hide();$('div#tab-3 .front-banner-ctz').css({background:'url("http://fliasia.s3.amazonaws.com/widget-wide/images/desc-trip-mama6.png") no-repeat scroll 0 0 transparent'});return;}else{$('div#tab-3 .result-container').fadeOut();$('div#tab-3 #search-btn').fadeOut();$('div#tab-3 #right-side-banner').show();$('div#tab-3 .front-banner-ctz').css({background:'url("http://d2qcctj8epnr7y.cloudfront.net/images/marvinpogi/desc-trip-mama5.png") no-repeat scroll 0 0 transparent'});}},createPrePopWin:function(check){var El=this;if(navigator.appName==globalObj.ie&&El.createPrePopWinLimit<5){El.prepopIndex++;if(check==undefined||check==false){El.createPrePopWinLimit++;}
El.prepop[El.prepopIndex]=window.open('','_blank','width=10, height=10, left='+screen.width+', top='+screen.height+',toolbar=no,scrollbars=no,resizable,location');El.prepop[El.prepopIndex].blur();window.focus();}}}});function iframe_loaded(e){if(e.src==""){$('#loader-'+e.id).hide();$('a#'+$(e).parent()[0].id).parent().addClass('glow');}
else{$('#loader-'+e.id).hide();$('a#'+$(e).parent()[0].id).parent().addClass('glow');}}
