function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function show_row(status){
var PatentRows = document.getElementsByName("Patent_row");
var Patent_Info = document.getElementById("Patent_Info");
if(status == 'Y')
{
for(var i=0;i<PatentRows.length;i++) 
{
PatentRows[i].style.display = 'inline';
}
Patent_Info.style.display = 'inline';
} 
else
	{
for(var i=0;i<PatentRows.length;i++) {
  PatentRows[i].style.display = 'none';
}
Patent_Info.style.display = 'none';
}
}

function validate()
{
	if(check())
	{
		document.sub.submit();
		return true;
	}
	else
	{
		return false;
	}
	
	
}

function clearatt()
{

document.sub.attachmentName.value="";


}




function check()
{
	var maxlength=50;
	var maxlengthdescription=3000;
	if(document.sub.inventionName.value=="")
	{
	alert("Please fill in the Invention Name.");
	document.sub.inventionName.focus();
	return false;
	}

	else if(document.sub.inventionName.value.length > maxlength)
	{
	alert("The Invention Name field should not exceed 50 characters.");
	document.sub.inventionName.focus();
	return false;
	}
	  


	 else if(document.sub.description.value.length > maxlengthdescription)
	{
		alert("The Description should not exceed 3000 characters.");
		document.sub.description.focus();
		return false;
	}
	else if(!document.sub.checkbox.checked)
	{
		alert("Please accept the terms and conditions to proceed further.");
		return false;
	}

	else
	{
	document.getElementById("submitbtn").disabled=true;
	
	}

	return true;
}

