// JScript File
var buttonid=null;

//function that hides extra column in the Hotel grid
function hideColumns(){

//assigns table name to variable
var tbl  = document.getElementById('ctl00_mainContentPlaceHolder_dgHotels');
//gets the rows
var rows = tbl.getElementsByTagName('tr');

//loops through each row and gets its second cell
//and assigns its "display" style attribute to 'none'
for (var row=0; row<rows.length;row++) {
    var cels = rows[row].getElementsByTagName('td')
    
    cels[1].style.display='none';  

    row=row+5;
                                        }

                       }
 
     
  
                                




 //function to clear all fields of the text boxes in the Hotel text boxes            
 function clearFields(buttonid){


if(buttonid==1)
{
AddHotelclearDropDown();
clearHotelFields(1);
}
else
{

clearHotelFields(2);

        //first cell of fourth row
        document.getElementById("row6cell1").innerHTML="";
    
        //second cell of fourth row
        document.getElementById("row6cell2").innerHTML="";
}
 


clearCells();



                        }
 



function clearHotelFields(buttonid){

 if(buttonid==2)
        {
        DeleteHotelclearDropDown();
        //first cell of fourth row
        document.getElementById("row6cell1").innerHTML="";
    
        //second cell of fourth row
        document.getElementById("row6cell2").innerHTML="";
        
         }


clearCells();
if(buttonid==3)
{
DeleteHotelclearDropDown();
document.getElementById("ctl00_mainContentPlaceHolder_txtHotelID").value="";
}



 document.getElementById("ctl00_mainContentPlaceHolder_txtHotelName").value="";
 document.getElementById("ctl00_mainContentPlaceHolder_txtHotelAddress1").value="";
 document.getElementById("ctl00_mainContentPlaceHolder_txtHotelAddress2").value="";
 document.getElementById("ctl00_mainContentPlaceHolder_txtHotelEmail").value="";
 document.getElementById("ctl00_mainContentPlaceHolder_txtTotCapRooms").value="";
 document.getElementById("ctl00_mainContentPlaceHolder_txtSinRooms").value="";
 document.getElementById("ctl00_mainContentPlaceHolder_txtSinRoomsRate").value="";
 document.getElementById("ctl00_mainContentPlaceHolder_txtDoubRooms").value="";
 document.getElementById("ctl00_mainContentPlaceHolder_txtDoubRoomsRate").value="";
 

       
}

function clearDropDown(){


document.getElementById('ctl00_mainContentPlaceHolder_txtHotelCounty').selectedIndex = 0;
            
            }
            
            
            
function DeleteHotelclearDropDown(){


document.getElementById('ctl00_mainContentPlaceHolder_txtHotelCounty').value="";            
            }
            
            
 function AddHotelclearDropDown(){


document.getElementById('ctl00_mainContentPlaceHolder_txtHotelCounty').selectedIndex = 0;            }