/**
      * This method will be used for default text hiding in text box
     
     function hideText(id){
     var elem;      
     elem = document.getElementById(id);	 
     elem.value = "" ;  // if the style.display value is blank we try to figure it out here     
     }

	 function showText(){
		 var elem1, elem2, elem3, elem4;

		 elem1 = document.getElementById('hotelName');
		 elem1.value = "Enter Hotel Name";

		 elem2 = document.getElementById('brochureCode');
		 elem2.value = "Enter Brochure Code";

		 elem3 = document.getElementById('holidayLocator');
		 elem3.value = "Enter holiday locator";

      	 elem4 = document.getElementById('brochureSelect');
		 elem4.options[0].selected = true;
	 } **/
    
     /**
      * This method disables the specific div when required.
      **/                                                          
     function disableRest(id1,id2){
		 
		 if('brochureCode'==id1){
			if(document.getElementById('brochureCode')) document.getElementById('brochureCode').disabled=false;
			if(document.getElementById('brochureSelect')) document.getElementById('brochureSelect').disabled=false;
			if(document.getElementById('brochureCodeSpan')) document.getElementById('brochureCodeSpan').className="ncol1";
			
			if(document.getElementById('hotelName')) document.getElementById('hotelName').disabled=true;
			if(document.getElementById('hotelNameSpan')) document.getElementById('hotelNameSpan').className="ncol1 greyout";

			if(document.getElementById('holidayLocator')) document.getElementById('holidayLocator').disabled=true;
			if(document.getElementById('holidayLocatorSpan')) document.getElementById('holidayLocatorSpan').className="ncol1 greyout";
            		if(document.getElementById('hotelName')) document.getElementById('hotelName').value = 'Enter Hotel Name';
			if(document.getElementById('holidayLocator')) document.getElementById('holidayLocator').value='Enter holiday locator';
			if(document.getElementById('hotelImportantInfo')) document.getElementById('hotelImportantInfo').style.display="none";
	
		}
		else if('hotelName'==id1){
			if(document.getElementById('hotelName')) document.getElementById('hotelName').disabled=false;
			if(document.getElementById('hotelNameSpan')) document.getElementById('hotelNameSpan').className="ncol1";

			if(document.getElementById('brochureCode')) document.getElementById('brochureCode').disabled=true;
			if(document.getElementById('brochureSelect')) document.getElementById('brochureSelect').disabled=true;
			if(document.getElementById('brochureCodeSpan')) document.getElementById('brochureCodeSpan').className="ncol1 greyout";

			if(document.getElementById('holidayLocator')) document.getElementById('holidayLocator').disabled=true;
			if(document.getElementById('holidayLocatorSpan')) document.getElementById('holidayLocatorSpan').className="ncol1 greyout";
			if(document.getElementById('brochureCode')) document.getElementById('brochureCode').value='Enter Brochure Code';
			if(document.getElementById('holidayLocator')) document.getElementById('holidayLocator').value='Enter holiday locator';
			if(document.getElementById('hotelImportantInfo')) document.getElementById('hotelImportantInfo').style.display="block";
		}
		else if('holidayLocator'==id1){
			if(document.getElementById('holidayLocatorSpan')) document.getElementById('holidayLocatorSpan').className="ncol1";
			if(document.getElementById('holidayLocator')) document.getElementById('holidayLocator').disabled=false;
			if(document.getElementById('hotelImportantInfo')) document.getElementById('hotelImportantInfo').style.display="none";

			if(document.getElementById('brochureCode')) document.getElementById('brochureCode').disabled=true;
			if(document.getElementById('brochureSelect')) document.getElementById('brochureSelect').disabled=true;
			if(document.getElementById('brochureCodeSpan')) document.getElementById('brochureCodeSpan').className="ncol1 greyout";

			if(document.getElementById('hotelName')) document.getElementById('hotelName').disabled=true;
			if(document.getElementById('hotelNameSpan')) document.getElementById('hotelNameSpan').className="ncol1 greyout";
			if(document.getElementById('hotelName')) document.getElementById('hotelName').value = 'Enter Hotel Name';
			if(document.getElementById('brochureCode')) document.getElementById('brochureCode').value='Enter Brochure Code';
		}
    }
     /**
      * This method disables the text fields.
      **/ 
    function disableThis(id){
		if('brochureCode'==id){
			if(document.getElementById('brochureCode')) document.getElementById('brochureCode').disabled=true;
			if(document.getElementById('brochureSelect')) document.getElementById('brochureSelect').disabled=true;
			if(document.getElementById('brochureCodeSpan')) document.getElementById('brochureCodeSpan').className="ncol1 greyout";
			if(document.getElementById('hotelImportantInfo')) document.getElementById('hotelImportantInfo').style.display="none";
		}
		if('hotelName'==id){
			if(document.getElementById('hotelName')) document.getElementById('hotelName').disabled=true;
			if(document.getElementById('hotelNameSpan')) document.getElementById('hotelNameSpan').className="ncol1 greyout";	
			if(document.getElementById('hotelImportantInfo')) document.getElementById('hotelImportantInfo').style.display="none";	
		}
		if('holidayLocator'==id){
			if(document.getElementById('holidayLocatorSpan')) document.getElementById('holidayLocatorSpan').className="ncol1 greyout";
			if(document.getElementById('holidayLocator')) document.getElementById('holidayLocator').disabled=true;
			if(document.getElementById('hotelImportantInfo')) document.getElementById('hotelImportantInfo').style.display="none";
		}
     }

	 /**
     * This function creates a pop-up on click of info.
     **/
	 function popitup(divId,displayInfo,url,height,width,top,left) {
		newwindow=window.open(url,'name','height='+height+',width='+width+',top='+top+',left='+left);
		if (window.focus) {newwindow.focus()}
		return false;
	    }

	  function hideText(id,text){ 
		 var elem; 	 
		 elem = document.getElementById( id ); 
		 if(elem.value == text){  
		 	elem.value = '';
		 }
	  }
	 
	  function showText(id,text){
		 
	  	 var elem;
		 elem4 = document.getElementById('brochureSelect');
		 elem4.options[0].selected = true;
		 elem = document.getElementById( id );
		 if(elem.value == ''){  
		 	elem.value = ''+text;
		 }     
	  }
	  
	  function redirect(url){
	  	window.location = url;
	  }
	  
	  
	  function searchPanelHider(){
	  	var searchDiv = document.getElementById('searchDiv');
	  	if(searchDiv != null){
	  		if(searchDiv.style.display == 'none'){
	  			searchDiv.style.display = 'block';
	  		} else {
	  			searchDiv.style.display = 'none';
	  		}
	  	}
	  }
	  
	  function changeSearchButton(){
	  	var dealBut = document.getElementById('search_button1');
	  	fSearch = document.getElementById('fSearch');
	  	
	  	
		if(fSearch.checked == false){
			dealBut.src = "http://www.thomascook.com/images/siteElements/buttons/search.gif";
		} else {
			dealBut.src = "http://www.thomascook.com/images/siteElements/updatecalendar.gif";
		}
		
}


// added for FF:8416:Search Additions - to set the Number of nights drop-downs color in Holiday Seacrh Page
  function setColor()
	 {
		
		var index=document.getElementById('inputnights').selectedIndex;
		var duration=document.getElementById('inputnights');
		duration.style.backgroundColor = duration.options[index].style.backgroundColor;  
	 }