function chkRW(thisForm){

	if( thisForm.date.value == "" ){
		alert("Please enter Date / Month / Year.");
		thisForm.date.focus();
		return false;
	}
	var pc_sum=0,pc1=0,pc2=0,pc3=0,pc4=0,pc5=0,pc6=0,pc7=0,pc8=0,pc9=0;

	if(thisForm.Livehardcoral.value!="")			pc1 =  parseInt(thisForm.Livehardcoral.value);
	if(thisForm.Deadcoralrubble.value!="")	pc2 =  parseInt(thisForm.Deadcoralrubble.value);
	if(thisForm.deadhardcoral.value!="")		pc3 =  parseInt(thisForm.deadhardcoral.value);
	if(thisForm.Softcoral.value!="")				pc4 =  parseInt(thisForm.Softcoral.value);
	if(thisForm.Seafan.value!="")					pc5 =  parseInt(thisForm.Seafan.value);
	if(thisForm.Fleshyalgae.value!="")			pc6 =  parseInt(thisForm.Fleshyalgae.value);
	if(thisForm.other.value!="")					pc7 =  parseInt(thisForm.other.value);	
	if(thisForm.sandfloor.value!="")				pc8 =  parseInt(thisForm.sandfloor.value);
	if(thisForm.rockfloor.value!="")				pc9 =  parseInt(thisForm.rockfloor.value);

	pc_sum = pc1+pc2+pc3+pc4+pc5+pc6+pc7+pc8+pc9;

	if(pc_sum!=100 && ( thisForm.Livehardcoral.value!="" 
								||  thisForm.deadhardcoral.value!=""  
								||  thisForm.Deadcoralrubble.value!=""  
								||  thisForm.Softcoral.value!="" 
								||  thisForm.Seafan.value!=""  
								||  thisForm.Fleshyalgae.value!=""  
								||  thisForm.other.value!=""  
								||  thisForm.sandfloor.value!=""  
								||  thisForm.rockfloor.value!="" 
		)){
		alert("Please enter Percentage cover all for 100%");
		thisForm.Livehardcoral.focus();
		return false;
	}


	if( thisForm.reporter.value == "" ){
		alert("Please enter Reporter.");
		thisForm.reporter.focus();
		return false;
	}

/*
	else if( thisForm.Email.value == "" ){
		alert("Please enter E-mail Address .");
		thisForm.Email.focus();
		return false;
	}
*/

	return true;
}

function doSection(secNum) {	

 	if (secNum.style.display == "none") {
		secNum.style.display = "";
	}else{
		secNum.style.display = "none";
	}	
}

function showReport(thisForm){
	thisForm.isEmail.value = "1";
	thisForm.submit();
}


function showExcel(thisForm){
	thisForm.isExcel.value = "1";
	thisForm.submit();
}

function confirmDelete(thisForm){

	count=0;
	for (i=0; i< thisForm.elements.length; i++){
		 if(thisForm.elements[i].type == "checkbox")
			 if( thisForm.elements[i].checked)
				count++;
	}
if(thisForm.mainChk.checked) count--;
	if(count==0) {
		alert("â»Ã´àÅ×Í¡¢éÍÁÙÅ·ÕèµéÍ§¡ÒÃÅº");
		return false;
	}

	if (confirm("¤Ø³Â×¹ÂÑ¹¨ÐÅº¢éÍÁÙÅ·ÕèàÅ×Í¡ ?"))
		return true ;
	else
		return false ;
}

function NumOnly() {
	if (event.keyCode>47 && event.keyCode<58)
		event.returnValue = true;
	else
		event.returnValue = false;
}
function DecOnly() {
	if ((event.keyCode>47 && event.keyCode<58)||event.keyCode==46)
		event.returnValue = true;
	else
		event.returnValue = false;
}

function checkAll(has_checked, thisForm){

	for (i=0; i< thisForm.elements.length; i++){
		 if(thisForm.elements[i].type == "checkbox")
			 thisForm.elements[i].checked = has_checked;
	}

}



function isInteger(s){
	var i;
	if (s.charAt(0) == "-") {
		j = 1;
	} else {
		j = 0;
	}
    for (i = j; i < s.length; i++){
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}



function checkElement(form1, elementType){
		for(i=0;i<form1.elements.length;i++){
			 if(form1.elements[i].type == elementType)  alert(i);
		}
		return false;
}