// JavaScript Document
function showPrat2(){
	$('part2').style.visibility = 'visible';
	$('part2').style.position = 'relative';
}
function hidePrat2(){
	$('part2').style.visibility = 'hidden';
	$('part2').style.position = 'absolute';
	
	$('de_yyyy1').value = "";
	$('de_time1').selectedIndex = "";
	$('de_attend1').value = "";
	$('de_type1').selectedIndex = "";
	$('de_meal1').selectedIndex = "";
	
	$('de_yyyy2').value = "";
	$('de_time2').selectedIndex = "";
	$('de_attend2').value = "";
	$('de_type2').selectedIndex = "";
	$('de_meal2').selectedIndex = "";
	
	$('de_yyyy3').value = "";
	$('de_time3').selectedIndex = "";
	$('de_attend3').value = "";
	$('de_type3').selectedIndex = "";
	$('de_meal3').selectedIndex = "";
	
	$('de_yyyy4').value = "";
	$('de_time4').selectedIndex = "";
	$('de_attend4').value = "";
	$('de_type4').selectedIndex = "";
	$('de_meal4').selectedIndex = "";
	
	$('de_yyyy5').value = "";
	$('de_time5').selectedIndex = "";
	$('de_attend5').value = "";
	$('de_type5').selectedIndex = "";
	$('de_meal5').selectedIndex = "";
}
function showComment(){
	$('comment').style.visibility = 'visible';
	$('comment').style.position = 'relative';
}
function hideComment(){
	$('comment').style.visibility = 'hidden';
	$('comment').style.position = 'absolute';
	
	$('checkin_yyyy1').value = "";
	$('checkout_yyyy1').value = "";
	$('room1').value = "";
	$('room_type1').selectedIndex = "";

	$('checkin_yyyy2').value = "";
	$('checkout_yyyy2').value = "";
	$('room2').value = "";
	$('room_type2').selectedIndex = "";
	
	$('checkin_yyyy3').value = "";
	$('checkout_yyyy3').value = "";
	$('room3').value = "";
	$('room_type3').selectedIndex = "";
	
	$('checkin_yyyy4').value = "";
	$('checkout_yyyy4').value = "";
	$('room4').value = "";
	$('room_type4').selectedIndex = "";
	
	$('checkin_yyyy5').value = "";
	$('checkout_yyyy5').value = "";
	$('room5').value = "";
	$('room_type5').selectedIndex = "";
}
function formReset(){
	$('proposal_form').reset();	
}
function other_industry_type(){
	if($('industry').options['other'].selected){
		$('other_industry').style.visibility = 'visible';	
		$('other_industry').style.position = 'absolute';	
	}
}
/*function other_industry_type(){
	if($('industry_type').options[14].value ){
		$('other_industries').style.visibility = 'visible'	
		$('other_industries').style.position = 'relative'
	}
}*/

function other_event_type(){
	if($('events').options['others'].selected ){
		$('other_events').style.visibility = 'visible';
		$('other_events').style.position = 'relative';	
	}
}
function other_events_type(){
$('other_events').style.visibility = 'visible';	
$('other_events').style.position = 'absolute';	
}
function other_events_type1(){
$('other_events').style.visibility = 'hidden';	
$('other_events').style.position = 'absolute';	
}
function check_event(){
	if ($('activity_type').value=="others"){
		other_events_type();
	}else{
		other_events_type1();
	}
}

function other_occupation_type(){
$('other_occupation').style.visibility = 'visible';	
$('other_occupation').style.position = 'absolute';	
}
function other_occupation_type1(){
$('other_occupation').style.visibility = 'hidden';	
$('other_occupation').style.position = 'absolute';	
}
function check_occupation(){
	if ($('occupation').value=="others"){
		other_occupation_type();
	}else{
		other_occupation_type1();
	}
}


function drawTimeSelection(sName){ // option name  ' + oName + '
	document.write('<select name="' + sName +'">');
	document.write('<option value="">Please Select</option>');
	for(var i=0; i<24; i++){
		if(i<10)
			document.write('<option value="0' + i + '00">0' + i + '00</option>');
		else
			document.write('<option value="' + i + '00">' + i + '00</option>');
	}//end for
	document.write('</select>');
}
function drawBedType(sName){ // option name
	document.write('<select name="' +sName+ '" style="width:164px;">');
	document.write('<option value="">Please select</option>');

	var rooms = new Array('Staff','Single','Double', 'Suite');
	for(var i=0; i<4; i++){
		document.write('<option value="' + rooms[i] + '">' + rooms[i] + '</option>');
	}//end for
	document.write('</select>');
}

function isValidEmail(strValue) {
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	return filter.test(strValue);
}

function IsString(strString)
//  check for valid numeric strings	
{
	var strValidChars = "0123456789";
	var strChar;
	var blnResult = true;
	
	if (strString.length == 0) return false;
	
	//  test strString consists of valid characters listed above
	for (i = 0; i < strString.length && blnResult == true; i++)
	{
	  strChar = strString.charAt(i);
	  if (strValidChars.indexOf(strChar) != -1)
	  {
		 blnResult = false;
	  }
	}
	return blnResult;
}

function IsDigit(strString)
//  check for valid numeric strings	
{
	var strValidChars = "0123456789";
	var strChar;
	var blnResult = true;
	
	if (strString.length == 0) return false;
	
	//  test strString consists of valid characters listed above
	for (i = 0; i < strString.length && blnResult == true; i++)
	{
	  strChar = strString.charAt(i);
	  if (strValidChars.indexOf(strChar) == -1)
	  {
		 blnResult = false;
	  }
	}
	return blnResult;
}