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 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 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 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 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;	
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
