function edit_subscription(sPage, qstr, sSubscription, sProj, sVersion, sLoc, sReports, sInterval, sEmail){
	content.sub_contents.edt_frame.location.href = sPage +".asp?" + qstr + "&subscription=" + sSubscription;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function edit_subscription_oc(sPage, qstr, sSubscription, sProj, sVersion, sLoc, sReports, sInterval){

retValue = "";
retValue = sPage +".asp?" + qstr + "&subscription2=" + sSubscription;
content.sub_contents.location.href = retValue;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


function refresh_details(){
	content.sub_contents.sub_contents2.location.href = "auto_list_reports_details.asp";
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
function delete_subscription(lisubscription){
	retval = confirm("Are you sure?");
	if (!retval) {
		content.sub_contents.sub_contents2.location.href = "auto_list_reports_details.asp";
	}
	else {
	  content.sub_contents.sub_contents2.location.href = "auto_list_reports_details.asp?delete=" + lisubscription;
	}
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function delete_subscription_caes(lisubscription){
	retval = confirm("Are you sure?");
	if (!retval) {
		content.sub_contents.sub_contents2.location.href = "auto_list_reports_details_caes.asp";
	}
	else {
	  content.sub_contents.sub_contents2.location.href = "auto_list_reports_details_caes.asp?delete=" + lisubscription;
	}
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function delete_subscription_oc(lisubscription){
	retval = confirm("Are you sure you wish to delete this subscription?");
	if (!retval) {
		content.sub_contents.location.href = "oc_reports.asp";
	}
	else {
	  content.sub_contents.location.href = "oc_reports.asp?delete=" + lisubscription;
	}
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function auto_list_reports_project_change(pDoc,thisCombo) {
	var checks=0;
	var subscription = pDoc.frmautoListReports.txtpass_subscription.value;
	var checksArray = new Array();

	for (var i=0;i<pDoc.frmautoListReports.elements.length;i++){
		if (pDoc.frmautoListReports.elements[i].type=='checkbox'){
			if(pDoc.frmautoListReports.elements[i].checked){	
				item_value = pDoc.frmautoListReports.elements[i].value;
				checksArray[checks]=item_value;
				checks++;
			}
		}
	}

	stringVal = 'auto_list_reports_frm.asp?txtpass_subscription=' + subscription + '&proj_code=' + escape(replace_spaces(thisCombo.options[thisCombo.selectedIndex].value));
	for (i=0;i<checksArray.length;i++){
		stringVal = stringVal + "&chkReports=" + checksArray[i];
	}

	//'**pDoc.location.replace(stringVal);
	content.sub_contents.location.replace(stringVal);
	return true;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function autolr_validateRequest(pDoc){
	ls_Project  = pDoc.frmautoListReports.cmbProject.options[pDoc.frmautoListReports.cmbProject.selectedIndex].value;
	if(pDoc.frmautoListReports.cmbProject.selectedIndex == null || pDoc.frmautoListReports.cmbProject.selectedIndex	 == "" || (pDoc.frmautoListReports.cmbProject.selectedIndex	 == 0)) {
		alert ("Please select a Project.") ;
		pDoc.frmautoListReports.cmbProject.focus() ;
		return false ;
	}

	//'**Validate that at least 1 report type is checked
	var checks=0;
	var checksArray = new Array();
	for (var i=0;i<pDoc.frmautoListReports.elements.length;i++){
		if (pDoc.frmautoListReports.elements[i].type=='checkbox'){
			if(pDoc.frmautoListReports.elements[i].checked){
				item_value = pDoc.frmautoListReports.elements[i].value;
				checksArray[checks]=item_value;
				checks++;
			}
		}
	}
	if (checks == 0){
		alert("Please choose a Report type.");
		return false;
	}
	autolr_submitRequest(pDoc);
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function autolr_submitRequest(pDoc){
	//'**Build Query String
	ls_Project  = pDoc.frmautoListReports.cmbProject.options[pDoc.frmautoListReports.cmbProject.selectedIndex].value;

	ls_subscription  = pDoc.frmautoListReports.txtpass_subscription.value;
	li_email = pDoc.frmautoListReports.cmbEmail.options[pDoc.frmautoListReports.cmbEmail.selectedIndex].value;

	for (var i=0;i<pDoc.frmautoListReports.chkInterval.length;i++){
		if (pDoc.frmautoListReports.chkInterval[i].checked){
			li_interval = pDoc.frmautoListReports.chkInterval[i].value;
		}
	}

	stringVal = "";
	versionVal = "";
	locVal = "";
	checkVal = "";
	stringVal = "auto_list_reports_frm.asp?txtpass_subscription=" + ls_subscription + "&loc=submit&proj_code=" + escape(ls_Project);
	extrastringVal = "&txtemail=" + li_email + "&txtint=" + li_interval;
	//Get versions
	for (var i = 0; i < pDoc.frmautoListReports.cmbVersion.length; i++){
		if(pDoc.frmautoListReports.cmbVersion.options[i].selected == true){
			if(pDoc.frmautoListReports.cmbVersion.options[i].value == "-1"){
				//notiing
			}else{	
				versionVal = versionVal + "&cmbVersion=" + pDoc.frmautoListReports.cmbVersion.options[i].value;
			}
		
		}
	}	 

	//Get locations
	for (var i = 0; i < pDoc.frmautoListReports.cmbLocation.length; i++){
		if(pDoc.frmautoListReports.cmbLocation.options[i].selected == true){
			if(pDoc.frmautoListReports.cmbLocation.options[i].value == "-1"){
				//nothing
			}else{	
				locVal = locVal + "&cmbLocation=" + pDoc.frmautoListReports.cmbLocation.options[i].value;
			}	
		}
	}	

	//'**Get checkboxes	
	var checks=0;
	var checksArray = new Array();
	for (var i=0;i<pDoc.frmautoListReports.elements.length;i++){
		if (pDoc.frmautoListReports.elements[i].type=='checkbox'){
			if(pDoc.frmautoListReports.elements[i].checked){	
				item_value = pDoc.frmautoListReports.elements[i].value;
				checksArray[checks]=item_value;
				checks++;
			}
		}
	}  

	for (i=0;i<checksArray.length;i++){
		checkVal = checkVal + "&chkReports=" +checksArray[i];
	}

	destString = stringVal + versionVal + locVal + checkVal + extrastringVal;
//'**	pDoc.location.replace(destString);
	content.sub_contents.location.href = destString;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


function list_reports_project_change_OC(pDoc,thisCombo) {

	dealerValue  = "&txtDealership=" + pDoc.frmOCReports.txtDealership.value;
	emailValue =  "&cmbEmail=" + pDoc.frmOCReports.cmbEmail.options[pDoc.frmOCReports.cmbEmail.selectedIndex].value;
	projectValue = "&proj_code=" + pDoc.frmOCReports.cmbProject.options[pDoc.frmOCReports.cmbProject.selectedIndex].value;
	subscriptionValue = "&lsSubscription=" + pDoc.frmOCReports.subscriptionVar.value;

	for (var i=0;i<pDoc.frmOCReports.rdoReportInterval.length;i++){
		if (pDoc.frmOCReports.rdoReportInterval[i].checked){
			reportIntervalValue = "&RptInvl="  + pDoc.frmOCReports.rdoReportInterval[i].value;
		}
	}

	for (var i=0;i<pDoc.frmOCReports.rdoReportSubType.length;i++){
		if (pDoc.frmOCReports.rdoReportSubType[i].checked){
			reportTypeValue = "&RptFmt="  + pDoc.frmOCReports.rdoReportSubType[i].value;
		}
	}


	
returnVal = "oc_reports_frm.asp?loc=projectChange" + reportTypeValue + reportIntervalValue + subscriptionValue + projectValue + emailValue + dealerValue ;

	content.sub_contents.location.href = returnVal;


//	var checks=0;
//	var checksArray = new Array();

//	for (var i=0;i<pDoc.frmOCReports.elements.length;i++){
//		if (pDoc.frmOCReports.elements[i].type=='checkbox'){
//			if(pDoc.frmOCReports.elements[i].checked){	
//				item_value = pDoc.frmOCReports.elements[i].value;
//				checksArray[checks]=item_value;
//				checks++;
//			}
//		}
//	}

//	stringVal = 'auto_list_reports_frm.asp?txtpass_subscription=' + subscription + '&proj_code=' + escape(replace_spaces(thisCombo.options[thisCombo.selectedIndex].value));
//	for (i=0;i<checksArray.length;i++){
//		stringVal = stringVal + "&chkReports=" + checksArray[i];
//	}
//	stringVal = stringVal +  "&RptFmt=" + pDoc.frmautoListReports.RptFmt.options[pDoc.frmautoListReports.RptFmt.selectedIndex].value;
	//'**pDoc.location.replace(stringVal);
//	content.sub_contents.location.replace(stringVal);
//	return true;		

}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



function auto_list_reports_project_change_caes(pDoc,thisCombo) {
	var checks=0;
	var subscription = pDoc.frmautoListReports.txtpass_subscription.value;
	var checksArray = new Array();

	for (var i=0;i<pDoc.frmautoListReports.elements.length;i++){
		if (pDoc.frmautoListReports.elements[i].type=='checkbox'){
			if(pDoc.frmautoListReports.elements[i].checked){	
				item_value = pDoc.frmautoListReports.elements[i].value;
				checksArray[checks]=item_value;
				checks++;
			}
		}
	}

	stringVal = 'auto_list_reports_frm.asp?txtpass_subscription=' + subscription + '&proj_code=' + escape(replace_spaces(thisCombo.options[thisCombo.selectedIndex].value));
	for (i=0;i<checksArray.length;i++){
		stringVal = stringVal + "&chkReports=" + checksArray[i];
	}
	stringVal = stringVal +  "&RptFmt=" + pDoc.frmautoListReports.RptFmt.options[pDoc.frmautoListReports.RptFmt.selectedIndex].value;
	//'**pDoc.location.replace(stringVal);
	content.sub_contents.location.replace(stringVal);
	return true;		
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function autolr_validateRequest_CAES(pDoc){
	ls_Project  = pDoc.frmautoListReports.cmbProject.options[pDoc.frmautoListReports.cmbProject.selectedIndex].value;
	if(pDoc.frmautoListReports.cmbProject.selectedIndex == null || pDoc.frmautoListReports.cmbProject.selectedIndex	 == "" || (pDoc.frmautoListReports.cmbProject.selectedIndex	 == 0)) {
		alert ("Please select an Application Name.") ;
		pDoc.frmautoListReports.cmbProject.focus() ;
		return false ;
	}

	//'**Validate that at least 1 report type is checked
	var checks=0;
	var checksArray = new Array();
	for (var i=0;i<pDoc.frmautoListReports.elements.length;i++){
		if (pDoc.frmautoListReports.elements[i].type=='checkbox'){
			if(pDoc.frmautoListReports.elements[i].checked){
				item_value = pDoc.frmautoListReports.elements[i].value;
				checksArray[checks]=item_value;
				checks++;
			}
		}
	}
	if (checks == 0){
		alert("Please choose a Report type.");
		return false;
	}
	autolr_submitRequest_CAES(pDoc);
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function reportChange_OC(pDoc){

reportIntervalValue = "";
reportTypeValue = "";

var checks=0;
	var checksArray = new Array();
	for (var i=0;i<pDoc.frmOCReports.elements.length;i++){
	if (pDoc.frmOCReports.elements[i].type=='radio'){
	if (pDoc.frmOCReports.elements[i].name=='rdoReportSubType'){	
			if(pDoc.frmOCReports.elements[i].checked){	
			    reportTypeValue = "&RptFmt=" + pDoc.frmOCReports.elements[i].value;
				
				}
			}
		}
	}  

//'**Get Report Interval
	var checks=0;
	var checksArray = new Array();
	for (var i=0;i<pDoc.frmOCReports.elements.length;i++){
		if (pDoc.frmOCReports.elements[i].type=='radio'){
			if (pDoc.frmOCReports.elements[i].name == 'rdoReportInterval'){
				if(pDoc.frmOCReports.elements[i].checked){
				reportIntervalValue = "&RptInvl="  + pDoc.frmOCReports.elements[i].value;
				}
			 }
		}
	}
	
	
returnVal = "oc_reports_frm.asp?loc=reportChange" + reportTypeValue + reportIntervalValue;

	content.sub_contents.location.href = returnVal;



}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function validateRequest_OC_auto(pDoc) {


ls_Dealership  = pDoc.frmOCReports.txtDealership.value;
//	if(pDoc.frmOCReports.txtDealership.value == "") {
//		alert ("Please enter a Dealership Name.") ;
//		pDoc.frmOCReports.txtDealership.focus() ;
//		return false;
//	}



//'**Validate that a report type is checked
	var checks=0;
	var checksArray = new Array();
	for (var i=0;i<pDoc.frmOCReports.elements.length;i++){
		if (pDoc.frmOCReports.elements[i].type=='radio'){
			if (pDoc.frmOCReports.elements[i].name == 'rdoReportSubType'){
				if(pDoc.frmOCReports.elements[i].checked){
					item_value = pDoc.frmOCReports.elements[i].value;
					checksArray[checks]=item_value;
					checks++;
				}
			 }
		}
	}
	if (checks == 0){
		alert("Please choose a report type.");
		return false;
	}
	if (item_value == 'ORDER_HISTORY') {

		if(pDoc.frmOCReports.cmbProject.value == "-1") {
			if(pDoc.frmOCReports.txtDealership.value == "") {
				alert ("Please select an application or enter a Dealership name.") ;
				pDoc.frmOCReports.cmbProject.focus() ;
				return false;
			}	
		}
	}			
//if (item_value == 'ORDER_HISTORY') {
//
//		if(pDoc.frmOCReports.cmbProject.value == "-1") {
//		alert ("Please select an application.") ;
//		pDoc.frmOCReports.cmbProject.focus() ;
//		return false;
//	}
//if(pDoc.frmOCReports.cmbVersion.value == "-1") {
//		alert ("Please select a version.") ;
//		pDoc.frmOCReports.cmbVersion.focus() ;
//		return false;
//	}
//}
//'**Validate that an interval is checked
	var checks=0;
	var checksArray = new Array();
	for (var i=0;i<pDoc.frmOCReports.elements.length;i++){
		if (pDoc.frmOCReports.elements[i].type=='radio'){
			if (pDoc.frmOCReports.elements[i].name == 'rdoReportInterval'){
				if(pDoc.frmOCReports.elements[i].checked){
					item_value = pDoc.frmOCReports.elements[i].value;
					checksArray[checks]=item_value;
					checks++;
				}
			 }
		}
	}
	if (checks == 0){
		alert("Please choose a report interval.");
		return false;
	}



	submitRequest_OC_auto(pDoc);
	}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function submitRequest_OC_auto(pDoc) {

//'**Build Query String
	ls_Dealer  = pDoc.frmOCReports.txtDealership.value;

	li_email = pDoc.frmOCReports.cmbEmail.options[pDoc.frmOCReports.cmbEmail.selectedIndex].value;
	ls_subscription  = pDoc.frmOCReports.subscriptionVar.value;
usercode = pDoc.frmOCReports.usercode.value; 

	for (var i=0;i<pDoc.frmOCReports.rdoReportInterval.length;i++){
		if (pDoc.frmOCReports.rdoReportInterval[i].checked){
			li_interval = pDoc.frmOCReports.rdoReportInterval[i].value;
		}
	}

	for (var i=0;i<pDoc.frmOCReports.rdoReportSubType.length;i++){
		if (pDoc.frmOCReports.rdoReportSubType[i].checked){
			li_reportType = pDoc.frmOCReports.rdoReportSubType[i].value;
		}
	}
	txtDealership = pDoc.frmOCReports.txtDealership.value;
	stringVal = "";
	stringVal2 = "";
	versionVal = "";
	locVal = "";
	checkVal = "";
	//alert(ls_subscription);
	stringVal = "oc_reports_frm.asp?subscription=" + ls_subscription + "&loc=automated_submit" + "&usercode=" + usercode;
	extrastringVal = "&txtemail=" + li_email + "&txtint=" + li_interval + "&txtreporttype=" + li_reportType;
	extrastringVal = extrastringVal + "&txtDealership=" + escape(txtDealership);


if (li_reportType == 'ORDER_HISTORY') 
{

extrastringVal = extrastringVal + "&cmbProject=" + pDoc.frmOCReports.cmbProject.options[pDoc.frmOCReports.cmbProject.selectedIndex].value;
extrastringVal = extrastringVal + "&cmbVersion=" + pDoc.frmOCReports.cmbVersion.options[pDoc.frmOCReports.cmbVersion.selectedIndex].value;
extrastringVal = extrastringVal + "&cmbSerialNo=" + pDoc.frmOCReports.cmbOS_Version.options[pDoc.frmOCReports.cmbOS_Version.selectedIndex].value;
extrastringVal = extrastringVal + "&txtDateTo=" + pDoc.frmOCReports.txtDateTo.value;
extrastringVal = extrastringVal + "&txtDateFrom=" + pDoc.frmOCReports.txtDateFrom.value;
}



	destString = stringVal + extrastringVal;
	content.sub_contents.location.href = destString;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function validateRequest_OC(pDoc){



	ls_Dealership  = pDoc.frmOCReports.txtDealership.value;


//'**Validate that at least 1 report type is checked
	var checks=0;
	var checksArray = new Array();
	for (var i=0;i<pDoc.frmOCReports.elements.length;i++){
		if (pDoc.frmOCReports.elements[i].type=='radio'){
			if (pDoc.frmOCReports.elements[i].name == 'rdoReportSubType'){
				if(pDoc.frmOCReports.elements[i].checked){
					item_value = pDoc.frmOCReports.elements[i].value;
					checksArray[checks]=item_value;
					checks++;
				}
			 }
		}
	}
	if (checks == 0){
		alert("Please choose a Report Type.");
		return false;
	}


if (item_value == 'ORDER_HISTORY') {

		if(pDoc.frmOCReports.cmbProject.value == "-1") {
			if(pDoc.frmOCReports.txtDealership.value == "") {
				alert ("Please select an application or enter a Dealership name.") ;
				pDoc.frmOCReports.cmbProject.focus() ;
				return false;
			}	
		}
}			



	submitRequest_OC(pDoc, item_value);
	}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



function submitRequest_OC(pDoc, item_value){
	//'**Build Query String

ls_Dealership  = pDoc.frmOCReports.txtDealership.value;
li_email = pDoc.frmOCReports.cmbEmail.options[pDoc.frmOCReports.cmbEmail.selectedIndex].value;
stringVal = "";
extraStringVal = "";
reportTypeValue = "";
reportIntervalValue = "";
usercode = pDoc.frmOCReports.usercode.value; 
//alert (usercode);

stringVal = "oc_reports_frm.asp?txtDealership=" + escape(ls_Dealership) + "&loc=submit&dealership=" + escape(ls_Dealership) + "&usercode=" + usercode;
extraStringVals = "&txtemail=" + li_email;
extraStringVals = extraStringVals + "&submitType=download";



if (item_value == 'ORDER_HISTORY') 
{

extraStringVals = extraStringVals + "&cmbProject=" + pDoc.frmOCReports.cmbProject.options[pDoc.frmOCReports.cmbProject.selectedIndex].value;
//if pDoc.frmOCReports.cmbVersion.selectedIndex == "-1"{
//	extraStringVals = extraStringVals + "&cmbVersion=" +;
//}else{
	extraStringVals = extraStringVals + "&cmbVersion=" + pDoc.frmOCReports.cmbVersion.options[pDoc.frmOCReports.cmbVersion.selectedIndex].value;
//}
//if pDoc.frmOCReports.cmbOS_Version.selectedIndex == "-1"{
//	extraStringVals = extraStringVals + "&cmbSerialNo="
//}else{
	extraStringVals = extraStringVals + "&cmbSerialNo=" + pDoc.frmOCReports.cmbOS_Version.options[pDoc.frmOCReports.cmbOS_Version.selectedIndex].value;
//}
extraStringVals = extraStringVals + "&txtDateTo=" + pDoc.frmOCReports.txtDateTo.value;
extraStringVals = extraStringVals + "&txtDateFrom=" + pDoc.frmOCReports.txtDateFrom.value;
}


	
	
	


	////'**Get checkboxes	
	var checks=0;
	var checksArray = new Array();
	for (var i=0;i<pDoc.frmOCReports.elements.length;i++){
		if (pDoc.frmOCReports.elements[i].type=='radio'){
			if (pDoc.frmOCReports.elements[i].name == 'rdoReportSubType'){
				if(pDoc.frmOCReports.elements[i].checked){	
			    reportTypeValue = "&RptFmt=" + pDoc.frmOCReports.elements[i].value;
				}
			}
		}
	}  


//'**Get Report Interval
	var checks=0;
	var checksArray = new Array();
	for (var i=0;i<pDoc.frmOCReports.elements.length;i++){
		if (pDoc.frmOCReports.elements[i].type=='radio'){
			if (pDoc.frmOCReports.elements[i].name == 'rdoReportInterval'){
				if(pDoc.frmOCReports.elements[i].checked){
				reportIntervalValue = "&RptInvl="  + pDoc.frmOCReports.elements[i].value;
				}
			 }
		}
	}

	
returnVal = stringVal + extraStringVals + reportTypeValue + reportIntervalValue;
//alert("js :" + returnVal);
	content.sub_contents.location.href = returnVal;
//pDoc.location.replace(returnVal);
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~









function autolr_submitRequest_CAES(pDoc){
	//'**Build Query String
	ls_Project  = pDoc.frmautoListReports.cmbProject.options[pDoc.frmautoListReports.cmbProject.selectedIndex].value;

	ls_subscription  = pDoc.frmautoListReports.txtpass_subscription.value;
	li_email = pDoc.frmautoListReports.cmbEmail.options[pDoc.frmautoListReports.cmbEmail.selectedIndex].value;

	for (var i=0;i<pDoc.frmautoListReports.chkInterval.length;i++){
		if (pDoc.frmautoListReports.chkInterval[i].checked){
			li_interval = pDoc.frmautoListReports.chkInterval[i].value;
		}
	}

	stringVal = "";
	stringVal2 = "";
	versionVal = "";
	locVal = "";
	checkVal = "";
	//alert(ls_subscription);
	stringVal = "auto_list_reports_frm.asp?txtpass_subscription=" + ls_subscription + "&loc=submit&proj_code=" + escape(ls_Project);
	extrastringVal = "&txtemail=" + li_email + "&txtint=" + li_interval;

	cmbProject = replace_spaces(pDoc.frmautoListReports.cmbProject.options[pDoc.frmautoListReports.cmbProject.selectedIndex].value);
	cmbVersion = replace_spaces(pDoc.frmautoListReports.cmbVersion.options[pDoc.frmautoListReports.cmbVersion.selectedIndex].value);
	cmbLocation = replace_spaces(pDoc.frmautoListReports.cmbLocation.options[pDoc.frmautoListReports.cmbLocation.selectedIndex].value);

	stringVal2 = stringVal2 + '&cmbVersion=' + escape(cmbVersion); 
	stringVal2 = stringVal2 + '&cmbLocation=' + escape(cmbLocation); 

	stringVal2 = stringVal2 +  "&dealer_code=" + replace_spaces( pDoc.frmautoListReports.cmbDealer.options[pDoc.frmautoListReports.cmbDealer.selectedIndex].value);

	stringVal2 = stringVal2 +  "&cmbParent=" + escape(replace_spaces(pDoc.frmautoListReports.cmbParent.options[pDoc.frmautoListReports.cmbParent.selectedIndex].value));

	stringVal2 = stringVal2 +  "&cmbDealerContact=" + escape(replace_spaces(pDoc.frmautoListReports.cmbDealerContact.options[pDoc.frmautoListReports.cmbDealerContact.selectedIndex].value));
	stringVal2 = stringVal2 +  "&cmbCaller_Name=" + escape(replace_spaces(pDoc.frmautoListReports.cmbCaller_Name.options[pDoc.frmautoListReports.cmbCaller_Name.selectedIndex].value));
	stringVal2 = stringVal2 +  "&cmbKey_Type=" + escape(replace_spaces(pDoc.frmautoListReports.cmbKey_Type.options[pDoc.frmautoListReports.cmbKey_Type.selectedIndex].value));
	stringVal2 = stringVal2 +  "&cmbReason=" + escape(replace_spaces(pDoc.frmautoListReports.cmbReason.options[pDoc.frmautoListReports.cmbReason.selectedIndex].value));
	stringVal2 = stringVal2 +  "&cmbMachine_Type=" + escape(replace_spaces(pDoc.frmautoListReports.cmbMachine_Type.options[pDoc.frmautoListReports.cmbMachine_Type.selectedIndex].value));
	stringVal2 = stringVal2 +  "&cmbOS_Version=" + escape(replace_spaces(pDoc.frmautoListReports.cmbOS_Version.options[pDoc.frmautoListReports.cmbOS_Version.selectedIndex].value));
	stringVal2 = stringVal2 +  "&cmbSortBY=" + escape(replace_spaces(pDoc.frmautoListReports.cmbSortBY.options[pDoc.frmautoListReports.cmbSortBY.selectedIndex].value));
	stringVal2 = stringVal2 +  "&RptFmt=" + pDoc.frmautoListReports.RptFmt.options[pDoc.frmautoListReports.RptFmt.selectedIndex].value;
	//'**Get checkboxes	
	var checks=0;
	var checksArray = new Array();
	for (var i=0;i<pDoc.frmautoListReports.elements.length;i++){
		if (pDoc.frmautoListReports.elements[i].type=='checkbox'){
			if(pDoc.frmautoListReports.elements[i].checked){	
				item_value = pDoc.frmautoListReports.elements[i].value;
				checksArray[checks]=item_value;
				checks++;
			}
		}
	}  

	for (i=0;i<checksArray.length;i++){
		checkVal = checkVal + "&chkReports=" +checksArray[i];
	}
	
//	alert(pDoc.frmautoListReports.RptFmt.options[pDoc.frmautoListReports.RptFmt.selectedIndex].value);
	destString = stringVal + versionVal + locVal + checkVal + extrastringVal + stringVal2;
	content.sub_contents.location.href = destString;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function auto_list_search_dealer_change_caes(pDoc,thisCombo) {

	cmbProject = replace_spaces(pDoc.frmautoListReports.cmbProject.options[pDoc.frmautoListReports.cmbProject.selectedIndex].value);
	stringVal = "";
	checkVal = "";

	for (var i=0;i<pDoc.frmautoListReports.chkInterval.length;i++){
		if (pDoc.frmautoListReports.chkInterval[i].checked){
			li_interval = pDoc.frmautoListReports.chkInterval[i].value;
		}
	}

	cmbVersion = replace_spaces(pDoc.frmautoListReports.cmbVersion.options[pDoc.frmautoListReports.cmbVersion.selectedIndex].value);
	cmbLocation = replace_spaces(pDoc.frmautoListReports.cmbLocation.options[pDoc.frmautoListReports.cmbLocation.selectedIndex].value);

	stringVal = 'auto_list_reports_frm.asp?proj_code=' + escape(cmbProject) + "&txtint=" + li_interval;
	stringVal = stringVal + '&cmbVersion=' + escape(cmbVersion); 
	stringVal = stringVal + '&cmbLocation=' + escape(cmbLocation); 
	
	stringVal = stringVal +  "&dealer_code=" + escape(replace_spaces(thisCombo.options[thisCombo.selectedIndex].value));

	stringVal = stringVal +  "&cmbParent=" + escape(replace_spaces(pDoc.frmautoListReports.cmbParent.options[pDoc.frmautoListReports.cmbParent.selectedIndex].value));

	stringVal = stringVal +  "&cmbDealerContact=" + escape(replace_spaces(pDoc.frmautoListReports.cmbDealerContact.options[pDoc.frmautoListReports.cmbDealerContact.selectedIndex].value));
	stringVal = stringVal +  "&cmbCaller_Name=" + escape(replace_spaces(pDoc.frmautoListReports.cmbCaller_Name.options[pDoc.frmautoListReports.cmbCaller_Name.selectedIndex].value));
	stringVal = stringVal +  "&cmbKey_Type=" + escape(replace_spaces(pDoc.frmautoListReports.cmbKey_Type.options[pDoc.frmautoListReports.cmbKey_Type.selectedIndex].value));
	stringVal = stringVal +  "&cmbReason=" + escape(replace_spaces(pDoc.frmautoListReports.cmbReason.options[pDoc.frmautoListReports.cmbReason.selectedIndex].value));
	stringVal = stringVal +  "&cmbMachine_Type=" + escape(replace_spaces(pDoc.frmautoListReports.cmbMachine_Type.options[pDoc.frmautoListReports.cmbMachine_Type.selectedIndex].value));
	stringVal = stringVal +  "&cmbOS_Version=" + escape(replace_spaces(pDoc.frmautoListReports.cmbOS_Version.options[pDoc.frmautoListReports.cmbOS_Version.selectedIndex].value));
	stringVal = stringVal +  "&cmbSortBY=" + escape(replace_spaces(pDoc.frmautoListReports.cmbSortBY.options[pDoc.frmautoListReports.cmbSortBY.selectedIndex].value));
	stringVal = stringVal +  "&txtpass_subscription=" + pDoc.frmautoListReports.txtpass_subscription.value;

	//'**Get checkboxes	
	var checks=0;
	var checksArray = new Array();
	for (var i=0;i<pDoc.frmautoListReports.elements.length;i++){
		if (pDoc.frmautoListReports.elements[i].type=='checkbox'){
			if(pDoc.frmautoListReports.elements[i].checked){	
				item_value = pDoc.frmautoListReports.elements[i].value;
				checksArray[checks]=item_value;
				checks++;
			}
		}
	}  
	
	for (i=0;i<checksArray.length;i++){
		checkVal = checkVal + "&chkReports=" +checksArray[i];
	}
	stringVal = stringVal + checkVal;
	stringVal = stringVal +  "&RptFmt=" + pDoc.frmautoListReports.RptFmt.options[pDoc.frmautoListReports.RptFmt.selectedIndex].value;
	pDoc.location.replace(stringVal);
	return true;	
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

