function Toggle_trGrpHeader1(colId,rowId)
{ 

	//poorman_changeimage(imgId);
	if(rowId)
	poorman_toggle(rowId);
	if(colId)
	poorman_toggle_css(colId);

}
function poorman_changeimage(id, sMinus, sPlus,row_number)
{
	var img = document.getElementById(id);
	if (img!=null)
	{
		if(id == 'trGrpHeader1_Img')
		{      
			img.src = '../images/btn_air_a.jpg';
			document.getElementById('trGrpHeader2_Img').src = '../images/btn_hotel.jpg';
			document.getElementById('trGrpHeader3_Img').src = '../images/btn_car.jpg';
		}
		else if(id == 'trGrpHeader2_Img')
		{	
			img.src = '../images/btn_hotel_a.jpg';
			document.getElementById('trGrpHeader1_Img').src = '../images/btn_air.jpg';
			document.getElementById('trGrpHeader3_Img').src = '../images/btn_car.jpg';
		}
		else
		{
			img.src = '../images/btn_car_a.jpg';
			document.getElementById('trGrpHeader1_Img').src = '../images/btn_air.jpg';
			document.getElementById('trGrpHeader2_Img').src = '../images/btn_hotel.jpg';
		}
	}
}
function poorman_toggle(id)
{
	var tr = document.getElementById(id);
	
	
	if(id == 'trRow1')
	{
		tr.style.display = '';
		document.getElementById('trRow2').style.display = 'none';
		document.getElementById('trRow3').style.display = 'none';
	}
	else if(id == 'trRow2')
	{
		tr.style.display = '';
		document.getElementById('trRow1').style.display = 'none';
		document.getElementById('trRow3').style.display = 'none';
	}
	else if(id == 'trRow3')
	{
		tr.style.display = '';
		document.getElementById('trRow1').style.display = 'none';
		document.getElementById('trRow2').style.display = 'none';
	}
}

function poorman_toggle_css(id)
{
	if(id == 'tdRow2')
	{
		/*document.getElementById('tdRow1').style.background= 'url(images/butt_ov.gif)';//'images/butt_ov.gif';
		document.getElementById('tdRow2').style.background= 'url(images/butt_up.gif)';//'images/butt_up.gif';*/
			var imgName= 'templates/images/butt_ov.gif';
			document.getElementById('tdRow1').style.background  = "url(" + imgName + ")"; 
			var imgName= 'templates/images/butt_ov.gif';
			document.getElementById('tdRow3').style.background  = "url(" + imgName + ")"; 
			var imgName= 'templates/images/butt_ov.gif';
			document.getElementById('tdRow4').style.background  = "url(" + imgName + ")"; 
			
			
			var imgName1= 'templates/images/butt_up.gif';
			document.getElementById('tdRow2').style.background  = "url(" + imgName1 + ")"; 

	}
	else if(id == 'tdRow3')
	{
			var imgName= 'templates/images/butt_ov.gif';
			document.getElementById('tdRow1').style.background  = "url(" + imgName + ")"; 
			var imgName= 'templates/images/butt_ov.gif';
			document.getElementById('tdRow2').style.background  = "url(" + imgName + ")"; 
			var imgName= 'templates/images/butt_ov.gif';
			document.getElementById('tdRow4').style.background  = "url(" + imgName + ")"; 

			var imgName1= 'templates/images/butt_up.gif';
			document.getElementById('tdRow3').style.background  = "url(" + imgName1 + ")"; 
	}
		else if(id == 'tdRow4')
	{ 
			var imgName= 'templates/images/butt_ov.gif';
			document.getElementById('tdRow1').style.background  = "url(" + imgName + ")"; 
			var imgName= 'templates/images/butt_ov.gif';
			document.getElementById('tdRow2').style.background  = "url(" + imgName + ")"; 
			var imgName= 'templates/images/butt_ov.gif';
			document.getElementById('tdRow3').style.background  = "url(" + imgName + ")"; 

			var imgName1= 'templates/images/butt_up.gif';
			document.getElementById('tdRow4').style.background  = "url(" + imgName1 + ")"; 
			window.location.href="insurance.html";
	}
	
	else 
	{
			var imgName= 'templates/images/butt_ov.gif';
			document.getElementById('tdRow2').style.background  = "url(" + imgName + ")";
				var imgName= 'templates/images/butt_ov.gif';
			document.getElementById('tdRow3').style.background  = "url(" + imgName + ")"; 
			var imgName= 'templates/images/butt_ov.gif';
			document.getElementById('tdRow4').style.background  = "url(" + imgName + ")"; 

			
			var imgName1= 'templates/images/butt_up.gif';
			document.getElementById('tdRow1').style.background  = "url(" + imgName1 + ")"; 
			
	}
}



function formDate(date){
	var dt = new Date(date);
	var month = dt.getMonth() + 1;
	if(month <=9)
		month = '0' + month;
	var year = dt.getFullYear();
	var day = dt.getDate();
	if(day <=9)
		day = '0' + day;
		
	return year + "" + month + "" +  day + "";
}

function SetHiddenValues_Car()
{
	document.CARSForm.B_DATE.value = formDate(document.CARSForm.car_pickup_date.value) + "0000" ;
	document.CARSForm.E_DATE.value = formDate(document.CARSForm.car_dropoff_date.value)  + "0000" ;
}
function SetHiddenValues_Air()
{
	document.AIRSForm.B_DATE_1.value = formDate(document.AIRSForm.air_dep_date.value) + "0000" ;
	document.AIRSForm.E_DATE_1.value = formDate(document.AIRSForm.air_ret_date.value)  + "0000" ;	
}
function SetHiddenValues_Hotel()
{
	document.HOTELSForm.B_DATE.value = formDate(document.HOTELSForm.hotel_chkin_date.value) + "0000" ;
	document.HOTELSForm.E_DATE.value = formDate(document.HOTELSForm.hotel_chkout_date.value)  + "0000" ;
}


function validation_AIRForm(theForm1)
{

if(theForm1.B_LOCATION_1.value=="")
 {
     alert("Please Enter From City");
	 theForm1.B_LOCATION_1.focus();
	 return false;
  }
if(theForm1.E_LOCATION_1.value=="")
 {
     alert("Please Enter To City");
	theForm1.E_LOCATION_1.focus();
	  return false;
  }
  if(theForm1.air_dep_date.value=="")
  {
     alert("Please Enter Depature Date");
	 theForm1.air_dep_date.focus();
	 return false;
  }
}
  

function validation_HOTELForm(theForm2)
{

 if(theForm2.B_LOCATION.value=="")
  {
    alert("Plase Enter a From City");
	 theForm2.B_LOCATION.focus();
	 return false;
  }
  
   	if(theForm2.COUNTRY_CODE.value=="N1") 
{  		
  	alert("Plase Enter Country");
  	 theForm2.COUNTRY_CODE.focus();
	return false;
  }
  
   if(theForm2.hotel_chkin_date.value=="")
   {
   alert("Please Enter Check In Date");
    theForm2.hotel_chkin_date.focus();
    return false;
   }
   
   
   
    if(theForm2.hotel_chkout_date.value=="")
   {
   alert("Please Enter Check Out Date");
   theForm2.hotel_chkout_date.focus();
    return false;
   }
}


function validation_CARForm(theForm3)
{

 if(theForm3.B_LOCATION.value=="")
   {
    alert("Please Enter Pickup City");
	theForm3.B_LOCATION.focus();
	 return false;
  }
   if(theForm3.car_pickup_date.value=="")
 	{
   alert("Please Enter Car Pickup Date");
   theForm3.car_pickup_date.focus();
    return false;
   }
   
   if(theForm3.car_dropoff_date.value=="")
 	{
   alert("Please Enter Droff Date");
   theForm3.car_dropoff_date.focus();
    return false;
   }
} 
