
﻿
var defaultXOffset=0;var defaultYOffset=0;var hintDiv="cssHelp";var hintContent="markhelp";function showHint(obj){var x=0;var y=0;x=getX(obj);y=getY(obj);y=y-28;var hintHtml='';if(obj.getAttribute('hint')!=null)
hintHtml+=obj.getAttribute('hint');getObject(hintContent).innerHTML=hintHtml;getStyle(hintDiv).visibility='visible';getStyle(hintDiv).left=x+'px';getStyle(hintDiv).top=y+'px';}
function hideHint(obj){getStyle(hintDiv).visibility='hidden';}
function getX(obj){var pos=0;if(obj.x)
{pos+=obj.x;}
else if(obj.offsetParent){while(obj.offsetParent){pos+=obj.offsetLeft;obj=obj.offsetParent;}}
return pos;}
function getY(obj){var count=0;var pos=0;if(obj.y)
pos+=obj.y;else if(obj){while(obj){pos+=obj.offsetTop;obj=obj.offsetParent;}}
return pos;}
function getObject(name){if(document.getElementById)return document.getElementById(name);if(document.all)return document.all[name];if(document.layers){if(document.layers[name])return document.layers[name];else return document.layers[name].layers[name];}}
function getStyle(name){if(document.getElementById)return document.getElementById(name).style;if(document.all)return document.all[name].style;if(document.layers){if(document.layers[name])return document.layers[name];else return this.style=document.layers[name].layers[name];}}
function changeFlag(obj){if(obj.className=="flagOut"){obj.className="flagIn";}
else if(obj.className=="flagIn"){obj.className="flagOut";}}
function showFlagPanel(obj){var flagDiv="flagPanel";var bodyDivRef=document.getElementById(flagDiv);if(bodyDivRef.style.visibility=='hidden'||bodyDivRef.className.indexOf('hidden')>-1){var x=0;var y=0;x=getX(obj);y=getY(obj);x=x-70;y=y+25;getStyle(flagDiv).visibility='visible';getStyle(flagDiv).left=x+'px';getStyle(flagDiv).top=y+'px';fadein();hideFlag();if(bodyDivRef.className.indexOf('hidden')>-1){bodyDivRef.className=bodyDivRef.className.substring(0,bodyDivRef.className.indexOf('hidden')-1);}}
else{fadeout();}}
function fadein(){var divs="flagPanel";objDiv=document.getElementById(divs);if(objDiv)pull();}
function fadeout(){var divs="flagPanel";if(objDiv)draw();}
function pull(){if(typeof window.drawit!="undefined")clearInterval(drawit);pullit=setInterval("pullengine()",50);}
function draw(objDiv){if(typeof window.pullit!="undefined")clearInterval(pullit);drawit=setInterval("drawengine()",10)}
function pullengine(){if(objDiv&&objDiv.filters&&objDiv.filters[0]&&(parseInt(objDiv.filters.alpha.opacity)<100||parseInt(objDiv.filters.alpha.opacity)==0)){objDiv.filters.alpha.opacity=parseInt(objDiv.filters.alpha.opacity)+10;}
else if(objDiv&&objDiv.style.opacity!="undefined"&&parseFloat(objDiv.style.opacity)<1){objDiv.style.opacity=parseFloat(objDiv.style.opacity)+0.1;}
else if(objDiv&&objDiv.style.MozOpacity!="undefined"&&parseFloat(objDiv.style.MozOpacity)<1){objDiv.style.MozOpacity=parseFloat(objDiv.style.MozOpacity)+0.1;}
else if(window.pullit){clearInterval(pullit);}}
function drawengine(){if(objDiv&&objDiv.filters&&objDiv.filters[0]&&parseInt(objDiv.filters.alpha.opacity)>0){objDiv.filters.alpha.opacity=parseInt(objDiv.filters.alpha.opacity)-10;}
else if(objDiv&&typeof objDiv.style.opacity!="undefined"&&parseFloat(objDiv.style.opacity)>0){objDiv.style.opacity=parseFloat(objDiv.style.opacity)-0.1;}
else if(objDiv&&typeof objDiv.style.MozOpacity!="undefined"&&parseFloat(objDiv.style.MozOpacity)>0){objDiv.style.MozOpacity=parseFloat(objDiv.style.MozOpacity)-0.1;}
else if(window.drawit){clearInterval(drawit);objDiv.style.visibility='hidden';}}
var waitFlag=2000;var hideTimerFlag;function mouseOutMenuFlag(e,obj){var evt=e||window.event;var relTarg=evt.relatedTarget||evt.toElement;var fromTarg=evt.relatedTarget||evt.fromElement;if(relTarg.id!="flagPanel"&&relTarg.id.indexOf("flag")>-1&&fromTarg.id.indexOf("flag")==-1){fadeout();}
else hideFlag();}
function keepOpenFlag(){showDivs('flagPanel');if(hideTimerFlag!=null)
clearTimeout(hideTimerFlag);}
function hideFlag(){hideTimerFlag=setTimeout("hideAllFlag()",waitFlag);}
function hideAllFlag(){fadeout();}
function showMenus(obj,menutype){if(hideTimer!=null)clearTimeout(hideTimer);var flagDiv="menus";var bodyDivRef=document.getElementById(flagDiv);var x=0;var y=0;x=getX(obj);y=getY(obj);x=x;y=y+70;document.getElementById("headerMenu1").style.background="";document.getElementById("headerMenu2").style.background="";document.getElementById("headerMenu3").style.background="";obj.style.background="url(images/menu-header-hover.gif)";var cultureDiv=document.getElementById("flagPanel");if(cultureDiv&&cultureDiv.filters&&cultureDiv.filters[0]&&parseInt(cultureDiv.filters.alpha.opacity)>0){cultureDiv.filters.alpha.opacity=0;}
else if(cultureDiv&&typeof cultureDiv.style.opacity!="undefined"&&parseFloat(cultureDiv.style.opacity)>0){cultureDiv.style.opacity=0;}
else if(cultureDiv&&typeof cultureDiv.style.MozOpacity!="undefined"&&parseFloat(cultureDiv.style.MozOpacity)>0){cultureDiv.style.MozOpacity=0;}
getStyle(flagDiv).visibility='visible';getStyle(flagDiv).display='block';getStyle(flagDiv).left=x+'px';getStyle(flagDiv).top=y+'px';hideDivs("servicemenu");hideDivs("updatemenu");hideDivs("destinationmenu");showDivs(menutype+"menu");if(bodyDivRef.className.indexOf('hidden')>-1){bodyDivRef.className=bodyDivRef.className.substring(0,bodyDivRef.className.indexOf('hidden')-1);}}
function hideMenus(e,obj){var flagDiv="menus";var bodyDivRef=document.getElementById(flagDiv);var evt=e||window.event;var relTarg=evt.relatedTarget||evt.toElement;if(relTarg){if(relTarg.id!="menus"&&(relTarg.id.indexOf("menu")==-1&&relTarg.id.indexOf("svc")==-1&&relTarg.id.indexOf("upd")==-1&&relTarg.id.indexOf("dst")==-1)){bodyDivRef.style.visibility='hidden';obj.style.background="";}}
else{bodyDivRef.style.visibility='hidden';obj.style.background="";}}
function mouseOutMenu(e,obj){var evt=e||window.event;var relTarg=evt.relatedTarget||evt.toElement;var fromTarg=evt.relatedTarget||evt.fromElement;if(relTarg){if(relTarg.id!="headerMenu"&&relTarg.id.indexOf("menu")>-1&&fromTarg.id.indexOf("menu")==-1){document.getElementById("headerMenu1").style.background="";document.getElementById("headerMenu2").style.background="";document.getElementById("headerMenu3").style.background="";}
else hide();}
else hide();}
var wait=500;var hideTimer;function keepOpen(){showDivs('menus');if(hideTimer!=null)
clearTimeout(hideTimer);}
function hide(){hideTimer=setTimeout("hideAll()",wait);}
function hideAll(){var flagDiv="menus";var bodyDivRef=document.getElementById(flagDiv);bodyDivRef.style.visibility='hidden';document.getElementById("headerMenu1").style.background="";document.getElementById("headerMenu2").style.background="";document.getElementById("headerMenu3").style.background="";}
function showDivs(bodyDiv){var bodyDivRef=document.getElementById(bodyDiv);if(bodyDivRef){if(bodyDivRef.style.display=='none'||bodyDivRef.className.indexOf('hidden')>-1){bodyDivRef.style.display='block';if(bodyDivRef.className.indexOf('hidden')>-1){bodyDivRef.className=bodyDivRef.className.substring(0,bodyDivRef.className.indexOf('hidden')-1);}}}}
function hideDivs(bodyDiv){var bodyDivRef=document.getElementById(bodyDiv);if(bodyDivRef){bodyDivRef.style.display='none';}}
function showSSR(obj){if(obj.checked==true){showDivs("ssrs");}
else hideDivs("ssrs");}
function changepages(obj,mousestyle){if(mousestyle=="over"){obj.style.backgroundColor="#98CAE5";obj.style.borderColor="#0F4478";obj.style.color="#fff";}
else if(mousestyle=="out"){obj.style.backgroundColor="#fff";obj.style.borderColor="#e2e2e2";obj.style.color="#0066CC";}}
function increasefonts(divid){var divcontent=document.getElementById(divid);var fsi,lhg;if(divcontent.style.fontSize){fsi=parseInt(divcontent.style.fontSize.replace("px",""));lhg=parseInt(divcontent.style.lineHeight.replace("px",""));}else{fsi=11;lhg=17;}
if(fsi<20){divcontent.style.fontSize=fsi+1+"px";divcontent.style.lineHeight=lhg+1+"px";}}
function decreasefonts(divid){var divcontent=document.getElementById(divid);var fsi,lhg;if(divcontent.style.fontSize){fsi=parseInt(divcontent.style.fontSize.replace("px",""));lhg=parseInt(divcontent.style.lineHeight.replace("px",""));}else{fsi=11;lhg=17;}
if(fsi>11){divcontent.style.fontSize=fsi-1+"px";divcontent.style.lineHeight=lhg-1+"px";}}
function changecontentnews(culture){var contenten,contentid;contentid="Cari tim Brasil pada Thursday scoured berkejut Atlantik air untuk tetap dari crashed Air France jet pertama setelah diambil oleh puing helikopter ternyata menjadi sampah.";contentid+="<br/><br/>";contentid+="Dengan harapan untuk menemukan apapun badan waning sebagai kepala cari ke dalam lima hari, Brasil dari militer bergeser ke fokus memulihkan reruntuh dari Airbus A330-200 crash yang membunuh 228 orang.";contentid+="The New York Times melaporkan bahwa Airbus mengeluarkan peringatan pada hari Kamis untuk penerbangan yang pilot harus mengikuti 'didirikan prosedur/ jika mereka mencurigai airspeed indikator tidak bekerja.";contentid+="<br/><br/>";contentid+="Peringatan yang membingungkan yang diikuti spekulasi bahwa ada pesawat Mei crashed karena Flew menjadi badai terlalu cepat. Tetapi para pejabat Brazil dan Perancis cautioned bukti bahwa itu terlalu jauh untuk menawarkan penjelasan tipis. ";contentid+="<br/><br/>";contentid+="'Dengan setiap saat melewati kemungkinan untuk menemukan badan menurun,' Brazilian Air Force brigadir Ramon Borges Cardoso kepada wartawan di Recife, di kota pesisir di mana reruntuh dari crash akan dibawa.";contentid+="<br/><br/>";contentid+="'Kami berkonsentrasi pada awalnya mencari dan tubuh korban, tetapi sekarang kami fokus pada menemukan puing yang dapat membantu dalam penyelidikan,' tambahnya.";contentid+="<br/><br/>";contentid+="The New York Times mengatakan kepada klien Airbus 'terdapat ketidaksesuaian antara berbagai diukur airspeeds' dalam Airbus A330 yang crashed, namun perusahaan itu tidak dicatat prejudging dari hasil penyelidikan.";contentid+="<br/><br/>";contentid+="Lainnya laporan dari Wall Street Journal dan Perancis dari Le Monde yang baik ke udara kecepatan, digabungkan dengan badai notoriously berbahaya di daerah tropis, sebagai faktor potensi dalam crash baffled penerbangan yang telah ahli.";contentid+="<br/><br/>";contentid+="Airbus sebelumnya menolak memberikan komentar.";contentid+="<br/><br/>";contentid+="J bagasi pallet dan dua buoys telah diambil oleh helikopter dari crash daerah sekitar 1.100 km (680 mil) timur laut dari pantai Brasil, namun penyidik kemudian ditentukan mereka bukan bagian dari jet.";contentid+="<br/><br/>";contentid+="(Reuters)";contenten="Brazilian search teams on Thursday scoured choppy Atlantic waters for remains of a crashed Air France jet after the first debris retrieved by helicopter turned out to be rubbish.";contenten+="<br/><br/>";contenten+="With hopes of finding any bodies waning as the search headed into its fifth day, Brazil's military shifted focus to recovering wreckage from the Airbus A330-200 crash that killed 228 people.";contenten+="<br/><br/>";contenten+="The New York Times reported that Airbus issued a warning on Thursday to airlines that pilots should follow 'established procedures' if they suspect airspeed indicators are not working.";contenten+="<br/><br/>";contenten+="The warning followed a flurry of speculation that the plane may have crashed because it flew into a storm too fast. But Brazilian and French officials cautioned that the evidence was far too slim to offer explanations. ";contenten+="<br/><br/>";contenten+="'With each passing moment the possibilities of finding bodies decreases,' Brazilian Air Force Brigadier Ramon Borges Cardoso told reporters in Recife, the coastal city where wreckage from the crash would be brought.";contenten+="<br/><br/>";contenten+="'We were initially concentrating on searching for bodies and survivors, but now we're focused on finding debris that can help in the investigation,' he added.";contenten+="<br/><br/>";contenten+="The New York Times said Airbus told clients 'there was inconsistency between the different measured airspeeds' in the Airbus A330 that crashed, though the company noted it was not prejudging the investigation's outcome.";contenten+="<br/><br/>";contenten+="Other reports from the Wall Street Journal and France's Le Monde both pointed to air speed, combined with thunderstorms in a notoriously dangerous tropical area, as a potential factor in the crash that has baffled aviation experts.";contenten+="<br/><br/>";contenten+="Airbus earlier declined to comment.";contenten+="<br/><br/>";contenten+="A luggage pallet and two buoys were pulled by helicopters from the crash area about 1,100 km (680 miles) northeast of Brazil's coast, but investigators later determined they weren't part of the jet.";contenten+="<br/><br/>";contenten+="(Reuters)";if(culture=="en-US"){document.getElementById("newscontent").innerHTML=contenten;}else document.getElementById("newscontent").innerHTML=contentid;}
function showcity(divid,pid){if(document.getElementById(pid).style.display=='none'||document.getElementById(pid).className.indexOf('hidden')>-1){hideDivs("about");document.getElementById("tababout").className="tabnative";hideDivs("transportation");document.getElementById("tabtransportation").className="tabnative";hideDivs("accomodation");document.getElementById("tabaccomodation").className="tabnative";hideDivs("places");document.getElementById("tabplaces").className="tabnative";hideDivs("information");document.getElementById("tabinformation").className="tabnative";showDivs(pid);document.getElementById(divid).className="tabselected";}}
function showhotel(divid,pid){if(document.getElementById(pid).style.display=='none'||document.getElementById(pid).className.indexOf('hidden')>-1){hideDivs("season");document.getElementById("tabseason").className="tabnative";hideDivs("facility");document.getElementById("tabfacility").className="tabnative";showDivs(pid);document.getElementById(divid).className="tabselected";}}
function showpromo(divid,pid){if(document.getElementById(pid).style.display=='none'||document.getElementById(pid).className.indexOf('hidden')>-1){hideDivs("bookpay");document.getElementById("tabbookpay").className="tabnative";hideDivs("termcondition");document.getElementById("tabtermcondition").className="tabnative";showDivs(pid);document.getElementById(divid).className="tabselected";}}
function showpayment(divid,pid,ptype){if(document.getElementById(pid).style.display=='none'||document.getElementById(pid).className.indexOf('hidden')>-1){if(ptype==1){hideDivs("creditcard");document.getElementById("tabcreditcard").className="tabnative";hideDivs("paypal");document.getElementById("tabpaypal").className="tabnative";}
else{hideDivs("bni");document.getElementById("tabbni").className="tabnative";hideDivs("bii");document.getElementById("tabbii").className="tabnative";hideDivs("bri");document.getElementById("tabbri").className="tabnative";hideDivs("mandiri");document.getElementById("tabmandiri").className="tabnative";hideDivs("permata");document.getElementById("tabpermata").className="tabnative";hideDivs("panin");document.getElementById("tabpanin").className="tabnative";hideDivs("bukopin");document.getElementById("tabbukopin").className="tabnative";}
showDivs(pid);document.getElementById(divid).className="tabselected";}}
function changeMonth(frm,selectedValue,intType){var dayMonth=0;var iLen=String(selectedValue).length;var selectedMonth=String(selectedValue).substring(iLen-2);var selectedYear=String(selectedValue).substring(0,4);var drDate;switch(selectedMonth){case"01":{dayMonth=31;break}
case"02":{dayMonth=28;break}
case"03":{dayMonth=31;break}
case"04":{dayMonth=30;break}
case"05":{dayMonth=31;break}
case"06":{dayMonth=30;break}
case"07":{dayMonth=31;break}
case"08":{dayMonth=31;break}
case"09":{dayMonth=30;break}
case"10":{dayMonth=31;break}
case"11":{dayMonth=30;break}
case"12":{dayMonth=31;break}
default:{dayMonth=31;break}}
if(selectedYear%4==0&&selectedMonth=="02"){dayMonth=29;}
if(intType==1){drDate=frm.elements['AvailabilitySearchInputSearchView$DropDownListMarketDay1'];drMonth=frm.elements['AvailabilitySearchInputSearchView$DropDownListMarketMonth2'];if(drMonth){var jsLength=drMonth.options.length;var i;for(i=0;i<=jsLength;i++)
{drMonth.selectedIndex=i;if(drMonth.value==selectedValue)
{break;}}}}
else{drDate=frm.elements['AvailabilitySearchInputSearchView$DropDownListMarketDay2'];}
var selIndexDate=drDate.options.selectedIndex;drDate.options.length=dayMonth;if(selIndexDate>dayMonth-1){selIndexDate=dayMonth-1;}
for(var j=0;j<dayMonth;j++){var showj=String(j+1);drDate.options[j].value=showj;drDate.options[j].text=showj;}
drDate.selectedIndex=selIndexDate;}
function flightType(frm,bolEn){var drDate1=frm.elements['AvailabilitySearchInputSearchView$DropDownListMarketDay1'];var drMnth1=frm.elements['AvailabilitySearchInputSearchView$DropDownListMarketMonth1'];var drDate2=frm.elements['AvailabilitySearchInputSearchView$DropDownListMarketDay2'];var drMnth2=frm.elements['AvailabilitySearchInputSearchView$DropDownListMarketMonth2'];var indexDt=drDate1.selectedIndex
var indexMt=drMnth1.selectedIndex
var totDate1=drDate1.length
if(bolEn!=1){showDivs("returnDate");if(parseInt(indexDt)+3>totDate1){drDate2.selectedIndex=1;drMnth2.selectedIndex=indexMt+1;}
else{drDate2.selectedIndex=indexDt+3;}}
else{hideDivs("returnDate");}}
function erase(element,defaultValue){if(element.value==defaultValue){element.style.color='#000';element.value='';}}
function set(element,defaultValue){if(element.value==''){element.style.color='#a5a5a5';element.value=defaultValue;}}
var ss={fixAllLinks:function(){var allLinks=document.getElementsByTagName('a');for(var i=0;i<allLinks.length;i++){var lnk=allLinks[i];if((lnk.href&&lnk.href.indexOf('#')!=-1)&&((lnk.pathname==location.pathname)||('/'+lnk.pathname==location.pathname))&&(lnk.search==location.search)){ss.addEvent(lnk,'click',ss.smoothScroll);}}},smoothScroll:function(e){if(window.event){target=window.event.srcElement;}else if(e){target=e.target;}else return;if(target.nodeName.toLowerCase()!='a'){target=target.parentNode;}
if(target.nodeName.toLowerCase()!='a')return;anchor=target.hash.substr(1);var allLinks=document.getElementsByTagName('a');var destinationLink=null;for(var i=0;i<allLinks.length;i++){var lnk=allLinks[i];if(lnk.name&&(lnk.name==anchor)){destinationLink=lnk;break;}}
if(!destinationLink)destinationLink=document.getElementById(anchor);if(!destinationLink)return true;var destx=destinationLink.offsetLeft;var desty=destinationLink.offsetTop;var thisNode=destinationLink;while(thisNode.offsetParent&&(thisNode.offsetParent!=document.body)){thisNode=thisNode.offsetParent;destx+=thisNode.offsetLeft;desty+=thisNode.offsetTop;}
clearInterval(ss.INTERVAL);cypos=ss.getCurrentYPos();ss_stepsize=parseInt((desty-cypos)/ss.STEPS);ss.INTERVAL=setInterval('ss.scrollWindow('+ss_stepsize+','+desty+',"'+anchor+'")',10);if(window.event){window.event.cancelBubble=true;window.event.returnValue=false;}
if(e&&e.preventDefault&&e.stopPropagation){e.preventDefault();e.stopPropagation();}},scrollWindow:function(scramount,dest,anchor){wascypos=ss.getCurrentYPos();isAbove=(wascypos<dest);window.scrollTo(0,wascypos+scramount);iscypos=ss.getCurrentYPos();isAboveNow=(iscypos<dest);if((isAbove!=isAboveNow)||(wascypos==iscypos)){window.scrollTo(0,dest);clearInterval(ss.INTERVAL);location.hash=anchor;}},getCurrentYPos:function(){if(document.body&&document.body.scrollTop)
return document.body.scrollTop;if(document.documentElement&&document.documentElement.scrollTop)
return document.documentElement.scrollTop;if(window.pageYOffset)
return window.pageYOffset;return 0;},addEvent:function(elm,evType,fn,useCapture){if(elm.addEventListener){elm.addEventListener(evType,fn,useCapture);return true;}else if(elm.attachEvent){var r=elm.attachEvent("on"+evType,fn);return r;}else{alert("Handler could not be removed");}}}
ss.STEPS=25;function setdisplayitem(item){hideDivs("item0");hideDivs("item1");hideDivs("item2");hideDivs("item3");hideDivs("item4");setclass("linkitem0","elseitem");setclass("linkitem1","elseitem");setclass("linkitem2","elseitem");setclass("linkitem3","elseitem");setclass("linkitem4","elseitem");showDivs("item"+item);setclass("linkitem"+item,"selecteditem");}
function setclass(divs,cssclass){document.getElementById(divs).setAttribute("class",cssclass);}
function showCal(divid)
{var divnum=0;var monthSelected;if(divid=="divcal"){if(document.getElementById(divid).style.display=='none'||document.getElementById(divid).className.indexOf('hidden')>-1){showDivs("divcal");hideDivs("divcalreturn");divnum=0;monthSelected=document.getElementById("AvailabilitySearchInputSearchView_DropDownListMarketMonth1").selectedIndex;document.getElementById(divid).innerHTML=getCal(divnum);setDisplayedMonth(divnum,monthSelected);}
else{hideDivs("divcal");hideDivs("divcalreturn");}}else{if(document.getElementById(divid).style.display=='none'||document.getElementById(divid).className.indexOf('hidden')>-1){hideDivs("divcal");showDivs("divcalreturn");divnum=1;monthSelected=document.getElementById("AvailabilitySearchInputSearchView_DropDownListMarketMonth2").selectedIndex;document.getElementById(divid).innerHTML=getCal(divnum);setDisplayedMonth(divnum,monthSelected);}
else{hideDivs("divcal");hideDivs("divcalreturn");}}}
function hideCal(divnum)
{if(divnum==0){hideDivs("divcal");}
else hideDivs("divcalreturn");}
daysInMonth=[31,28,31,30,31,30,31,31,30,31,30,31];monthNames=['january','february','march','april','may','june','july','august','september','october','november','december'];function setDDItem(ddList,selectedValue)
{for(var i=0;i<ddList.options.length;i++){if(ddList.options[i].value==selectedValue){ddList.options[i].selected=true;break;}}}
function getDaysInMonth(month,year){if((month==1)&&(year%4==0)&&((year%100!=0)||(year%400==0))){return 29;}else{return daysInMonth[month];}}
function dateClicked(divnum,day,month,year){var dDay;var dMonth;if(divnum==0){dDay=document.getElementById("AvailabilitySearchInputSearchView_DropDownListMarketDay1");dMonth=document.getElementById("AvailabilitySearchInputSearchView_DropDownListMarketMonth1");}else{dDay=document.getElementById("AvailabilitySearchInputSearchView_DropDownListMarketDay2");dMonth=document.getElementById("AvailabilitySearchInputSearchView_DropDownListMarketMonth2");}
if(String(month).length==1){month="0"+String(month);}
setDDItem(dDay,day);setDDItem(dMonth,year+'-'+month);hideCal(divnum);}
function setDisplayedMonth(divnum,month){if(month<0){}
else if(month>=months){}
else{for(var i=0;i<months;i++){document.getElementById('calendarMonth'+divnum+''+i).style.display='none';}
document.getElementById('calendarMonth'+divnum+''+month).style.display='block';}}
function changeClassOver(obj){if(obj){obj.className="mover";}}
function changeClassOut(obj,j){if(obj){if(j%7==0||j%7==6){obj.className="datefillwn";}
else obj.className="datefill";}}
function getCal(divnum)
{months=12+1;var now=new Date();var currentday=now.getDate();var currentmonth=now.getMonth();var currentyear=now.getFullYear();var month=currentmonth;var year=currentyear;var startMonth=currentmonth;var classDay
var result="";for(var i=0;i<months;i++){result+='<div style="display: none; width: 300px; position: absolute; background-color:#F7F7F7; border: 1px solid #183152;" id="calendarMonth'+divnum+''+i+'">';result+='<div style="background-color: #0678B3; height: 30px; color: #ffffff; font-weight: bold; text-align: right; padding-top: 5px; overflow: hidden;  border-bottom: 1px solid #375D81;">';if((i-1)>=0)
{result+='<div style="float: left; padding-top: 7px; width: 30px; cursor: pointer;" onClick="setDisplayedMonth('+divnum+','+(i-1)+')"><img src="images/path-left.gif" height="9" width="30" /></div>';}
else
{result+='<div style="float: left; padding-top: 7px; width: 30px; cursor: pointer; height: 9px;">&nbsp;</div>';}
result+='<div style="float: left; padding-top: 5px; width: 240px; text-align: center;">';result+=monthNames[month]+' '+year;result+='</div>';if((i+1)<=12)
{result+='<div style="float: left; padding-top: 7px; width: 30px; cursor: pointer;" onClick="setDisplayedMonth('+divnum+','+(i+1)+')"><img src="images/path.gif" height="9" width="30" /></div>';}
else
{result+='<div style="float: left; padding-top: 7px; width: 30px; cursor: pointer; height: 9px;">&nbsp;</div>';}
result+='</div>';result+='<div style="height: 20px; overflow: hidden; background-color: #C4D7ED; padding-top: 5px; margin-bottom: 10px; padding-left: 3px; border-bottom: 1px solid #ABC8E2;">';result+='<div class="daytitle">sun</div><div class="daytitle">mon</div><div class="daytitle">tue</div><div class="daytitle">wed</div><div class="daytitle">thu</div>';result+='<div class="daytitle">fri</div><div class="daytitle">sat</div>';result+='</div>';firstDayDate=new Date(year,month,1);firstDay=firstDayDate.getDay();for(j=0;j<42;j++){if(j%7==0){result+='<div class="daterow">';}
if((j<firstDay)||(j>=firstDay+getDaysInMonth(month,year))){result+='<div class="dateempty">&nbsp;</div>';}else{result+='<div title="'+monthNames[month]+' '+(j-firstDay+1)+', '+year+'" ';if(((j-firstDay+1)>=currentday&&month==currentmonth&&year==currentyear)||(month>currentmonth&&year>=currentyear)||(year>currentyear))
{if(j%7==0||j%7==6){result+='class="datefillwn" onmouseover="changeClassOver(this);" onmouseout="changeClassOut(this, '+j+');" onClick="dateClicked('+divnum+','+(j-firstDay+1)+','+(month+1)+','+year+')">';}
else{result+='class="datefill" onmouseover="changeClassOver(this);" onmouseout="changeClassOut(this, '+j+');" onClick="dateClicked('+divnum+','+(j-firstDay+1)+','+(month+1)+','+year+')">';}}
else result+='class="datefill" style="text-decoration: line-through; color: #A5A5A5; cursor: default;" >';result+=(j-firstDay+1)+'</div>';}
if(j%7==6){result+='</div>';}}
result+='<div style="background-color: #E1E6FA; height: 27px; padding-top: 7px; text-align: right; border-top: 1px solid #ABC8E2;">';result+='<span onclick="hideCal('+divnum+');" style="cursor: pointer; font-weight: bold;" title="Close Calendar">';result+='close <img src="images/icon-close.gif" width="20" height="20" style="margin-left: 5px; margin-right: 10px; vertical-align: middle;" />';result+='</span></div>';result+='</div>';month++;startMonth++;if(month>=12){month=0;year++;}}
return result;}
var applicationJavaScriptHtmlId="AvailabilitySearchInputSearchView";var applicationCalendarUriQueryString="Calendar.aspx?";function erase(element,defaultValue){if(element.value==defaultValue){element.value="";}}
function set(element,defaultValue){if(element.value==""){element.value=defaultValue;}}
function initFrom(frm){var getCountries=setCountries();var stnCode="";var obj1=frm.elements['AvailabilitySearchInputSearchView$DropDownListMarketOrigin1'];obj1.options.length=1;obj1.options[0].value="";obj1.options[0].text="from...";for(var j=0;j<getCountries.length;j++){var opt_group=document.createElement('optgroup');opt_group.label=getCountries[j].name;for(var i=0;i<SortedStations.length;i++){stnCode=Stations[SortedStations[i]].cid;if(stnCode!=getCountries[j].code)continue;var opt=document.createElement('option');opt.innerHTML=Stations[SortedStations[i]].name;opt.value=Stations[SortedStations[i]].uid;opt_group.appendChild(opt);}
if(opt_group.childNodes.length>0)obj1.appendChild(opt_group);}
var obj2=frm.elements['AvailabilitySearchInputSearchView$DropDownListMarketDestination1'];obj2.options.length=1;obj2.options[0].value="";obj2.options[0].text="to...";for(var j=0;j<getCountries.length;j++){var opt_group=document.createElement('optgroup');opt_group.label=getCountries[j].name;for(var i=0;i<SortedStations.length;i++){stnCode=Stations[SortedStations[i]].cid;if(stnCode!=getCountries[j].code)continue;var opt=document.createElement('option');opt.innerHTML=Stations[SortedStations[i]].name;opt.value=Stations[SortedStations[i]].uid;opt_group.appendChild(opt);}
if(opt_group.childNodes.length>0)obj2.appendChild(opt_group);}}
function changeStation(frm,id){var getCountries=setCountries();var stnCode="";var obj2=frm.elements['AvailabilitySearchInputSearchView$DropDownListMarketDestination1'];var dest=Stations[id].dest;if(dest.length>0){while(obj2.childNodes.length)
{obj2.removeChild(obj2.childNodes[0]);}}
obj2.options.length=1;obj2.options[0].value="";obj2.options[0].text="to...";for(var j=0;j<getCountries.length;j++){var opt_group=document.createElement('optgroup');opt_group.label=getCountries[j].name;for(var i=0;i<dest.length;i++){stnCode=Stations[dest[i]].cid;if(stnCode!=getCountries[j].code)continue;var opt=document.createElement('option');opt.innerHTML=Stations[dest[i]].name;opt.value=Stations[dest[i]].uid;opt_group.appendChild(opt);}
if(opt_group.childNodes.length>0)obj2.appendChild(opt_group);}
obj2.selectedIndex=1;}
function flightType(frm,bolEn){var drDate1=frm.elements['AvailabilitySearchInputSearchView$DropDownListMarketDay1'];var drMnth1=frm.elements['AvailabilitySearchInputSearchView$DropDownListMarketMonth1'];var drDate2=frm.elements['AvailabilitySearchInputSearchView$DropDownListMarketDay2'];var drMnth2=frm.elements['AvailabilitySearchInputSearchView$DropDownListMarketMonth2'];var indexDt=drDate1.selectedIndex
var indexMt=drMnth1.selectedIndex
var totDate1=drDate1.length
if(bolEn!=1){showDivs("returnDate");if(parseInt(indexDt)+3>totDate1){drDate2.selectedIndex=1;drMnth2.selectedIndex=indexMt+1;}
else{drDate2.selectedIndex=indexDt+3;}}
else{hideDivs("returnDate");}}
function changeMonth(frm,selectedValue,intType){var dayMonth=0;var iLen=String(selectedValue).length;var selectedMonth=String(selectedValue).substring(0,2);var selectedYear=String(selectedValue).substring(3);var drDate;switch(selectedMonth){case"01":{dayMonth=31;break}
case"02":{dayMonth=28;break}
case"03":{dayMonth=31;break}
case"04":{dayMonth=30;break}
case"05":{dayMonth=31;break}
case"06":{dayMonth=30;break}
case"07":{dayMonth=31;break}
case"08":{dayMonth=31;break}
case"09":{dayMonth=30;break}
case"10":{dayMonth=31;break}
case"11":{dayMonth=30;break}
case"12":{dayMonth=31;break}
default:{dayMonth=31;break}}
if(selectedYear%4==0&&selectedMonth=="02"){dayMonth=29;}
if(intType==1){drDate=frm.elements['AvailabilitySearchInputSearchView$DropDownListMarketDay1'];}
else{drDate=frm.elements['AvailabilitySearchInputSearchView$DropDownListMarketDay2'];}
var selIndexDate=drDate.options.selectedIndex;drDate.options.length=dayMonth;if(selIndexDate>dayMonth-1){selIndexDate=dayMonth-1;}
for(var j=0;j<dayMonth;j++){var showj=String(j+1);drDate.options[j].value=showj;drDate.options[j].text=showj;}
drDate.selectedIndex=selIndexDate;}
function submitForm(){var frm=document.myform;frm.submit();}
function submitSearch(){var frm=document.forms['SkySales']
var drDate1=frm.elements['AvailabilitySearchInputSearchView$DropDownListMarketDay1'];var drMnth1=frm.elements['AvailabilitySearchInputSearchView$DropDownListMarketMonth1'];var drDate2=frm.elements['AvailabilitySearchInputSearchView$DropDownListMarketDay2'];var drMnth2=frm.elements['AvailabilitySearchInputSearchView$DropDownListMarketMonth2'];var rbTrip=document.getElementById("AvailabilitySearchInputSearchView_RoundTrip");var fromStn=frm.elements['AvailabilitySearchInputSearchView$DropDownListMarketOrigin1'];var toStn=frm.elements['AvailabilitySearchInputSearchView$DropDownListMarketDestination1'];var routeConnection=".CGKENE.CGKMOF.CGKARD.CGKBJW.CGKRTG.CGKAMI.CGKTMC.CGKWGP.CGKLBJ.CGKBMU.CGKSWQ.SUBENE.SUBMOF.SUBARD.SUBBJW.SUBRTG.SUBAMI.SUBTMC.SUBWGP.SUBLBJ.SUBBMU.SUBSWQ.ENESUB.ENECGK.MOFSUB.MOFCGK.ARDSUB.ARDCGK.BJWSUB.BJWCGK.RTGCGK.RTGSUB.BMUCGK.BMUSUB.SWQCGK.SWQSUB.LBJCGK.LBJSUB.WGPCGK.WGPSUB.AMICGK.AMISUB.TMCCGK.TMCSUB.";var selectedRoute=fromStn.options[fromStn.selectedIndex].value.replace(/^\s+|\s+$/g,'')+toStn.options[toStn.selectedIndex].value.replace(/^\s+|\s+$/g,'');if(routeConnection.indexOf(selectedRoute)>0){var iAdult=frm.elements['AvailabilitySearchInputSearchView$DropDownListPassengerType_ADT'];var iInfant=frm.elements['AvailabilitySearchInputSearchView$DropDownListPassengerType_INFANT'];var rdTrip=frm.elements['AvailabilitySearchInputSearchView$RadioButtonMarketStructure'];var jTrip="";var radioLength=rdTrip.length;for(var i=0;i<radioLength;i++){if(rdTrip[i].checked){jTrip=rdTrip[i].value;}}
if(jTrip=="RoundTrip"){document.cookie="drDate2="+drDate2.options[drDate2.selectedIndex].value;document.cookie="drMnth2="+drMnth2.options[drMnth2.selectedIndex].value;}
document.cookie="rdTrip="+jTrip;document.cookie="fromStn="+fromStn.options[fromStn.selectedIndex].value;document.cookie="toStn="+toStn.options[toStn.selectedIndex].value;document.cookie="drDate1="+drDate1.options[drDate1.selectedIndex].value;document.cookie="drMnth1="+drMnth1.options[drMnth1.selectedIndex].value;document.cookie="iAdult="+iAdult.options[iAdult.selectedIndex].value;document.cookie="iInfant="+iInfant.options[iInfant.selectedIndex].value;location.href="flightConnection.aspx";}
else{var timeNow=new Date();var index1=drDate1.selectedIndex;var date1=drDate1.options[index1].value
var index2=drMnth1.selectedIndex;var month1=drMnth1.options[index2].value
var mystr=date1+'-'+month1;var strarr=mystr.split("-");var alldate1=strarr[1]+'/'+strarr[2]+'/'+strarr[0];var index3=drDate2.selectedIndex;var date2=drDate2.options[index3].value
var index4=drMnth2.selectedIndex;var month2=drMnth2.options[index4].value
mystr=date2+'-'+month2;strarr=mystr.split("-");var alldate2=strarr[1]+'/'+strarr[2]+'/'+strarr[0];if(fromStn.value==''){alert("please select an origin airport")}else
if(toStn.value==''){alert("please select a destination airport")}else{if(Date.parse(alldate1)<Date.parse(mtNow+"/"+dtNow+"/"+yrNow)){alert("Invalid Date Range!\nthe date you selected has already passed.")}
else{if(rbTrip.checked){if(Date.parse(alldate1)>Date.parse(alldate2)){alert("Invalid Date Range!\nplease make sure that your return date is not earlier than your outbond date!")}else{frm.submit();}}else{frm.submit();}}}}}