function SearchFormValidate(FormType,SearchType)
{
var VFormType = FormType;
var VSearchType = SearchType;
//alert('SearchFormValidate Started'); // remember to remove this #################################################################################################
	switch(FormType)
	{
	
	case '1':
		switch(SearchType)
			{
			
			case 'main':  // check for:  departure, departdate, depart_time, destination, returndate
			case 'advanced':
			var error ="";

			error += CheckDeparture(document.getElementById('segDepartCity0').value);      // must exist ; test only 
		    error += CheckDepartDate(document.getElementById('flightdepart').value);    // must exist ; must be > returndate
			error += CheckDepartTime(document.getElementById('segDepartTime0').value);   // must exist ; 
			error += CheckDestination(document.getElementById('segArriveCity0').value);  // must exist ; text only ; != departure
			error += CheckReturnDate(document.getElementById('flightreturn').value);    // must exist ; must be > departdate
			error += CheckDestTime(document.getElementById('segDepartTime0').value);       // must exist ;
			
			//Check other form elements
			error += CheckFormElemts();
			
			
			if (error != "")
				{
				alert(error);
				return false;
				}

			TravelSearchValidate(VFormType,VSearchType);
			HideForms()
			progress_update(); 
			//hideform(document.FlightSearchForm);
			document.FlightSearchForm.submit();
			
			break;
			
			
			
			case 'multiple':
			var error ="";
			// error += CheckDepartDate(s.departdate1.value);      must exist ; 
			error += CheckDeparture(document.getElementById('departure1').value);      // must exist ; 

				if (error != "")
					{
					alert(error);
					return false;
					}
			TravelSearchValidate(VFormType,VSearchType);
			progress_update(); 
			hideform(document.FlightSearchForm);
			document.FlightSearchForm.submit();
			
			
			break;
			
			case 'oneway':
			var error ="";
			error += CheckDeparture(document.getElementById('departure').value);      // must exist ; test only 
			error += CheckDepartDate(document.getElementById('departdate').value);    // must exist ; must be > returndate
		
				if (error != "")
					{
					alert(error);
					return false;
					}
			TravelSearchValidate(VFormType,VSearchType);
			progress_update(); 
			hideform(document.FlightSearchForm);
			document.FlightSearchForm.submit();
			
			
			
			break;
			
			default:
			var error ="";
			error += CheckDeparture(document.getElementById('departure').value);      // must exist ; test only 
			error += CheckDepartDate(document.getElementById('departdate').value);    // must exist ; must be > returndate
			error += CheckDepartTime(document.getElementById('depart_time').value);   // must exist ; 
			error += CheckDestination(document.getElementById('destination').value);  // must exist ; text only ; != departure
			error += CheckReturnDate(document.getElementById('returndate').value);    // must exist ; must be > departdate
			error += CheckDestTime(document.getElementById('dest_time').value);       // must exist ;
		
				if (error != "")
					{
					alert(error);
					return false;
					}
			TravelSearchValidate(VFormType,VSearchType);
			progress_update(); 
			hideform(document.FlightSearchForm);
			document.FlightSearchForm.submit();
			
			
			}
	
	
	
	break;
	
	
	case '2':
		switch(SearchType)
		{
		
		case 'main':
		case 'advanced':
		default:
		var error ="";
			error += CheckPickUpDate(document.getElementById('carpickupdate').value);      // must exist ; test only 
			error += CheckDropOffDate(document.getElementById('cardropoffdate').value);    // must exist ; must be > returndate
		
				if (error != "")
					{
					alert(error);
					return false;
					}
			TravelSearchValidate(VFormType,VSearchType);
			progress_update(); 
			hideform(document.CarSearchForm);
			document.CarSearchForm.submit();
	
		
		}
	
	
	
	
	break;
	
	
	case '3':
		switch(SearchType)
		{
		
		case 'main':
		case 'advanced':
		default:
		var error ="";			
			error += CheckInDate(document.getElementById('hotelcheckin').value);      // must exist ; test only 
			error += CheckOutDate(document.getElementById('hotelcheckout').value);    // must exist ; must be > returndate
		
				if (error != "")
					{
					alert(error);
					return false;
					}
			TravelSearchValidate(VFormType,VSearchType);
			progress_update(); 
			hideform(document.HotelSearchForm);
			document.HotelSearchForm.submit();
		
		}
	
	
	
	break;
	
	
	case '4':

		//var error ="";
		//	error += CheckCruiseDate1(document.getElementById('cruisedate1').value);      // must exist ; test only 
		//	error += CheckCruiseDate2(document.getElementById('cruisedate2').value);      // must exist ; test only 
		
		//		if (error != "")
		//			{
		//			alert(error);
		//			return false;
		//			}
		//	TravelSearchValidate(VFormType,VSearchType);
			progress_update(); 
			hideform(document.CruiseSearchForm);
			document.CruiseSearchForm.submit();
		
		break;
	
	case 'Vacations':
		switch(SearchType)
		{
		
		case 'main':
		case 'advanced':
		default:
		var error ="";
			error += CheckDeparture(document.getElementById('departure').value);      // must exist ; test only 
			error += CheckDepartDate(document.getElementById('departdate').value);    // must exist ; must be > returndate
			error += CheckReturnDate(document.getElementById('returndate').value);    // must exist ; must be > departdat
				if (error != "")
					{
					alert(error);
					return false;
					}
			TravelSearchValidate(VFormType,VSearchType);
			progress_update(); 
			hideform(document.VacationSearchForm);
			document.VacationSearchForm.submit();
		
		
		}
	
	
	
	break;
	
	
	case 'Packages':
		switch($SearchType)
		{
		
		case 'Main':
		
		
		break;
		
		case 'Advanced':
		
		
		break;
		
		default:
		
		
		}

	
	
	break;
	
	default:
	
	
	
	
	}
	}


//Validate the ITA Form Elements - Home Page
function CheckFormElemts() {
	var pass = "";
	var numChildren = document.getElementById('children').value;
	switch (numChildren) {
		case "1":
		if (document.getElementById('childrenAges0').value=="") {
			pass = "Need the age of the first child\n";	
		}
		break;
		
		case "2":
		if (document.getElementById('childrenAges0').value=="") {
			pass = "Need the age of the first child\n";	
		}
		if (document.getElementById('childrenAges1').value=="") {
			pass += "Need the age of the second child\n";	
		}		
		break;
		
		case "3":
		if (document.getElementById('childrenAges0').value=="") {
			pass = "Need the age of the first child\n";	
		}
		if (document.getElementById('childrenAges1').value=="") {
			pass += "Need the age of the second child\n";	
		}
		if (document.getElementById('childrenAges2').value=="") {
			pass += "Need the age of the third child\n";	
		}				
		break;
		
		case "4":
		if (document.getElementById('childrenAges0').value=="") {
			pass = "Need the age of the first child\n";	
		}
		if (document.getElementById('childrenAges1').value=="") {
			pass += "Need the age of the second child\n";	
		}
		if (document.getElementById('childrenAges2').value=="") {
			pass += "Need the age of the third child\n";	
		}
		if (document.getElementById('childrenAges3').value=="") {
			pass += "Need the age of the fourth child\n";	
		}						
		break;
		
		case "5":
		if (document.getElementById('childrenAges0').value=="") {
			pass = "Need the age of the first child\n";	
		}
		if (document.getElementById('childrenAges1').value=="") {
			pass += "Need the age of the second child\n";	
		}
		if (document.getElementById('childrenAges2').value=="") {
			pass += "Need the age of the third child\n";	
		}
		if (document.getElementById('childrenAges3').value=="") {
			pass += "Need the age of the fourth child\n";	
		}	
		if (document.getElementById('childrenAges4').value=="") {
			pass += "Need the age of the fifth child\n";	
		}							
		break;								
	}

	return pass;
}


// Hotel validation functions ##############################################################################


function CheckInDate(param)
{
//ds = document.SearchForm ;

var pass = "";
if (param == "")
	{
	pass = "Please make sure there is a check in date\n";
	}
//if (param >= hotelcheckout.value)
	//{
	//pass = "The check in date must be before the return date\n";
	//}
	return pass;
}

function CheckOutDate(param)
{
//ds = document.SearchForm ;

var pass = "";
if (param == "")
	{
	pass = "Please make sure there is a check out date\n";
	}
	return pass;
}




// Flight validation functions ##############################################################################


	
function CheckDepartDate(param)
{
//ds = document.SearchForm ;

var pass = "";
if (param == "")
	{
	
	return "Please make sure there is a departure date\n";
	}
	var month = 0;
	var day = 0;
	var year = 0;
	var one_day = 1000*60*60*24  //Number of milliseconds in one day
	var index = param.indexOf("/");
	if (index >0) {
		var departdatevalue = param.split("/")
	} else {
		var index = param.indexOf("-");
		if (index >0) {
			var departdatevalue = param.split("-")
		} else {
			return "Please Enter a valid date: mm/dd/yyyy\n";
		}
	}	

	month = departdatevalue[0] - 1;
	day = departdatevalue[1] - 0;
	year = departdatevalue[2];
	//added to account for 2 digit year abbreviation	
	if (year.length == 2) {
		year = "20" + year;
	}	
	if (year.length != 4) {
		return "Please Enter a valid date: mm/dd/yyyy\n";
	}
	var dep_date = new Date(year,month,day);
	
	var advance_purchase=new Date();
	advance_purchase = new Date(advance_purchase.getTime() + 2 * one_day);
	datediff = Math.ceil((dep_date.getTime() - advance_purchase)/(one_day))

	if (datediff <0) {
		return "Advance Purchase Error!\nNeed at least 48 Hours Advance Purchase\n";
	}
	return "";
}
	
function CheckDeparture(param)
{
//ds = document.SearchForm ;


var pass = "";
if (param == "")
	{
	pass = "Please make sure you entered a departure location\n";
	}
		return pass;
}

function CheckDepartTime(param)
{
//ds = document.SearchForm ;

var pass = "";
if (param == "")
	{
	pass = "Please make sure there is a departure time\n";
	}
		return pass;
}

function CheckDestTime(param)
{
//ds = document.SearchForm ;

var pass = "";
if (param == "")
	{
	pass = "Please make sure there is a arrival time.\n";
	}
		return pass;
}

function CheckDestination(param)
{
//ds = document.SearchForm ;

var pass = "";
if (param == "")
	{
	pass = "Please make sure there is a destination chosen\n";
	}
		return pass;
}


function CheckReturnDate(param)
{
//ds = document.SearchForm ;

var pass = "";
if (param == "")
	{
	pass = "Please make sure there is a return date\n";
	}
		return pass;
}

function CheckDepartDateM(param)
{
//ds = document.SearchForm ;

var pass = "";
if (param == "")
	{
	pass = "Please make sure there is a departure date\n";
	}
//if (param >= returndate1.value)
//	{
//	pass = "The departure date must be before the return date\n";
//	}
		return pass;
}


// CAR validation functions ##############################################################################




	function CheckPickUpDate(param)
			{
			//ds = document.SearchForm ;
			
				var pass = "";
				if (param == "")
					{
					pass = "Please make sure there is a pick up date.\n";
					}
			//	if (param > cardropoffdate.value)
			//		{
			//		pass = "The pick up date must be before the return date\n";
			//		}

					return pass;
			}

	function CheckDropOffDate(param)
			{
			//ds = document.SearchForm ;
			
					var pass = "";
					if (param == "")
						{
						pass = "Please make sure there is a drop off date\n";
						}
						return pass;
			}





// Edit the Date Fields      ##############################################################################




	
function TravelSearchValidate(TravelFormType,SearchType)
{
	switch(TravelFormType)
		{
		
		case "1":
			switch(SearchType)
				{
				
				case "oneway":
					
					//alert('One Way Flight Search');
					var departdatevalue = document.getElementById('departdate').value.split("/")
					document.getElementById('depart_day').value = departdatevalue[1]
					document.getElementById('depart_month').value = departdatevalue[0]
					document.getElementById('depart_year').value = departdatevalue[2]
				break;
				
				
				case "roundtrip":
				case "advanced":

					var returndatevalue = document.getElementById('flightreturn').value.split("/")
					var departdatevalue = document.getElementById('flightdepart').value.split("/")
										
					document.getElementById('segDepartDay0').value = departdatevalue[1]
					document.getElementById('segDepartMonth0').value = departdatevalue[0]
					document.getElementById('segDepartYear0').value = departdatevalue[2]
					document.getElementById('segDepartDay1').value = returndatevalue[1]
					document.getElementById('segDepartMonth1').value = returndatevalue[0]
					document.getElementById('segDepartYear1').value = returndatevalue[2]
					document.getElementById('dummyDay').value = returndatevalue[1]
					document.getElementById('dummyMonth').value = returndatevalue[0]
					document.getElementById('dummyYear').value = returndatevalue[2]					
					
					
					
				break;
				
				case "mutliple":
						//var departdatevalue1 = d.departdate1.value.split("/")
						var departdatevalue2 = document.getElementById('departdate2').value.split("/")
						var departdatevalue3 = document.getElementById('departdate3').value.split("/")
						var departdatevalue4 = document.getElementById('departdate4').value.split("/")
			
				
				
					//alert('Multiple City Flight Search');
					document.getElementById('depart_day1').value = departdatevalue[1]
					document.getElementById('depart_month1').value = departdatevalue[0]
					document.getElementById('depart_year1').value = departdatevalue[2]
					
					
					document.getElementById('depart_day2').value = departdatevalue2[1]
					document.getElementById('depart_month2').value = departdatevalue2[0]
					document.getElementById('depart_year2').value = departdatevalue2[2]
					
					
					document.getElementById('depart_day3').value = departdatevalue3[1]
					document.getElementById('depart_month3').value = departdatevalue3[0]
					document.getElementById('depart_year3').value = departdatevalue3[2]
					
					
					document.getElementById('depart_day4').value = departdatevalue4[1]
					document.getElementById('depart_month4').value = departdatevalue4[0]
					document.getElementById('depart_year4').value = departdatevalue4[2]
					
				break
				
				
				default:
					var returndatevalue = document.getElementById('returndate').value.split("/")
					//alert('Roundtrip or Advanced Flight Search');
					document.getElementById('depart_day').value = departdatevalue[1]
					document.getElementById('depart_month').value = departdatevalue[0]
					document.getElementById('depart_year').value = departdatevalue[2]
					document.getElementById('dest_day').value = returndatevalue[1]
					document.getElementById('dest_month').value = returndatevalue[0]
					document.getElementById('dest_year').value = returndatevalue[2]
					
				break
			
				}
		
		break
		
		case "2":
			//d = document.CarSearchForm
			
			var carpickupdate = document.getElementById('carpickupdate').value.split("/")
			var cardropoffdate = document.getElementById('cardropoffdate').value.split("/")
			//alert('Rental Car Search');
			document.getElementById('pickup_day').value = carpickupdate[1]
			document.getElementById('pickup_month').value = carpickupdate[0]
			document.getElementById('pickup_year').value = carpickupdate[2]
			document.getElementById('return_day').value = cardropoffdate[1]
			document.getElementById('return_month').value = cardropoffdate[0]
			document.getElementById('return_year').value = cardropoffdate[2]
		
		break
		
		case "3":
			//var d = document.HotelSearchForm

			var hotelcheckindate = document.getElementById('hotelcheckin').value.split("/")
			var hotelcheckoutdate = document.getElementById('hotelcheckout').value.split("/")
			//alert('Hotel Car Search');
			document.getElementById('checkin_day').value = hotelcheckindate[1]
			document.getElementById('checkin_month').value = hotelcheckindate[0]
			document.getElementById('checkin_year').value = hotelcheckindate[2]
			document.getElementById('checkout_day').value = hotelcheckoutdate[1]
			document.getElementById('checkout_month').value = hotelcheckoutdate[0]
			document.getElementById('checkout_year').value = hotelcheckoutdate[2]
		break
		
		case "4":
			
			//var d = document.CruiseSearchForm
			
			var cruisedate1 = document.getElementById('cruisedate1').value.split("/")
			var cruisedate2 = document.getElementById('cruisedate2').value.value.split("/")
			
			document.getElementById('cruise_day').value = cruisedate1[1]
			document.getElementById('cruise_month').value = cruisedate1[0]
			document.getElementById('cruise_year').value = cruisedate1[2]
			document.getElementById('cruise_day2').value = cruisedate2[1]
			document.getElementById('cruise_month2').value = cruisedate2[0]
			document.getElementById('cruise_year2').value = cruisedate2[2]
			//alert ('the cruise dates are ' + cruisedate1 + ' and ' + cruisedate2 );
		break
		
		case "5":
		//var d = document.SearchForm
		var returndatevalue = document.getElementById('returndate').value.split("/")
		var departdatevalue = document.getElementById('departdate').value.split("/")
		//alert('Roundtrip or Advanced Flight Search');
					document.getElementById('depart_day').value = departdatevalue[1]
					document.getElementById('depart_month').value = departdatevalue[0]
					document.getElementById('depart_year').value = departdatevalue[2]
					document.getElementById('dest_day').value = returndatevalue[1]
					document.getElementById('dest_month').value = returndatevalue[0]
					document.getElementById('dest_year').value = returndatevalue[2]
		break
		
		default:
		
		
		break
		
		}
		
}
	
	

function showChildren() {
  numberOfChildren = document.FlightSearchForm.children.selectedIndex;
  if (!numberOfChildren) {
    hideDiv('childrenSelects');
    return;
  }
  showDiv('childrenSelects');
  
  for (i=0; i <= 4; i++) {
    if (i < numberOfChildren) {
      showSpan('childrenPulldown' + i );
    }
    else {
      hideDiv('childrenPulldown' + i );
    }
  }
}

/* $Id: //release/php/www/js/div_magic.js#3 $ */

/**
 * showDiv
 *
 * show the specified div
 */
function showDiv(divNameToShow)
{
  if (document.getElementById) {
    /**
     * DOM3 = IE5, NS6
     */
    document.getElementById(divNameToShow).style.visibility = 'visible';
    document.getElementById(divNameToShow).style.display    = 'block';
  }
  else {
    if (document.layers) {
      /**
       * NS4
       */
      eval('document.' + divNameToShow + '.visibility="visible"');
      eval('document.' + divNameToShow + '.display="block"');
    }
    else {
      /**
       * IE4
       */
      eval('document.all.' + divNameToShow + '.style.visibility="visible"');
      eval('document.all.' + divNameToShow + '.style.display="block"');
    }
  }
}

/**
 * showDiv
 *
 * show the specified div
 */
function showSpan(spanNameToShow)
{
  if (document.getElementById) {
    /**
     * DOM3 = IE5, NS6
     */
    document.getElementById(spanNameToShow).style.visibility = 'visible';
    document.getElementById(spanNameToShow).style.display    = 'inline';
  }
  else {
    if (document.layers) {
      /**
       * NS4
       */
      eval('document.' + spanNameToShow + '.visibility="visible"');
      eval('document.' + spanNameToShow + '.display="inline"');
    }
    else {
      /**
       * IE4
       */
      eval('document.all.' + spanNameToShow + '.style.visibility="visible"');
      eval('document.all.' + spanNameToShow + '.style.display="inline"');
    }
  }
}


/**
 * hideDiv
 *
 * show the specified div
 */
function hideDiv(divNameToShow,doNotCollapse)
{
  if (doNotCollapse) {
    disp = 'block';
  }
  else {
    disp = 'none';
  }

  if (document.getElementById) {
    /**
     * DOM3 = IE5, NS6
     */
    document.getElementById(divNameToShow).style.visibility = 'hidden';
    document.getElementById(divNameToShow).style.display    = disp;
  }
  else {
    if (document.layers) {
      /**
       * NS4
       */
      eval('document.' + divNameToShow + '.visibility="hidden"');
      eval('document.' + divNameToShow + '.display="' + disp + '"');
    }
    else {
      /**
       * IE4
       */
      eval('document.all.' + divNameToShow + '.style.visibility="hidden"');
      eval('document.all.' + divNameToShow + '.style.display="' + disp + '"');
    }
  }
}


/**
 * unhideDiv
 *
 * Shows the first parameter, and hides the following params
 * Thanks to Jeraimee <asleep@asleep.net>, with some modifications
 */
function unhideDiv(divNameToShow)
{
  if (document.getElementById) {
    /**
     * DOM3 = IE5, NS6
     */

    /**
     * Show the requested div
     */
    document.getElementById(divNameToShow).style.visibility = 'visible';
    document.getElementById(divNameToShow).style.display    = 'block';

    /**
     * Hide the rest of the divs
     * Start at 1 because 0 is for the divNameToShow
     */
    for (id = 1; id < unhideDiv.arguments.length; id++) {
      if (unhideDiv.arguments[id] != divNameToShow) {
        document.getElementById(unhideDiv.arguments[id]).style.visibility = 'hidden';
        document.getElementById(unhideDiv.arguments[id]).style.display    = 'none';
      }
    }
  }
  else {
    if (document.layers) {
      /**
       * NS4
       */
      eval('document.' + divNameToShow + '.visibility="visible"');
      eval('document.' + divNameToShow + '.display="block"');
      /**
       * Hide the rest of the divs
       * Start at 2 because 0 is for the function name and 1 for the divNameToShow
       */
      for (id = 2; id < unhideDiv.arguments.length; id++) {
        if (unhideDiv.arguments[id] != divNameToShow) {
          eval('document.' + unhideDiv.arguments[id] + '.visibility="hidden"');
          eval('document.' + unhideDiv.arguments[id] + '.display="none"');
        }
      }
    }
    else {
      /**
       * IE4
       */
      eval('document.all.' + divNameToShow + '.style.visibility="visible"');
      eval('document.all.' + divNameToShow + '.style.display="block"');
      /**
       * Hide the rest of the divs
       * Start at 1 because 0 is for the divNameToShow
       */
      for (id = 1; id < unhideDiv.arguments.length; id++) {
        if (unhideDiv.arguments[id] != divNameToShow) {
          eval('document.all.' + unhideDiv.arguments[id] + '.style.visibility="hidden"');
          eval('document.all.' + unhideDiv.arguments[id] + '.style.display="none"');
        }
      }
    }
  }
}

/**
 * switchVisibility
 *
 * Swaps the visibility of the specified DIV/LAYER.
 */
function switchVisibility(id)
{
  var state;
  if (document.getElementById) { // DOM3 = IE5, NS6
    state = document.getElementById(id).style.visibility;

    if (state == 'visible') {
      hideDiv(id);
    }
    else {
      showDiv(id);
    }
  }
  else {
    if (document.layers) { // NS4
      eval('state = document.' + id + '.visibility');
    }
    else { // IE4
      eval('state = document.all.' + id + '.style.visibility');
    }
    if (state == "visible") {
      hideDiv(id);
    }
    else {
      showDiv(id);
    }
  }
}


/**
 * moveDiv
 *
 * Move the div to the specified x and y
 */
function moveDiv(divId,x,y)
{
  if (document.getElementById && document.getElementById(divId)) {
    divObj = document.getElementById(divId);

    // x is defined
    if (!isNaN(x)) {

      if (!isNaN(divObj.style.left)) {
        divObj.style.left = x;
      }
      else if (!isNaN(divObj.style.pixelLeft)) {
        divObj.style.pixelLeft = x;
      }
      else if (!isNaN(divObj.left)) {
        divObj.left = x;
      }
    }

    // y is defined
    if (!isNaN(y)) {
      if (!isNaN(divObj.style.top)) {
        divObj.style.top = y;
      }
      else if (!isNaN(divObj.style.pixelTop)) {
        divObj.style.pixelTop = y;
      }
      else if (!isNaN(divObj.top)) {
        divObj.top = y;
      }
    }
  }
  else if (document.layers) {
    eval('document.' + id + '.left = ' + x);
    eval('document.' + id + '.top = ' + y);
  }
  else if (document.all) {
    eval('document.all.' + id + '.style.left = ' + x);
    eval('document.all.' + id + '.style.top  = ' + x);
  }
}


/**
 * moveDivToCenter
 *
 * Moves a div to the center of the screen
 */
function moveDivToCenter(id,itemH,itemW)
{
  height  = getBrowserHeight();
  width   = getBrowserWidth();

  if (height <= 0 || width <= 0) {
    return;
  }

  centerH = Math.floor((height-itemH) / 2);
  centerW = Math.floor((width-itemW)  / 2);

  moveDiv(id,centerW,centerH)
}

function getBrowserHeight()
{
  if (typeof(window.innerHeight) == 'number') {
    return window.innerHeight;
  }

  if (document.documentElement && document.documentElement.clientHeight) {
    //IE 6+ in 'standards compliant mode'
    return document.documentElement.clientHeight;
  }

  if (document.body && document.body.clientHeight) {
    //IE 4 compatible
    return document.body.clientHeight;
  }

  return 0;
}

function getBrowserWidth()
{
  if (typeof( window.innerWidth ) == 'number') {
    //Non-IE
    return window.innerWidth;
  }

  if (document.documentElement && document.documentElement.clientWidth) {
    //IE 6+ in 'standards compliant mode'
    return document.documentElement.clientWidth;
  }

  if (document.body && document.body.clientWidth) {
    //IE 4 compatible
    return document.body.clientWidth;
  }

  return 0;
}


function HideForms()
{
  if (document.all) {
    num_forms = document.forms.length;
    for (nf=0;nf<num_forms;nf++) {
      form_name=document.forms[nf].name;
      num_items=document.forms[nf].length;
      for (ni=0;ni<num_items;ni++) {
        fit=document.forms[nf].elements[ni].type;
        fit_string = fit.toString();
        if (fit_string == 'select-one' || fit_string == 'select-multiple') {
          document.forms[nf].elements[ni].style.visibility='hidden';
        }
      }
    }
  }
}
