 function resetResults(){
        setResults("Grading",'0','999999');
        for(var i=0; i < document.forms[""+fName][chkbox].length; i++){
                document.forms[""+fName][chkbox][i].checked=true;
        }
 }

 function sendRoomDetail(hotelId,roomId)
 {
        document.roomDetailForm.hotel_id.value = hotelId;
        document.roomDetailForm.room_id.value = roomId;
        document.roomDetailForm.submit();
 }

 function sendHotelDetail(hotelId)
 {
        document.hotelDetailForm.hotel_id.value = hotelId;
        document.hotelDetailForm.submit();
 }

 function roompop(url){
        window.open(url,'','top=45, left=45, height=420, width=385, scrollbars=no,vscroll=no,hscroll=no, toolbars=no, resizable=no');
 }

 var count=0;
 var hotelId='';
 function addHotelComp(hotel_id)
 {
        count++;
 }
 function compareHotel()
 {
        if(count<2){
                location.href="#";
                alert("Please check at least three hotels to compare.")
        }else if(count>3){
                location.href="#";
                alert("Please check only three hotels to compare.")
        }else{
                location.href="compareHotel.html?hotel_id="+hotelId+"&analytics_param="+gparam;
        }
 }

 function get_check_value()
 {
        hotelId = '';
        for (var i=0; i < document.chkForm.chotel.length; i++){
                if (document.chkForm.chotel[i].checked){
                        if(hotelId.length > 0){
                        hotelId = hotelId +'|'+document.chkForm.chotel[i].value;
                        }else{
                        hotelId = document.chkForm.chotel[i].value;
                        }
                }
        }
        if(count<2){
                alert("Please check at least two hotels to compare.")
        }else if(count>3){
                alert("Please check only three hotels to compare.")
        }else{
                location.href="compareHotel.html?hotel_id="+hotelId+"&analytics_param="+gparam;
        }
 }

 function showResult(){
        var min;
        var max;
        var ctr=0;
	isPrange=2;
        for(var i=0; i < document.forms[""+fName][chkbox].length; i++){
                if(document.forms[""+fName][chkbox][i].checked){
                        val = document.forms[""+fName][chkbox][i].value.split('-');
                        if(ctr == 0){   min=val[0];     max=val[1];     }
                        ctr++;
                        if(min>val[0]){ min = val[0];   }
                        if(max<val[1]){ max = val[1];   }
                }
        }
        var sortType = 'Grading';
	if(vers == 'YT'){
        	if(window.document.chkForm.sortType[1].checked){        sortType='Price';       }
        	if(window.document.chkForm.sortType[2].checked){        sortType='HotelName';   }
	}else{
                if(window.document.chkForm.sortType[0].checked){        sortType='Price';       }
                if(window.document.chkForm.sortType[1].checked){        sortType='HotelName';   }
	}
        setResults(sortType,min,max);
 }

 function showImage(divid,ino){
        for(i=1;i<ino;i++){
                window.document.getElementById('idiv'+i).style.display='none';
        }
        window.document.getElementById(divid).style.display='block';
 }



function setDest(f,o,d)
{
var f=document.forms[""+f];
f.type[1].checked=true;
}

 function showAgeBlock(val,f){
  var f=document.forms[""+f];
  if(val<1){
        window.document.getElementById('cha1').style.display='none';
        window.document.getElementById('cha2').style.display='none';
        f.age1.value='';
        f.age2.value='';
  }
  if(val == 1){
        window.document.getElementById('cha1').style.display='block';
        window.document.getElementById('cha2').style.display='none';
        f.age2.value='';
  }
  if(val == 2){
        window.document.getElementById('cha1').style.display='block';
        window.document.getElementById('cha2').style.display='block';
  }
 }

 function submitForm(){
	if(!document.paxDetailForm.tc.checked){
        	alert('Please check the terms and conditions')
                return false;
      	}else{
        	return true;
       	}
 }
