// JavaScript Document
function showPrat2(){
	$('part2').style.visibility = 'visible'
	$('part2').style.position = 'relative'
}
function hidePrat2(){
	$('part2').style.visibility = 'hidden'
	$('part2').style.position = 'absolute'
}
function showComment(){
	$('comment').style.visibility = 'visible'
	$('comment').style.position = 'relative'
}
function hideComment(){
	$('comment').style.visibility = 'hidden'
	$('comment').style.position = 'absolute'
}
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_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=="其它"){
		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=="其它"){
		other_occupation_type();
	}else{
		other_occupation_type1();
	}
}

function drawTimeSelection(sName){ // option name  ' + oName + '
	document.write('<select name="' + sName +'">');
	document.write('<option value="">请选择</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="">请选择</option>');
	
	var rooms = new Array('员工房','单人房','双人房', '套房');
	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)
{
	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;
}