 function getTajoffer(offer)
		  {

		 if(offer.toLowerCase().indexOf('summer')>=0)
		 {
		 offer='- Summer';
		 }
		 
		 if((offer.indexOf('-'))=='-1')
		 {offer='TajHolidays'; }
		  else
		  {
		  var offerArray=offer.split('- ');
		  offer=offerArray[1];
		  if(offer=='Royal Honeymoons')
		  {offer='Honeymoons ';}
		 
		  var offer1sthalf=offer.split(' ');
		  offer=offer1sthalf[0];
		  }
		  
		  switch(offer)
		  {
		  case 'Culture':
		  offer='TajCulture';
		  break;
		  case 'Family':
		  offer='TajHolidays';
		  break;
		  case 'Romance':
		  offer='TajRomance';
		  break;
		  case 'Honeymoons':
		  offer='TajRomance';
		  break;
		  case 'Wellness':
		  offer='TajWellness';
		  break;
		  case 'Spa':
		  offer='TajWellness';
		  break;
		  case 'Royal':
		  offer='TajRoyalRetreats';
		  break;
		  case 'Summer':
		  offer='TajSummerHolidays';
		  break;
		  default:
		  offer='TajHolidays';
		  }
		  return offer;
		  }
		  function getOfferLink(hotelid,offer)
		  {
		 // alert(offer);
		  
          if(hotelid=="HLTAGRTV" || hotelid=="HLTBLRGH" || hotelid=="HLTJAIRL" || hotelid=="HLTCCJTR" || hotelid=="HLTBLRTG" || hotelid=="HLTCJBTG" || hotelid=="HLTVNSTG" || hotelid=="HLTJSARK" || hotelid=="HLTIXMTG" || hotelid=="HLTIXEMH" || hotelid=="HLTISKTR" || hotelid=="HLTSTVGH" || hotelid=="HLTBDQTR" || hotelid=="HLTVGAGH" || hotelid=="HLTVTZTR" || hotelid=="HLTTRVGR" || hotelid=="HLTCOKTR")
		  {
		    return "https://www.yourreservation.net/ibe/" + offer + "/main.html?language=EN&quick=page1"
		  }
		  else if(hotelid=="HLTMLETE" && offer=="Maldv_PH")
		  {
		  return "https://www.yourreservation.net/ibe/HLTMLETE/main.html?rateAccessCode=*PH$"
		  }
		  else if(hotelid=="HLTMRUTE" && offer=="Maur_PH")
		  {
		  return "https://www.yourreservation.net/ibe/HLTMRUTE/main.html?rateAccessCode=*PH$";
		  }
		  else if(hotelid=="HLTMRUTE" && offer=="Maur_PI")
		  {
		  return "https://www.yourreservation.net/ibe/HLTMRUTE/main.html?rateAccessCode=*PI$"
		  }
		  else if(hotelid=="HLTMRUTE" && offer=="Maur_PJ")
		  {
		  return "https://www.yourreservation.net/ibe/HLTMRUTE/main.html?rateAccessCode=*PJ$"
		  }
		  else if(hotelid=="HLTTRVTR" && offer=="Triv_P1")
		  {
		  return "https://www.yourreservation.net/ibe/HLTTRVTR/main.html?rateAccessCode=*P1$"
		  }
		  else if(hotelid=="HLTJDHUB" && offer=="Umaid_P3")
		  {
		  return "https://www.yourreservation.net/ibe/HLTJDHUB/main.html?rateAccessCode=*P3$"
		  }
		  else
		  {
            return "https://www.yourreservation.net/ibe/" + offer + "/main.html?language=EN&quick=page1"
		  }
		 // return "https://www.trustinternational.com/mBooker/taj/2B?LANGUAGE=en&i="+ offer +"&property=" + hotelid;
		  
		  }
		  
		  
		  ////////////////////////////////////////////Mbooker 2.0
		  
		  
		  var LoadXml;
		  var coucity;
		  function ReadXml(Id) 
{ 

	if( window.ActiveXObject && /Win/.test(navigator.userAgent) )
	{ 
		LoadXml = new ActiveXObject("Msxml.DOMDocument"); 
		LoadXml.async = false; 
		LoadXml.onreadystatechange = function () 
		{ 
		    if (LoadXml.readyState == 4) ManipulateXML(Id); 
		} 
		LoadXml.load("../common_inc/link.xml"); 
	} 
	else if( document.implementation && document.implementation.createDocument ) 
	{ 
		LoadXml = document.implementation.createDocument("","",null); 
		LoadXml.async=false; 
		var loaded = LoadXml.load("../common_inc/link.xml"); 
		moz=1;
		if (loaded) 
		{ 
			ManipulateXML(Id);
		} 
	} 
	else 
	{ 
		alert("Your browser can\'t handle this script"); 
		return; 
	} 
}
function ManipulateXML(resortid)
{
strTitle = LoadXml.getElementsByTagName("HotelLinks")[0]; 

if(strTitle.getElementsByTagName('Hotel').length>0)
{
for(var i=0; i<strTitle.getElementsByTagName('Hotel').length; i++) 
{

if(strTitle.getElementsByTagName('Hotel')[i].getAttribute("HotelId")==resortid)
{
var countId=strTitle.getElementsByTagName('Hotel')[i].getAttribute("countryId");
var cityId=strTitle.getElementsByTagName('Hotel')[i].getAttribute("CityId");
coucity=countId+"|"+cityId;
//alert(coucity);
}
}
}
} 
		  
		  
		    
		 function bookdist(hotelid,offer,dates)
		  {
		 
		// alert(hotelid + ',' + offer +','+ dates);
		   if(hotelid=='TXL-TJ-TEMPCODE')
		  {
		  window.open("http://www.tajhotels.com/TajHotelFinder/popup1.html?name=Taj%20Gir%20Lodge%20&mesg=Please%20contact%20<a%20href='mailto:reservations@tajhotels.com'>reservations@tajhotels.com</a>%20to%20make%20bookings%20for%20this%20hotel.&len=750&hgt=400","mywindow","menubar=1,resizable=1,width=750,height=400"); 
  
		  }
		  else
		  {
		  
		  
		  var dateArray=dates.split('|');
		  
		  var checkinArray=dateArray[0].split('/');
		  var Monyy=checkinArray[1].split('-');
		  checkinArray1=checkinArray[0].split(' ');
		  checkinArray[0]=checkinArray1[1];
		  if(checkinArray[0].length==1)
		  checkinArray[0]="0"+checkinArray[0];
		  //alert(checkinArray[0]);
		  //var checkInNew = getMonth(Monyy[0])+"%20" + checkinArray[0]+"%2C" + Monyy[1];
		  var checkInNew = Monyy[1]+"-"+check_month(Monyy[0])+"-" +check_month(checkinArray[0]);
		  //alert(checkInNew);
		  
		  
		  var checkoutArray=dateArray[1].split('/');
		  var Monyyout=checkoutArray[1].split('-');
		  //if(checkoutArray[0].length==1)
		  //checkoutArray[0]="0"+checkoutArray[0];
		  var checkOutNew = Monyyout[1]+"-"+check_month(Monyyout[0])+"-" +check_month(checkoutArray[0]);
		  //var checkOutNew = getMonth(Monyyout[0])+"%20" + checkoutArray[0]+"%2C" + Monyyout[1];
		 // alert(checkOutNew);
		  
		// offer=getTajoffer(offer);
		 var hotelidarr=hotelid.split('-');
		 hotelid=hotelidarr[2];
		 if(offer=="PN" || offer=="PW" || offer=="PG" || offer=="PS" || offer=="P1" || offer=="P2" || offer=="P3" || offer=="P6" || offer=="P7" || offer=="P9" || offer=="PO" || offer=="PQ" )
		 {
		 
		    var domainmain;
		     if(hotelid=="HLTBDQTR" || hotelid=="HLTISKTR" || hotelid=="HLTSTVGH" || hotelid=="HLTCCJTR" || hotelid=="HLTVTZTR" || hotelid=="HLTCJBTG" || hotelid=="HLTAGRTV" || hotelid=="HLTVNSTG" || hotelid=="HLTTRVGR" ||hotelid=="HLTBLRTG" || hotelid=="HLTVGAGH" || hotelid=="HLTCOKTR" || hotelid=="HLTIXEMH" || hotelid=="HLTIXMTG" || hotelid=="HLTJAIRL" || hotelid=="HLTJSARK" || hotelid=="HLBE-101")
		     {
		      domainmain="Gateway_Link";
		     }
		     else
		     {
		     domainmain="02_tajLink";
		     }
		 //window.location.href="https://www.yourreservation.net/ibe/"+domainmain+"/main.html?ccpSelectHotel=TJ-"+hotelid+"&rateAccessCode=*"+offer+"$&quick=page1"
		 window.open("https://www.yourreservation.net/ibe/"+domainmain+"/main.html?ccpSelectHotel=TJ-"+hotelid+"&rateAccessCode=*"+offer+"$&quick=page1")
		// alert("https://www.yourreservation.net/ibe/"+domainmain+"/main.html?ccpSelectHotel=TJ-"+hotelid+"&rateAccessCode=*"+offer+"$&quick=page1");
         return 
		 }
		
		 var offerLink=getOfferLink(hotelid,offer)
		 
		 
		 //alert(hotelid);
		 ReadXml(hotelid);
		 //alert("cc="+coucity);
		 var ccarray=coucity.split('|');
		 
		 //alert(ccarray[0]+' ' + ccarray[1]);
		 
		 offerLink=offerLink + "&ccpSelectCity=" + ccarray[1] + "&ccpSelectCountry=" + ccarray[0]+ "&ccpSelectHotel=TJ%2D" + hotelid;
		 offerLink=offerLink+"&calArrivalDateField=" + checkInNew+"&calDepartureDateField=" +checkOutNew;
		 //alert(offerLink);
		 //document.write(offerLink);
		 //window.location.href=offerLink;
		 window.open(offerLink);
		 //alert(offerLink);
		 //window.location.href=offerLink + "&in_day=" + checkinArray[0] + "&in_month=" + checkinArray[1]+ "&out_day=" + checkoutArray[0] + "&out_month=" + checkoutArray[1];
		 }
		  
		  }
		  /////////////////////
		  
		  function newofferbook(link,dates)
		  {
		       var dateArray=dates.split('|');
    		  
		      var checkinArray=dateArray[0].split('/');
		      var Monyy=checkinArray[1].split('-');
		     //Code Changed
		      var checkInNew = Monyy[1]+"-" +check_month(Monyy[0])+"-"+check_month(checkinArray[0]);
		      //var checkInNew = getMonth(Monyy[0])+"%20" + checkinArray[0]+"%2C" + Monyy[1];
		      //alert(checkInNew);
    		  
    		  
		      var checkoutArray=dateArray[1].split('/');
		      var Monyyout=checkoutArray[1].split('-');
		       //Code Changed
		      var checkOutNew = Monyyout[1]+"-" +check_month(Monyyout[0])+"-"+check_month(checkoutArray[0]);
		      //var checkOutNew = getMonth(Monyyout[0])+"%20" + checkoutArray[0]+"%2C" + Monyyout[1];
		      //alert(checkOutNew);
    		  
		     var linkurl=link;
		    // offerLink=offerLink + "&ccpSelectCity=" + ccarray[1] + "&ccpSelectCountry=" + ccarray[0]+ "&ccpSelectHotel=TJ%2D" + hotelid;
		    if(link.indexOf("calArrivalDateField")==-1)
		     linkurl=linkurl+"&calArrivalDateField=" + checkInNew+"&calDepartureDateField=" +checkOutNew;
		     //alert(offerLink);
		     //alert(linkurl);
		     //window.location.href=linkurl; 
		     window.open(linkurl);
		  }
		  
		 
		  
		  
		  
///////////////////
 function bookdist1(hotelid,offer,dates)
		  {
		 
		 //alert(hotelid + ',' + offer +','+ dates);
		   if(hotelid=='TXL-TJ-TEMPCODE')
		  {
		  window.open("http://www.tajhotels.com/TajHotelFinder/popup1.html?name=Taj%20Gir%20Lodge%20&mesg=Please%20contact%20<a%20href='mailto:reservations@tajhotels.com'>reservations@tajhotels.com</a>%20to%20make%20bookings%20for%20this%20hotel.&len=750&hgt=400","mywindow","menubar=1,resizable=1,width=750,height=400"); 
  
		  }
		  else
		  {
		  
		  
		  var dateArray=dates.split('|');
		  
		  var checkinArray=dateArray[0].split('/');
		  var Monyy=checkinArray[1].split('-');
		  var checkInNew;
		  if(checkinArray[0].length==1)
		  {
		  //checkInNew = getMonth(Monyy[0])+"%20" +"0"+checkinArray[0] +"%2C" + Monyy[1];
		  checkInNew = Monyy[1]+"-"+check_month(Monyy[0])+"-"+"0"+checkinArray[0];
		  }
		  else
		  {
		  //checkInNew = getMonth(Monyy[0])+"%20" + checkinArray[0] +"%2C" + Monyy[1];
		  checkInNew = Monyy[1]+"-"+check_month(Monyy[0])+"-"+checkinArray[0];
		  }
		  //alert(checkInNew);
		  
		  
		  var checkoutArray=dateArray[1].split('/');
		  var Monyyout=checkoutArray[1].split('-');
		  var dep_mon;
		  if(checkoutArray[0].length == 1)
		  {
		   dep_mon=Monyyout[1]+"-"+check_month(Monyyout[0])+"-"+"0"+checkoutArray[0];
		  }
		  else
		  {
		  dep_mon=Monyyout[1]+"-"+check_month(Monyyout[0])+"-"+checkoutArray[0];
		  }
		  var checkOutNew =dep_mon;
		  //var checkOutNew = getMonth(Monyyout[0])+"%20" + checkoutArray[0]+"%2C" + Monyyout[1];
		  //alert(checkOutNew);
		  
		// offer=getTajoffer(offer);
		 var hotelidarr=hotelid.split('-');
		 hotelid=hotelidarr[2];
		
		 var offerLink=getOfferLink(hotelid,offer)
		
		 
		 //alert(hotelid);
		 ReadXml(hotelid);
		 //alert("cc="+coucity);
		 var ccarray=coucity.split('|');
		 
		 //alert(ccarray[0]+' ' + ccarray[1]);
		 
		 offerLink=offerLink + "&ccpSelectCity=" + ccarray[1] + "&ccpSelectCountry=" + ccarray[0]+ "&ccpSelectHotel=TJ%2D" + hotelid;
		 offerLink=offerLink+"&calArrivalDateField=" + checkInNew+"&calDepartureDateField=" +checkOutNew;
		//document.write(offerLink);
		 return offerLink;
		 
		 //window.location.href=offerLink + "&in_day=" + checkinArray[0] + "&in_month=" + checkinArray[1]+ "&out_day=" + checkoutArray[0] + "&out_month=" + checkoutArray[1];
		 }
		  
		  }
		  
function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
		  
		  
	function check_month(monthnumber)
{
 debugger;
  var monthno;
  monthnumber=trim(monthnumber);
  if(monthnumber.length == 1)
  {
   monthno="0"+monthnumber;
  }
  else
  {
  monthno=monthnumber;
  }
  return monthno.replace(" ","");
}


		  function getMonth(mm)
		  {
		  switch(mm)
		  {
		 case '1':
		  return 'January';
		  break;
		  case '2':
		  return 'February';
		  break;
		  case '3':
		  return 'March';
		  break;
		  case '4':
		  return 'April';
		  break;
		  case '5':
		  return 'May';
		  break;
		  case '6':
		  return 'June';
		  break;
		  case '7':
		  return 'July';
		  break;
		  case '8':
		  return 'August';
		  break;
		  case '9':
		  return 'September';
		  break;
		  case '10':
		  return 'October';
		  break;
		  case '11':
		  return 'November';
		  break;
		  case '12':
		  return 'December';
		  break;
		  }
		  
		  }
		  
		  ///////////////////////////////////////////////////////

function plusOnClick(d,i)
	{
	
	    if(document.getElementById(d).style.visibility=='hidden'){
	        document.getElementById(d).style.visibility='visible';
	        document.getElementById(d).style.display='';
	        document.getElementById(i).src='../images/minus.jpg';
	    }
	    else{
	        document.getElementById(d).style.visibility='hidden';
	        document.getElementById(d).style.display='none';
	        document.getElementById(i).src='../images/plus.jpg';
	    }
	}