var FBRESA = "http://www.fastbookings.biz/DIRECTORY/";

function hhotelPTC(cname, lg, codeprice, codetrack, cluster)
{
	hhotelResa(cname, lg, codeprice, "", "", codetrack, cluster, "", "")
}
function hhotelPromo(cname, lg, theme)
{
	hhotelResa(cname, lg, "DYNPROMO", "", "", "", "", theme, "")
}
function hhotelNegociated(cname, lg, codeprice, codetrack, cluster)
{
	hhotelResa(cname, lg, codeprice, "", "", codetrack, cluster, "", "negociated=1");
}
function hhotelSearchGroup(cluster, lg, price, nights, title)
{
	hhotelSearch(cluster, lg, price, nights, title, "", "");
}
function hhotelSearchPartner(cluster, lg, price, codetrack, title)
{
	if (codetrack != "") args = "&from="+codetrack;
	else	args = "";
    hhotelSearch(cluster, lg, price, "", title, "", args);

}
function hhotelSearchPriceDate(cluster, price, nights, title,firstdate)
{
	// firstdate : format "YYMMDD"
	var args="";
	if (firstdate != "") args = "FirstDate="+firstdate;
	hhotelSearch(cluster, "", price, nights, title, "", args);
}

//Added for Booking site change to TravelTripper- Cognizant- 15/6/09- start
function hotelAvailability(theform)
{
	var hotelname = document.getElementById('Hotelnames').value;
	var searchlink;
	if(hotelname=="All")
	{
		alert("Please select a Hotel for Availability");
		return false;
	}
	if(hotelname=="ASIAINPARKBangalore")
	{
		searchlink = "https://www.reztrip.com/RezTripWeb/defaultSearchDisplay.do?propertyId=10809619";
	}
	if(hotelname=="ASIAINPARKChennai")
	{
		searchlink = "https://www.reztrip.com/RezTripWeb/defaultSearchDisplay.do?propertyId=10809433";
	}
	if(hotelname=="ASIAINPARKDelhi")
	{
		searchlink = "https://www.reztrip.com/RezTripWeb/defaultSearchDisplay.do?propertyId=10810145";
	}
	if(hotelname=="ASIAINPARKKolkata")
	{
		searchlink = "https://www.reztrip.com/RezTripWeb/defaultSearchDisplay.do?propertyId=10809267";
	}
	if(hotelname=="ASIAINPARKVisakhapatnam")
	{
		searchlink = "https://www.reztrip.com/RezTripWeb/defaultSearchDisplay.do?propertyId=10809986";
	}
	if(hotelname=="ASIAINPARKMumbai")
	{
		searchlink = "https://www.reztrip.com/RezTripWeb/defaultSearchDisplay.do?propertyId=10809800";
	}
	document.location = searchlink;
}
//Added for Booking site change to TravelTripper- Cognizant- 15/6/09- end


//Added for Booking site change to TravelTripper- Cognizant- 16/6/09- start
function MM_hotelAvailability(theform, hname)
{
	document.getElementById('Hotelnames').value = hname;
	hotelAvailability(theform);
}
//Added for Booking site change to TravelTripper- Cognizant- 16/6/09- end


function hhotelDispoprice(theForm)
{
	theForm.action = FBRESA + "dispoprice.phtml";

	//Commented for Booking site partner change- Cognizant- 15/6/09- start
	/*window.open('','dispoprice', 'toolbar=no,width=700,height=600,menubar=no,scrollbars=yes,resizable=yes');
	theForm.submit();*/
	//Commented for Booking site partner change- Cognizant- 15/6/09- end
}

function MM_hotelDispoprice( theform, hname ) 
{
  	
  	document.getElementById('Clusternames').value = hname;	
	document.getElementById('Hotelnames').value = hname;	
	
	hhotelDispoprice(theform);
  	
}

function hhotelSearchPromo(cluster, lg, theme)
{
	hhotelSearch(cluster, lg, "", "", "", theme, "");
}

function hhotelcancel(cname,lg)
{
  var waction = FBRESA+"cancel.phtml?state=77&Hotelnames="+cname;
  if (lg != "") waction += "&langue="+lg;
  window.open(waction,"reservation","toolbar=no,width=400,height=350,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
}


function hhotelResa(cname, lg, codeprice, firstroom, firstdate, codetrack, cluster, theme, args)
{
	var waction = FBRESA+"preresa.phtml?Hotelnames="+cname;
	if (lg != "") waction += "&langue="+lg;
	if (firstroom != "") {
		waction += "&FirstRoomName="+firstroom;
		if (codeprice == "")
			codeprice = "DIRECT";
		}
	if (firstdate != "") {
		waction += "&FirstDate="+firstdate;
		if (codeprice == "")
			codeprice = "DIRECT";
		}
	if (codeprice != "") waction += "&FSTBKNGCode="+codeprice;
	if (codetrack != "") waction += "&FSTBKNGTrackLink="+codetrack;
	if (cluster != "") waction += "&clustername="+cluster;
	if (theme != "") waction += "&theme="+theme;
	if (args != "" && (args.indexOf("=")!= -1) ) waction += "&"+args;
	waction += "&HTTP_REFERER="+escape(document.location.href);
	window.open(waction,"reservation","toolbar=no,width=400,height=350,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
}
function hhotelSearch(cluster, lg, price, nights, title, theme, args)
{
	var waction = FBRESA+"crs.phtml?clusterName="+cluster;
	if (lg != "") waction += "&langue="+lg;
	if (price != "") waction += "&FSTBKNGCode="+price;
	if (nights != "") waction += "&nights="+nights;
	if (title != "") waction += "&title="+escape(title);
	if (theme != "") waction += "&theme="+theme;
	if (args != "" && (args.indexOf("=")!= -1) ) waction += "&"+args;

	//Commented for Booking site partner change- Cognizant- 15/6/09- start
	//window.open(waction,"search","toolbar=no,width=700,height=550,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
	//Commented for Booking site partner change- Cognizant- 15/6/09- end
}
