/* Copyright (c) 1995-2008 Choice Hotels International, Inc. All Rights Reserved. */

function init_dropdowns(SFY){
	if($.browser.safari&&$.browser.version.number>0&&$.browser.version.number<2)return ;
	if(document.getElementById('\163p\141\156\u005f\u004eu\u006dR\157\157\155\163\u004c\u0061\u0062\145\u006c')){
		 document.getElementById('\u0073p\141n\u005f\u004eu\155\122\u006f\u006f\u006d\u0073\u004c\u0061\u0062\u0065l').style.display='\u0069\156\u006c\u0069n\145';
		 document.getElementById('\u0073p\141\u006e\u005f\u0064\u006fN\165\u006d\122o\157\155\163\104\u0072\157\160').style.display='i\156\u006c\u0069n\u0065';
		 displayAdultChildrenDropdowns(2,document.getElementById('\u006e\u0072\157o\155').selectedIndex+1,5,'\163\u0070\141\156_\u0064\u006f\116u\155\u0041\144\165\154t\163\104\u0072\u006f\160_','\163p\141n\137\u0064\157\116\165\u006d\103h\u0069l\144\u0072\u0065\u006e\u0044r\u006f\160\u005f')
	}
};

function displayAdultChildrenDropdowns(startIndex,endIndex,lastIndex,adultPrefix,childPrefix,extrabedPrefix,adultLabelId,childLabelId,extrabedLabelId){
	var showStyle="display";
	showAdultChildrenDropdowns(showStyle,startIndex,endIndex,lastIndex,adultPrefix,childPrefix,extrabedPrefix,adultLabelId,childLabelId,extrabedLabelId)
};

function showAdultChildrenDropdowns(showStyle,startIndex,endIndex,lastIndex,adultPrefix,childPrefix,extrabedPrefix,adultLabelId,childLabelId,extrabedLabelId){
	var show;
	switch(showStyle){
		case "display":;show={style:"display",yes:"inline",no:"none"};break;
		case "visibility":;show={style:"visibility",yes:"visible",no:"hidden"};break
	}
	for(i=startIndex;i<endIndex+1;i++){
		document.getElementById(adultPrefix+i).style[show.style]=show.yes;
		document.getElementById(childPrefix+i).style[show.style]=show.yes;
		if(extrabedPrefix&&document.getElementById(extrabedPrefix+i)){document.getElementById(extrabedPrefix+i).style[show.style]=show.yes}
	}
	for(i=endIndex+1;i<lastIndex+1;i++){
		document.getElementById(adultPrefix+i).style[show.style]=show.no;
		document.getElementById(childPrefix+i).style[show.style]=show.no;
		if(extrabedPrefix&&document.getElementById(extrabedPrefix+i)){document.getElementById(extrabedPrefix+i).style[show.style]=show.no}
	}
	var showOption=(startIndex>endIndex)?show.no:show.yes;
	if(adultLabelId){document.getElementById(adultLabelId).style[show.style]=showOption}
	if(childLabelId){document.getElementById(childLabelId).style[show.style]=showOption}
	if(extrabedLabelId&&document.getElementById(extrabedLabelId)){document.getElementById(extrabedLabelId).style[show.style]=showOption}
};

function cpRewardNight(srpid,cisid,cpnumber,lang,country){
	var srp=srpid.value;
	var cpPopupURL="/ires/"+lang+"-"+country+"/html/CPRewardNightPopup";
	var target;
	if((cisid=='')&&(srp=='SRD')){
		target="profileLogin";
		popUp(cpPopupURL,target,'500','420')}
	else if((cisid!=''&&(cpnumber==''||cpnumber=='none'))&&srp=='SRD'){
		target="cpapp";
		popUp(cpPopupURL,target,'500','320')}
};

function popUp(url,target,width,height){
	var paramURL=url+"?target-frame="+target;
	var windowname='CPRewardNightPopup';
	popWindow(paramURL,windowname,width,height);
	return false
};

var hBY={jBY:"\120l\u0065\141s\145 \u0065\u006et\u0065r\040\142\157\164h\u0020\171\157\u0075\u0072\u0020C\150\u0065c\153-\u0069n\040A\116\u0044\u0020\u0043\150\145\u0063\153\u002d\u006f\165t\u0020\u0064\u0061\u0074\145s",SBY:"\131\u006fu\u0020\150\141\u0076e\u0020\145n\164\145r\145\144 \u0061\u0020\160a\162t\u0069a\154\u0020\u0064\u0061\164\u0065\056\u000a\120\154\u0065\u0061\163e\u0020\u0065n\164\145r\u0020\u0061\040m\u006f\156t\150 \u006f\u0072\u0020s\145\154\145\u0063\164\040'\104\141y\u0027\040\164o\040c\154\145a\u0072 \u0074\150\145\040\144a\u0079.",oBY:"\131o\165\u0020h\u0061\u0076e\u0020e\156\164\145\u0072\145\144 \141\040p\u0061\162\u0074\151\141\u006c\040\u0064\141\164\145\u002e\u000a\u0050l\145\141\163\u0065 \u0065\156\u0074\u0065\u0072\040\141\u0020\u0064\141y\u0020\u006f\162\040s\145\u006c\145\143t\040\u0027M\157\156\u0074\150\047\u0020\u0074o\u0020\143\u006ce\141\u0072\040\164h\u0065\040\155\u006f\u006e\164\u0068\056",nBY:"\111n\u0076a\u006ci\u0064\u0020d\u0061\u0074e\072\012\116o\164\040t\150\141\u0074 \155a\u006e\171 \144a\u0079\163\u0020i\156 ",kBY:"",_BY:"\106\145b\u0072\165a\162\u0079",LBY:"\u0041\160\162\u0069\154",JBY:"\u004au\156\145",xBY:"S\u0065p\u0074\u0065\155\142\u0065r",zBY:"\u004e\157\166e\u006db\u0065\u0072"};/* Copyright (c) 1995-2008 Choice Hotels International, Inc. All Rights Reserved. */
var yBY=false;

function validateDate(gKY,cKY,qKY){if(qKY==null){MBY=new Date();WBY=MBY.getFullYear();GBY=MBY.getMonth();fBY=MBY.getDate();if((gKY>GBY)||((gKY==GBY)&&(cKY>=fBY)))qKY=WBY+1900;else qKY=WBY+1901}if((gKY==null)||(cKY==null)||(qKY==null))return false;if(navigator.appName.indexOf("W\145\142\u0054\u0056")!=-1){}else {var VKY;switch(gKY){case 1:;case 3:;case 5:;case 7:;case 8:;case 10:;case 12:;VKY=31;break;case 4:;case 6:;case 9:;case 11:;VKY=30;break;case 2:;VKY=28;break}if((gKY==2)&&(cKY==29)){if(qKY%100==0){if(qKY%400!=0)return false}else {if(qKY%4!=0)return false}}else if(cKY>VKY){return false}return true}};

function validateFormDate(VKY){uBY=VKY.month.options.selectedIndex;iBY=VKY.day.options.selectedIndex;NBY=parseInt(VKY.month.options[uBY].value);UBY=parseInt(VKY.day.options[iBY].value);aBY=false;if(VKY.dates_rqd)aBY=VKY.dates_rqd.value;if(navigator.appName.indexOf("\u0057e\u0062\124\126")!=-1){}else {if(!FBY(NBY,UBY,aBY))return false;return true}};

function validateFormDates(qKY){if(qKY.depart_month){uBY=qKY.month.options.selectedIndex;iBY=qKY.day.options.selectedIndex;NBY=parseInt(qKY.month.options[uBY].value);UBY=parseInt(qKY.day.options[iBY].value);uBY=qKY.depart_month.options.selectedIndex;iBY=qKY.depart_day.options.selectedIndex;CBY=parseInt(qKY.depart_month.options[uBY].value);HBY=parseInt(qKY.depart_day.options[iBY].value);aBY=false;if(qKY.dates_rqd)aBY=qKY.dates_rqd.value;if(navigator.appName.indexOf("W\u0065\142\124V")!=-1){}else {if(!FBY(NBY,UBY,aBY))return false;if(!FBY(CBY,HBY,aBY))return false;if(NBY+UBY==CBY+HBY){changeCheckOut(qKY)}}}return true};

function FBY(cKY,$KY,DKY){if(DKY){if($KY<0||cKY<0){alert(hBY.jBY);return false}}if(($KY>0)&&(cKY<0)){alert(hBY.SBY);return false}if((cKY>0)&&($KY<0)){alert(hBY.oBY);return false}var vKY=new Date();var wKY=vKY.getFullYear();var PKY=vKY.getMonth();var rKY=vKY.getDate();var mKY=((cKY>PKY)||((cKY==PKY)&&($KY>=rKY)))?wKY:wKY+1;if(!validateDate(cKY,$KY,mKY)){alert(hBY.nBY+tKY(cKY)+hBY.kBY);return false}return true};

function changeCheckOut(mKY){if(typeof mKY.depart_month!="u\156d\u0065\u0066i\u006ee\144"){dKY=new Date().clearTime(false);pKY=new Date().clearTime(false);Chcom.menu.updateDaySelect("\141r\162\115o\u006e\u0074\150","\u0061\u0072\u0072D\u0061y");if((mKY.month.selectedIndex<1)||(mKY.day.selectedIndex<1)){return }pKY.setMonth(mKY.month.selectedIndex-1);pKY.setDate(mKY.day.selectedIndex);if(pKY<dKY){pKY.setFullYear(dKY.getFullYear()+1)}KKY=new Date().clearTime(false);KKY.setMonth(mKY.depart_month.selectedIndex-1);KKY.setDate(mKY.depart_day.selectedIndex);if((KKY<dKY)&&(KKY.getFullYear()==dKY.getFullYear())){KKY.setFullYear(dKY.getFullYear()+1)}if((!yBY)&&(pKY>=KKY)){if(mKY.month.selectedIndex!=0){if(mKY.month.selectedIndex==2){var rKY=new Date();var PKY=rKY.getFullYear();var wKY=rKY.getMonth();if(wKY>2)PKY=PKY+1;if(mKY.day.selectedIndex==28){if(((PKY%4==0)&&(PKY%100!=0))||(PKY%400==0)){mKY.depart_day.selectedIndex=29}else {mKY.depart_day.selectedIndex=1;mKY.depart_month.selectedIndex=3}}else if(mKY.day.selectedIndex>28){mKY.depart_day.selectedIndex=1;mKY.depart_month.selectedIndex=3}else {mKY.depart_day.selectedIndex=mKY.day.selectedIndex+1;mKY.depart_month.selectedIndex=mKY.month.selectedIndex}}else if((mKY.day.selectedIndex==30)&&((mKY.month.selectedIndex==4)||(mKY.month.selectedIndex==6)||(mKY.month.selectedIndex==9)||(mKY.month.selectedIndex==11))){mKY.depart_day.selectedIndex=1;mKY.depart_month.selectedIndex=mKY.month.selectedIndex+1}else if(mKY.day.selectedIndex>30){mKY.depart_day.selectedIndex=1;if(mKY.month.selectedIndex==12){mKY.depart_month.selectedIndex=1}else {mKY.depart_month.selectedIndex=mKY.month.selectedIndex+1}}else {mKY.depart_day.selectedIndex=mKY.day.selectedIndex+1;mKY.depart_month.selectedIndex=mKY.month.selectedIndex}Chcom.menu.updateDaySelect("\u0064\u0065p\115\157\u006e\164\150","\144e\u0070\104a\u0079")}}}};

function depdateChanged(vKY,DKY){yBY=true;Chcom.menu.updateDaySelect(vKY,DKY)};

function tKY($KY){var IKY;switch($KY){case 2:;IKY=hBY._BY;break;case 4:;IKY=hBY.LBY;break;case 6:;IKY=hBY.JBY;break;case 9:;IKY=hBY.xBY;break;case 11:;IKY=hBY.zBY;break}return IKY};