<!--
function CheckInput( objForm )
{
	if(objForm)
		objForm = document.all["frmMain"];
	
	if ( objForm )
	{
		var strPatn = objForm.txtPATN.value.trim();
		
		var numPattern = /([^0-9])/;
	    numPattern = strPatn.match(numPattern);

		if ( isWhitespace(strPatn) ){
			alert("You must input patent numbers to find.");
			objForm.txtPATN.focus();
		}		
//		else if(numPattern != null){
//			alert("Please number only.");
//			objForm.txtPATN.focus();
//		}
		else
		{			
			if ( objForm.rdoDATE[0].checked )
				objForm.txtDateCond.value = "APD";
			else if ( objForm.rdoDATE[1].checked )
			{
				if ( objForm.txtDATE.value == "" || objForm.txtDATE.value == "MM/DD/YYYY" )
				{
					alert("The date condition you entered is empty.");
					objForm.txtDATE.focus();
					return;
				}
				else
					objForm.txtDateValue.value = CheckInputDate(objForm.txtDATE.value);
					if ( objForm.txtDateValue.value == "" )
					{
						alert("The date value is not correct.\nPlease enter the condition as the following format specified. (MM/DD/YYYY) \n\n ex) 01/30/2007");
						objForm.txtDate.focus();
						return;
					}
					//objForm.txtDateValue.value = objForm.txtDATE.value;
					
				objForm.txtDateCond.value = "USERINPUT";
			}

			if ( !SetValue(objForm) )
				return false;
				
			return true;
		}
	}
	
	return false;
}

function CheckInputJJ()
{
	var objForm = document.all["frmMain"];
	
	if ( objForm )
	{
		var strPatn = objForm.txtPATN.value;
		
//		var numPattern = /([^0-9])/;
//	    numPattern = strPatn.match(numPattern);
		
//		if(numPattern != null){
//			alert("Please number only.");
//			return;
//		}
		if ( strPatn == "" )
		{
			alert("You must input patent numbers to find.");
			objForm.txtPATN.focus();
		}
		else
		{
			//top.OUTPUT_UP.href = "/blank.htm";
//			top.OUTPUT_DN.href = "/blank.htm";
//			objForm.txtDATE.value = objForm.selYEAR.value + objForm.selMONTH.value + objForm.selDAY.value;
			
			if ( objForm.rdoDATE[0].checked )
				objForm.txtDateCond.value = "APD";
			else if ( objForm.rdoDATE[1].checked )
			{
				if ( objForm.txtDATE.value == "" || objForm.txtDATE.value == "MM/DD/YYYY" )
				{
					alert("The date condition you entered is empty.");
					objForm.txtDATE.focus();
					return;
				}
				else
					objForm.txtDateValue.value = CheckInputDate(objForm.txtDATE.value);
					if ( objForm.txtDateValue.value == "" )
					{
						alert("The date value is not correct.\nPlease enter the condition as the following format specified. (MM/DD/YYYY) \n\n ex) 01/30/2007");
						objForm.txtDate.focus();
						return;
					}
					//objForm.txtDateValue.value = objForm.txtDATE.value;
					
//					if ( objForm.txtDateValue.value == "" )
//					{
//						alert("The date value is not correct.\nPlease enter the condition as the following format specified. (MM/DD/YYYY) \n\n ex) 01/30/2007");
//						return;
//					}
				objForm.txtDateCond.value = "USERINPUT";
			}

			if ( !SetValue(objForm) )
				return false;
				
			objForm.submit();
		}
	}
}

function SetValue(objForm)
{
	var DataToSend = "";
	var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	var strPriorServer = "/PriorArts/SetValue.asp";
	
	try {
		DataToSend  = "PATN=" + objForm.txtPATN.value;
		DataToSend += "&DATECOND=" + objForm.txtDateCond.value;
		DataToSend += "&DATE=" + objForm.txtDateValue.value;
		DataToSend += "&ACTION=SEARCH";

		xmlhttp.open("POST", strPriorServer, false);
		xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlhttp.send(DataToSend);

//			alert(xmlhttp.responseText + "//" + xmlhttp.responseXML.parseError.reason);
		if ( xmlhttp.readyState != 4 ) // ready
		{	
			alert("Cannot proceed this process.");
			return false;
		}
		else
		{
//			alert(xmlhttp.responseText + "//" + xmlhttp.responseXML.parseError.reason);
		}
		
	} catch (e) {}
			
	return true;

}


function CheckInputDate(strDate)
{
	var arrValue;
	var sDay, sMonth, sYear;
	var nDay, nMonth, nYear;
	var sReturn;
	
	sReturn = "";
	strDate = strDate.replace(" ", "");
	arrValue = strDate.split("/");
	
	if ( arrValue && arrValue.length == 3 )
	{
		sMonth = arrValue[0];
		sDay   = arrValue[1];
		sYear  = arrValue[2];
		
		if ( CheckEmptyValue(sMonth) )
			nMonth = parseInt(sMonth, 10);
		else
			return sReturn;
			
		if ( CheckEmptyValue(sDay) )
			nDay = parseInt(sDay, 10);
		else
			return sReturn;
			
		if ( CheckEmptyValue(sYear) )
			nYear = parseInt(sYear, 10);
		else
			return sReturn;
		
		if  ( nMonth < 1 || nMonth > 12 )
			return sReturn;
		
		if ( nDay < 1 || nDay > 31 )
			return sReturn;

		if ( nYear <= 1900 )
			return sReturn;

		sReturn = nYear;
		if ( nMonth < 10 )
			sReturn += "0" + nMonth;
		else
			sReturn += nMonth;
		
		if ( nDay < 10 )
			sReturn += "0" + nDay;
		else
			sReturn += nDay;		
	}		
	return sReturn;
}

function CheckEmptyValue(strValue)
{
	var strTmp = strValue.replace(" ", "");
	if ( strTmp.length == 0 )
		return false;
	else 
		return true;
}

function SetStatus()
{
	var objForm = document.all["frmMain"];
	if ( objForm)
	{
		if ( objForm.rdoDATE[0].checked )
		{
			objForm.txtDATE.disabled = true;
			if ( objForm.txtDATE.value == "")
				objForm.txtDATE.value = "MM/DD/YYYY";
		}
		else
		{
			objForm.txtDATE.disabled = false;
			if ( objForm.txtDATE.value == "MM/DD/YYYY" )
				objForm.txtDATE.value = "";
			objForm.txtDATE.focus();
		}
	}
}

function InitPage()
{
	var objProcess = document.all["divProgress"];
	var objList = document.all["divList"];
	
	if ( objProcess )
	{
		objProcess.style.display = "none";
	}
	
	if ( objList )
		objList.style.display = "block";
}

function initPageSubmit() {
	document.body.style.cursor = "default";
	document.frmMain.submit();
}

function ViewFullText(strPN){
	var strFeature = "width=900,height=600,top=20,left=20,scrollbars=yes,toolbar=no,resizable=yes";
	var strAction = "/PriorArts/PriorArts_ViewFullText.asp?ACT=VIEW&PN=" + strPN;
	
	window.open ( strAction, "",  strFeature );
}

function Open_QuickBrowser(){
	var strFeature = "width=900,height=600,top=20,left=20,scrollbars=yes,toolbar=no,resizable=yes";
	
	window.open ( "", "WIN_PM_QB",  strFeature );
	var oForm = window.document.PM_QB;
	if(oForm) {
		oForm.target = "WIN_PM_QB";
		oForm.submit();
	}	
}
-->
