//'*****
//'** This function sends the selected project back to the page
//'** so the version and location boxes fill based off of the
//'** selected project

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function issue_search_project_change_caes(pDoc,thisCombo) {
	checkVal 		= ""; 
	stringVal 	= "";
	issueStatusVal	= ""; 
	chkIssueStatus	= ""; 

	ls_proj_code=replace_spaces(thisCombo.options[thisCombo.selectedIndex].value);
	txtDateFrom = pDoc.frmIssueSearch.txtDateFrom.value;
	txtDateTo = pDoc.frmIssueSearch.txtDateTo.value;
	txt_issue = pDoc.frmIssueSearch.txtIssueNum.value;
	
	
	xEmpty = "&cmbParent=&cmbVersion=&cmbLocation=&dealer_code=&cmbDealerContact=&cmbCaller_Name=&cmbKey_Type=&cmbReason=&cmbMachine_Type=&cmbOS_Version=&cmbSortBY=";

	for (var i=0;i<3;i++){
		if(pDoc.frmIssueSearch.chkIssueStatus[i].checked){	
			chkIssueStatus = pDoc.frmIssueSearch.chkIssueStatus[i].value;
		}
	}

	issueStatusVal = "&chkIssueStatus=" + chkIssueStatus;

	chkIssues = pDoc.frmIssueSearch.chkIssues.value;
	chkCommon = pDoc.frmIssueSearch.chkCommon.value;
	if (chkIssues == "1" && chkCommon == "1") {
		checkVal = checkVal + "&chkReports=kb_issue_caes&chkReports=kb_common_caes" ;
	}
	else {
		if (chkIssues == "1" && chkCommon != "1") {
			checkVal = checkVal + "&chkReports=kb_issue_caes";
		}
		else {
			if (chkIssues != "1" && chkCommon == "1") {
				checkVal = checkVal + "&chkReports=kb_common_caes";
			}
		}
	}
	if (chkIssues == "1"){
		checkVal = checkVal + "&chkIssues=1";
	}
	if (chkCommon== "1"){	
		checkVal = checkVal + "&chkCommon=1";
	}	
//alert(checkVal);	
//	stringVal = 'issue_search_frm.asp?proj_code=' + escape(ls_proj_code) + '&txtDateTo=' + escape(txtDateTo) + '&txtDateFrom=' + escape(txtDateFrom) + '&txtIssueNum=' + escape(txt_issue);
	stringVal = 'issue_search_frm.asp?proj_code=' + escape(ls_proj_code) + '&txtDateTo=' + escape(txtDateTo) + '&txtDateFrom=' + escape(txtDateFrom) + '&txtIssueNum=' + escape(txt_issue) + xEmpty  + checkVal + issueStatusVal;
	stringVal = stringVal + "&RptFmt=" + pDoc.frmIssueSearch.RptFmt.options[pDoc.frmIssueSearch.RptFmt.selectedIndex].value;
	pDoc.location.replace(stringVal);
	return true;	
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function validateSearchRequest_caes(pDoc){
	cmbProject = replace_spaces(pDoc.frmIssueSearch.cmbProject.options[pDoc.frmIssueSearch.cmbProject.selectedIndex].value);
	ls_Date_From = pDoc.frmIssueSearch.txtDateFrom.value;
	ls_Date_To = pDoc.frmIssueSearch.txtDateTo.value;

	//'** Validate that issue number is numeric
	if (isNaN(pDoc.frmIssueSearch.txtIssueNum.value)) {
		alert ("Issue number must be numeric.") ;
		pDoc.frmIssueSearch.txtIssueNum.focus() ;
		//alert ("Issue number must be numeric.") ;
		return false ;
	}
	if (pDoc.frmIssueSearch.txtIssueNum.value > 2000000000) {
		alert ("Issue number must be less than 2,000,000,000.") ;
		pDoc.frmIssueSearch.txtIssueNum.focus() ;
		//alert ("Issue number must be numeric.") ;
		return false ;
	}
	if (pDoc.frmIssueSearch.txtIssueNum.value > 0) {
		pDoc.frmIssueSearch.txtIssueNum.value = parseInt(pDoc.frmIssueSearch.txtIssueNum.value);
	}

	//'** Validate that a project is selected
	pDoc.frmIssueSearch.txtIssueNum.value = trimme(pDoc.frmIssueSearch.txtIssueNum.value);	
	if(pDoc.frmIssueSearch.cmbProject.selectedIndex == null || pDoc.frmIssueSearch.cmbProject.selectedIndex == "" || (pDoc.frmIssueSearch.cmbProject.selectedIndex == 0)) {
		if (pDoc.frmIssueSearch.txtIssueNum.value == null || pDoc.frmIssueSearch.txtIssueNum.value == "" || (pDoc.frmIssueSearch.txtIssueNum.value.length == 0)) {	
			alert ("Please select an Application Name or Issue Number.") ;
			pDoc.frmIssueSearch.cmbProject.focus() ;
			return false ;
		}	
	}
	//'**Validate that the date fields are correct (taken from EMC)
	if (pDoc.frmIssueSearch.txtDateFrom.value != null && pDoc.frmIssueSearch.txtDateFrom.value != "" && pDoc.frmIssueSearch.txtDateFrom.value != "//") {
	    	var d = new Date(pDoc.frmIssueSearch.txtDateFrom.value);
		if (isNaN(d)) {
	        	alert("Please enter a valid date.");
			pDoc.frmIssueSearch.txtDateFrom.focus();
		    	return false;
		    }
		if (isDate(pDoc.frmIssueSearch.txtDateFrom.value)==false){
			alert("Please enter a valid date.");
			pDoc.frmIssueSearch.txtDateFrom.focus();
		    	return false;
		}
		var dlow = new Date('01/01/1971');
		if (compareDate(d,dlow)==-1) {
			alert("Please enter a valid date.");
			pDoc.frmIssueSearch.txtDateFrom.focus();
			return false;
		}
		var dhigh = new Date('12/31/3000');
		if (compareDate(d,dhigh)==1) {
			alert("Please enter a valid date.");
			pDoc.frmIssueSearch.txtDateFrom.focus();
			return false;
		}
	}
	if (pDoc.frmIssueSearch.txtDateTo.value != null && pDoc.frmIssueSearch.txtDateTo.value != "" && pDoc.frmIssueSearch.txtDateTo.value != "//") {
		var d = new Date(pDoc.frmIssueSearch.txtDateTo.value);
	    	if (isNaN(d)) {
	        	alert("Please enter a valid date.");
			pDoc.frmIssueSearch.txtDateTo.focus();
	    		return false;
	    	}
		if (isDate(pDoc.frmIssueSearch.txtDateTo.value)==false){
			alert("Please enter a valid date.");
			pDoc.frmIssueSearch.txtDateTo.focus();
		    	return false;
		}
	    	var dlow = new Date('01/01/1971');
	    	if (compareDate(d,dlow)==-1) {
	        	alert("Please enter a valid date.");
			pDoc.frmIssueSearch.txtDateTo.focus();
	    		return false;
	    	}
	    	var dhigh = new Date('12/31/3000');
	    	if (compareDate(d,dhigh)==1) {
	        	alert("Please enter a valid date.");
		        pDoc.frmIssueSearch.txtDateTo.focus();
	    		return false;
	    	}		    
	}
	if (pDoc.frmIssueSearch.txtDateTo.value != null && pDoc.frmIssueSearch.txtDateTo.value != "" && pDoc.frmIssueSearch.txtDateTo.value != "//" && pDoc.frmIssueSearch.txtDateFrom.value != null && pDoc.frmIssueSearch.txtDateFrom.value != "" && pDoc.frmIssueSearch.txtDateFrom.value != "//") {
		    	var d1 = new Date(pDoc.frmIssueSearch.txtDateFrom.value);
	    		var d2 = new Date(pDoc.frmIssueSearch.txtDateTo.value);
		if (compareDate(d1,d2) == 1) {
			alert("Please enter a valid date range.");
			pDoc.frmIssueSearch.txtDateFrom.focus();
			return false;
		}
	}
		
	submitSearchRequest_caes(pDoc);
	//return true;		
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function clearSearch_caes(pDoc){
	content.sub_contents.location.href = "issue_search_frm.asp?loc=clear";
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function issue_search_contact_change_caes(pDoc,thisCombo) {
	if(pDoc.frmIssueSearch.chkCommon.value=="1"){
		if(thisCombo.selectedIndex != 0){
		alert ("You must change your Request Type to Issues in order to search by Issue Number, Serial Number, Dealer Name, Dealer Code, Parent Company, Reason, Machine Type, Dealer Contact, Caller Name, or Site Location.");
			thisCombo.selectedIndex = 0;
			return false;
		}
	}
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function issue_search_dealer_change_caes(pDoc,thisCombo) {
	if(pDoc.frmIssueSearch.chkCommon.value=="1"){
		if(thisCombo.selectedIndex != 0){
		alert ("You must change your Request Type to Issues in order to search by Issue Number, Serial Number, Dealer Name, Dealer Code, Parent Company, Reason, Machine Type, Dealer Contact, Caller Name, or Site Location.");
			thisCombo.selectedIndex = 0;
			return false;
		}
	}
	cmbProject = replace_spaces(pDoc.frmIssueSearch.cmbProject.options[pDoc.frmIssueSearch.cmbProject.selectedIndex].value);
	txtDateFrom = pDoc.frmIssueSearch.txtDateFrom.value;
	txtDateTo = pDoc.frmIssueSearch.txtDateTo.value;
	txt_issue = pDoc.frmIssueSearch.txtIssueNum.value;
	stringVal = ""

	cmbVersion = replace_spaces(pDoc.frmIssueSearch.cmbVersion.options[pDoc.frmIssueSearch.cmbVersion.selectedIndex].value);
	cmbLocation = replace_spaces(pDoc.frmIssueSearch.cmbLocation.options[pDoc.frmIssueSearch.cmbLocation.selectedIndex].value);

	stringVal = 'issue_search_frm.asp?proj_code=' + escape(cmbProject) + '&txtDateTo=' + escape(txtDateTo) + '&txtDateFrom=' + escape(txtDateFrom) + '&txtIssueNum=' + escape(txt_issue);
	stringVal = stringVal + '&cmbVersion=' + escape(cmbVersion) 
	stringVal = stringVal + '&cmbLocation=' + escape(cmbLocation) 
	
	stringVal = stringVal +  "&dealer_code=" + replace_spaces(thisCombo.options[thisCombo.selectedIndex].value);


	stringVal = stringVal +  "&cmbParent=" + escape(replace_spaces(pDoc.frmIssueSearch.cmbParent.options[pDoc.frmIssueSearch.cmbParent.selectedIndex].value));
	stringVal = stringVal +  "&cmbDealerContact=" + escape(replace_spaces(pDoc.frmIssueSearch.cmbDealerContact.options[pDoc.frmIssueSearch.cmbDealerContact.selectedIndex].value));
	stringVal = stringVal +  "&cmbCaller_Name=" + escape(replace_spaces(pDoc.frmIssueSearch.cmbCaller_Name.options[pDoc.frmIssueSearch.cmbCaller_Name.selectedIndex].value));
	stringVal = stringVal +  "&cmbKey_Type=" + escape(replace_spaces(pDoc.frmIssueSearch.cmbKey_Type.options[pDoc.frmIssueSearch.cmbKey_Type.selectedIndex].value));
	stringVal = stringVal +  "&cmbReason=" + escape(replace_spaces(pDoc.frmIssueSearch.cmbReason.options[pDoc.frmIssueSearch.cmbReason.selectedIndex].value));
	stringVal = stringVal +  "&cmbMachine_Type=" + escape(replace_spaces(pDoc.frmIssueSearch.cmbMachine_Type.options[pDoc.frmIssueSearch.cmbMachine_Type.selectedIndex].value));
	stringVal = stringVal +  "&cmbOS_Version=" + escape(replace_spaces(pDoc.frmIssueSearch.cmbOS_Version.options[pDoc.frmIssueSearch.cmbOS_Version.selectedIndex].value));
	stringVal = stringVal +  "&cmbSortBY=" + escape(replace_spaces(pDoc.frmIssueSearch.cmbSortBY.options[pDoc.frmIssueSearch.cmbSortBY.selectedIndex].value));
	stringVal = stringVal + "&RptFmt=" + pDoc.frmIssueSearch.RptFmt.options[pDoc.frmIssueSearch.RptFmt.selectedIndex].value;
	pDoc.location.replace(stringVal);
	return true;	
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function submitSearchRequest_caes(pDoc){

	checkVal 		= ""; 
	stringVal 	= "";
	issueStatusVal	= ""; 
	chkIssueStatus	= ""; 
	
	cmbProject = replace_spaces(pDoc.frmIssueSearch.cmbProject.options[pDoc.frmIssueSearch.cmbProject.selectedIndex].value);
	txtDateFrom = pDoc.frmIssueSearch.txtDateFrom.value;
	txtDateTo = pDoc.frmIssueSearch.txtDateTo.value;

	cmbVersion = replace_spaces(pDoc.frmIssueSearch.cmbVersion.options[pDoc.frmIssueSearch.cmbVersion.selectedIndex].value);
	cmbLocation = replace_spaces(pDoc.frmIssueSearch.cmbLocation.options[pDoc.frmIssueSearch.cmbLocation.selectedIndex].value);
//	stringVal = 'issue_search_frm.asp?loc=submit';
	stringVal = 'issue_search_PDF_frm_caes.asp?loc=submit';
	
	stringVal = stringVal + '&txtIssueNum=' + escape(pDoc.frmIssueSearch.txtIssueNum.value); 	
	
	stringVal = stringVal + '&proj_code=' + escape(cmbProject) + '&txtDateTo=' + escape(txtDateTo) + '&txtDateFrom=' + escape(txtDateFrom);
	stringVal = stringVal + '&cmbVersion=' + escape(cmbVersion); 
	stringVal = stringVal + '&cmbLocation=' + escape(cmbLocation); 
	stringVal = stringVal +  "&cmbParent=" + replace_spaces(pDoc.frmIssueSearch.cmbParent.options[pDoc.frmIssueSearch.cmbParent.selectedIndex].value);
	stringVal = stringVal +  "&dealer_code=" + replace_spaces(pDoc.frmIssueSearch.cmbDealer.options[pDoc.frmIssueSearch.cmbDealer.selectedIndex].value);
	stringVal = stringVal +  "&cmbDealerContact=" + replace_spaces(pDoc.frmIssueSearch.cmbDealerContact.options[pDoc.frmIssueSearch.cmbDealerContact.selectedIndex].value);
	stringVal = stringVal +  "&cmbCaller_Name=" + replace_spaces(pDoc.frmIssueSearch.cmbCaller_Name.options[pDoc.frmIssueSearch.cmbCaller_Name.selectedIndex].value);
	stringVal = stringVal +  "&cmbKey_Type=" + replace_spaces(pDoc.frmIssueSearch.cmbKey_Type.options[pDoc.frmIssueSearch.cmbKey_Type.selectedIndex].value);
	stringVal = stringVal +  "&cmbReason=" + replace_spaces(pDoc.frmIssueSearch.cmbReason.options[pDoc.frmIssueSearch.cmbReason.selectedIndex].value);
	stringVal = stringVal +  "&cmbMachine_Type=" + replace_spaces(pDoc.frmIssueSearch.cmbMachine_Type.options[pDoc.frmIssueSearch.cmbMachine_Type.selectedIndex].value);
	stringVal = stringVal +  "&cmbOS_Version=" + replace_spaces(pDoc.frmIssueSearch.cmbOS_Version.options[pDoc.frmIssueSearch.cmbOS_Version.selectedIndex].value);
	stringVal = stringVal +  "&cmbSortBY=" + replace_spaces(pDoc.frmIssueSearch.cmbSortBY.options[pDoc.frmIssueSearch.cmbSortBY.selectedIndex].value);

//	chkIssueStatus = pDoc.frmIssueSearch.chkIssueStatus.value;
//	for (var i=0;i<3;i++){
//		if(pDoc.frmIssueSearch.chkIssueStatus[i].checked){	
//			chkIssueStatus = pDoc.frmIssueSearch.chkIssueStatus[i].value;
//		}
//	}
	
	for (var i=0;i<3;i++){
		if(pDoc.frmIssueSearch.chkIssueStatus[i].checked){	
			chkIssueStatus = pDoc.frmIssueSearch.chkIssueStatus[i].value;
		}
	}

	issueStatusVal = "&chkIssueStatus=" + chkIssueStatus;
	
	chkIssues = pDoc.frmIssueSearch.chkIssues.value;
	chkCommon = pDoc.frmIssueSearch.chkCommon.value;
	
	if (chkIssues == "1" && chkCommon == "1") {
		checkVal = checkVal + "&chkReports=kb_issue_caes&chkReports=kb_common_caes" ;
	}
	else {
		if (chkIssues == "1" && chkCommon != "1") {
			checkVal = checkVal + "&chkReports=kb_issue_caes";
		}
		else {
			if (chkIssues != "1" && chkCommon == "1") {
				checkVal = checkVal + "&chkReports=kb_common_caes";
			}
		}
	}
	if (chkIssues == "1"){
		checkVal = checkVal + "&chkIssues=1";
	}
	if (chkCommon== "1"){	
		checkVal = checkVal + "&chkCommon=1";
	}	

	stringVal = stringVal + checkVal + issueStatusVal;
	stringVal = stringVal + "&RptFmt=" + pDoc.frmIssueSearch.RptFmt.options[pDoc.frmIssueSearch.RptFmt.selectedIndex].value;
	content.location.href = stringVal ;
	//return true;	
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function validateCommonIssues_caes(pDoc){

	pDoc.frmIssueSearch.txtIssueNum.value = trimme(pDoc.frmIssueSearch.txtIssueNum.value);
	if (pDoc.frmIssueSearch.txtIssueNum.value != null && pDoc.frmIssueSearch.txtIssueNum.value != "" && (pDoc.frmIssueSearch.txtIssueNum.value.length != 0)) {
		alert ("You must change your Request Type to Issues in order to search by Issue Number, Serial Number, Dealer Name, Dealer Code, Parent Company, Reason, Machine Type, Dealer Contact, Caller Name, or Site Location.");
		pDoc.frmIssueSearch.chkIssues.value=1;
		pDoc.frmIssueSearch.chkCommon.value="0";
		pDoc.frmIssueSearch.chkResultType[0].checked = true;
		pDoc.frmIssueSearch.txtIssueNum.focus() ;
		return false ;
	}	

	if(pDoc.frmIssueSearch.cmbDealer.selectedIndex != null && pDoc.frmIssueSearch.cmbDealer.selectedIndex != "" && pDoc.frmIssueSearch.cmbDealer.selectedIndex != 0) {
		alert ("You must change your Request Type to Issues in order to search by Issue Number, Serial Number, Dealer Name, Dealer Code, Parent Company, Reason, Machine Type, Dealer Contact, Caller Name, or Site Location.");
		pDoc.frmIssueSearch.chkIssues.value=1;
		pDoc.frmIssueSearch.chkCommon.value="0";
		pDoc.frmIssueSearch.chkResultType[0].checked = true;
		pDoc.frmIssueSearch.cmbDealer.focus() ;
		return false ;
	}
	if(pDoc.frmIssueSearch.cmbDealerContact.selectedIndex != null && pDoc.frmIssueSearch.cmbDealerContact.selectedIndex != "" && (pDoc.frmIssueSearch.cmbDealerContact.selectedIndex != 0)) {
		alert ("You must change your Request Type to Issues in order to search by Issue Number, Serial Number, Dealer Name, Dealer Code, Parent Company, Reason, Machine Type, Dealer Contact, Caller Name, or Site Location.");
		pDoc.frmIssueSearch.chkIssues.value=1;
		pDoc.frmIssueSearch.chkCommon.value="0";
		pDoc.frmIssueSearch.chkResultType[0].checked = true;
		pDoc.frmIssueSearch.cmbDealerContact.focus() ;
		return false ;
	}
	if(pDoc.frmIssueSearch.cmbCaller_Name.selectedIndex != null && pDoc.frmIssueSearch.cmbCaller_Name.selectedIndex != "" && (pDoc.frmIssueSearch.cmbCaller_Name.selectedIndex != 0)) {
		alert ("You must change your Request Type to Issues in order to search by Issue Number, Serial Number, Dealer Name, Dealer Code, Parent Company, Reason, Machine Type, Dealer Contact, Caller Name, or Site Location.");
		pDoc.frmIssueSearch.chkIssues.value=1;
		pDoc.frmIssueSearch.chkCommon.value="0";
		pDoc.frmIssueSearch.chkResultType[0].checked = true;
		pDoc.frmIssueSearch.cmbCaller_Name.focus() ;
		return false ;
	}

	if(pDoc.frmIssueSearch.cmbReason.selectedIndex != null && pDoc.frmIssueSearch.cmbReason.selectedIndex != "" && (pDoc.frmIssueSearch.cmbReason.selectedIndex != 0)) {
		alert ("You must change your Request Type to Issues in order to search by Issue Number, Serial Number, Dealer Name, Dealer Code, Parent Company, Reason, Machine Type, Dealer Contact, Caller Name, or Site Location.");
		pDoc.frmIssueSearch.chkIssues.value=1;
		pDoc.frmIssueSearch.chkCommon.value="0";
		pDoc.frmIssueSearch.chkResultType[0].checked = true;
		pDoc.frmIssueSearch.cmbReason.focus() ;
		return false ;
	}
	if(pDoc.frmIssueSearch.cmbOS_Version.selectedIndex != null && pDoc.frmIssueSearch.cmbOS_Version.selectedIndex != "" && (pDoc.frmIssueSearch.cmbOS_Version.selectedIndex != 1)) {
		alert ("You must change your Request Type to Issues in order to search by Issue Number, Serial Number, Dealer Name, Dealer Code, Parent Company, Reason, Machine Type, Dealer Contact, Caller Name, or Site Location.");
		pDoc.frmIssueSearch.chkIssues.value=1;
		pDoc.frmIssueSearch.chkCommon.value="0";
		pDoc.frmIssueSearch.chkResultType[0].checked = true;
		pDoc.frmIssueSearch.cmbOS_Version.focus() ;
		return false ;
	}


	if(pDoc.frmIssueSearch.cmbMachine_Type.selectedIndex != null && pDoc.frmIssueSearch.cmbMachine_Type.selectedIndex != "" && (pDoc.frmIssueSearch.cmbMachine_Type.selectedIndex != 0)) {
		alert ("You must change your Request Type to Issues in order to search by Issue Number, Serial Number, Dealer Name, Dealer Code, Parent Company, Reason, Machine Type, Dealer Contact, Caller Name, or Site Location.");
		pDoc.frmIssueSearch.chkIssues.value=1;
		pDoc.frmIssueSearch.chkCommon.value="0";
		pDoc.frmIssueSearch.chkResultType[0].checked = true;
		pDoc.frmIssueSearch.cmbMachine_Type.focus() ;
		return false ;
	}

	if(pDoc.frmIssueSearch.cmbParent.selectedIndex != null && pDoc.frmIssueSearch.cmbParent.selectedIndex != "" && (pDoc.frmIssueSearch.cmbParent.selectedIndex != 0)) {
		alert ("You must change your Request Type to Issues in order to search by Issue Number, Serial Number, Dealer Name, Dealer Code, Parent Company, Reason, Machine Type, Dealer Contact, Caller Name, or Site Location.");
		pDoc.frmIssueSearch.chkIssues.value=1;
		pDoc.frmIssueSearch.chkCommon.value="0";
		pDoc.frmIssueSearch.chkResultType[0].checked = true;
		pDoc.frmIssueSearch.cmbParent.focus() ;
		return false ;
	}

	if(pDoc.frmIssueSearch.cmbLocation.selectedIndex != null && pDoc.frmIssueSearch.cmbLocation.selectedIndex != "" && (pDoc.frmIssueSearch.cmbLocation.selectedIndex != 0)) {
		alert ("You must change your Request Type to Issues in order to search by Issue Number, Serial Number, Dealer Name, Dealer Code, Parent Company, Reason, Machine Type, Dealer Contact, Caller Name, or Site Location.");
		pDoc.frmIssueSearch.chkIssues.value=1;
		pDoc.frmIssueSearch.chkCommon.value="0";
		pDoc.frmIssueSearch.chkResultType[0].checked = true;
		pDoc.frmIssueSearch.cmbLocation.focus() ;
		return false ;
	}

}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function validateResultsType_caes(pDoc){
	for (var i=0;i<3;i++){
		if(pDoc.frmIssueSearch.chkResultType[i].checked){
			if (pDoc.frmIssueSearch.chkResultType[i].value == "Issues"){
				pDoc.frmIssueSearch.chkIssues.value = "1";
				pDoc.frmIssueSearch.chkCommon.value ="0";
			}	
			if (pDoc.frmIssueSearch.chkResultType[i].value == "Common"){
				pDoc.frmIssueSearch.chkIssues.value = "0";
				pDoc.frmIssueSearch.chkCommon.value ="1";
				return validateCommonIssues_caes(pDoc)

			}	
			if (pDoc.frmIssueSearch.chkResultType[i].value == "Both"){
				pDoc.frmIssueSearch.chkIssues.value = "1";
				pDoc.frmIssueSearch.chkCommon.value = "1";
				return validateCommonIssues_caes(pDoc)

			}	
		}
	}
	return true ;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
