// JavaScript Document
function __fncAdd(){
	thisForm.txtWhat2Do.value = 'ADDNEW';
	thisForm.submit();
}

function __fncCheckSaveDetails(strId){
	if(trim($('txtProffPlan').value) == ''){
		$('txtProffPlan').className	=	'inputTextRed';
		$('tdProffPlan').className	=	'inputLabelRed';
		$('txtProffPlan').focus();
		return false;
	}else{
		$('txtProffPlan').className	=	'inputText';
		$('tdProffPlan').className	=	'';
	}
	
	if(trim($('txtInstallationAmount').value) == ''){
		$('txtInstallationAmount').className	=	'inputTextRed';
		$('tdAmount').className		=	'inputLabelRed';
		$('txtInstallationAmount').focus();
		return false;
	}else{
		$('txtInstallationAmount').className	=	'inputText';
		$('tdAmount').className	=	'';
	}
	
	if(trim($('txtMonthlyPayment').value) == ''){
		$('txtMonthlyPayment').className	=	'inputTextRed';
		$('tdmonthlyPay').className		=	'inputLabelRed';
		$('txtMonthlyPayment').focus();
		return false;
	}else{
		$('txtMonthlyPayment').className	=	'inputText';
		$('tdmonthlyPay').className	=	'';
	}
	
	if(trim($('cboOS').value) == '0'){
		$('cboOS').className	=	'inputComboRed';
		$('tdOS').className		=	'inputLabelRed';
		$('cboOS').focus();
		return false;
	}else{
		$('cboOS').className	=	'inputCombo';
		$('tdOS').className		=	'';
	}
	
	if(trim($('txtDiskSpace').value) == ''){
		$('txtDiskSpace').className	=	'inputTextRed';
		$('tdDiskSpace').className	=	'inputLabelRed';
		$('txtDiskSpace').focus();
		return false;
	}else{
		$('txtDiskSpace').className	=	'inputText';
		$('tdDiskSpace').className	=	'';
	}
	
	if(trim($('txtMonthlyTraffic').value) == ''){
		$('txtMonthlyTraffic').className	=	'inputTextRed';
		$('tdMonthlyTraffic').className	=	'inputLabelRed';
		$('txtMonthlyTraffic').focus();
		return false;
	}else{
		$('txtMonthlyTraffic').className	=	'inputText';
		$('tdMonthlyTraffic').className	=	'';
	}
	
	if(trim($('txtShoppinCartLink').value) == ''){
		$('txtShoppinCartLink').className	=	'inputTextRed';
		$('tdShoppinCartLink').className	=	'inputLabelRed';
		$('txtShoppinCartLink').focus();
		return false;
	}else{
		$('txtShoppinCartLink').className	=	'inputText';
		$('tdShoppinCartLink').className	=	'';
	}	
	
	if(strId){
		thisForm.txtId.value = strId;
		thisForm.txtWhat2Do.value = 'UPDATE';
		thisForm.submit();
	}else{
		thisForm.txtWhat2Do.value = 'SAVENEW';
		thisForm.submit();
	}
}

function __fncEdit(strId){
	thisForm.txtWhat2Do.value = 'EDIT';
	thisForm.txtId.value = strId;
	thisForm.submit();
}
function __fncDelete(strId, msg){
	if(!confirm(msg)){
		return;
	}
	thisForm.txtWhat2Do.value = 'DELETE';
	thisForm.txtId.value = strId;
	thisForm.submit();
}

function __fncChangeStatus(status, id){
	$('txtStatus').value	=	status;
	$('txtId').value 		=	id;
	thisForm.txtWhat2Do.value	=	'CHANGESTATUS';
	thisForm.submit();
}

function __fncAddAddition(){
	thisForm.txtWhat2Do.value = 'ADDNEW';
	thisForm.submit();
}

function __fncCheckSaveAdditoin(id){
	if(trim($('txtTitle').value) == ''){
		$('txtTitle').className	=	'inputTextRed';
		$('tdTitle').className	=	'inputLabelRed';
		$('txtTitle').focus();
		return false;
	}else{
		$('txtTitle').className	=	'inputText';
		$('tdTitle').className	=	'';
	}
	if(id != ''){
		thisForm.txtWhat2Do.value = 'UPDATE';
		thisForm.txtId.value = id;
	}else{
		thisForm.txtWhat2Do.value = 'SAVE';
	}
	thisForm.submit();
}

function __fncUpdatePlanDetails(){
	thisForm.txtWhat2Do.value = 'UPDATEPLANDETAILS';
	thisForm.submit();
}

function __fncCheckSavePlanChars(id){
	if(trim($('txtTitle').value) == ''){
		$('txtTitle').className	=	'inputTextRed';
		$('tdTitle').className	=	'inputLabelRed';
		$('txtTitle').focus();
		return false;
	}else{
		$('txtTitle').className	=	'inputText';
		$('tdTitle').className	=	'';
	}
	
	if($('cboGroup').value == '0'){
		$('cboGroup').className	=	'inputComboRed';
		$('tdGroup').className		=	'inputLabelRed';
		$('cboGroup').focus();
		return false;
	}else{
		$('cboGroup').className	=	'inputCombo';
		$('tdGroup').className		=	'';
	}
	if(id){
		thisForm.txtId.value		=	id;
		thisForm.txtWhat2Do.value 	=	'UPDATE';
	}else{
		thisForm.txtWhat2Do.value 	=	'SAVE';
	}
	thisForm.submit();
}

function __fncGo(){
	thisForm.submit();
}

function __fncShowTextArea(){
	if($('chkDisplayInHome').checked == true){
		$('HomeText').style.display	=	'block';	
	}else{
		$('HomeText').style.display	=	'none';
		$('DisplayInHomeText').value = ''
	}
}

function __fncShowHideAdditionalDiv(divId){
	if($(divId).style.display	==	'none'){
		for(var i = 1; i <= 6; i++){
			div = 'div'+i;
			$(div).style.display	=	'none';
		}
		$(divId).style.display	=	'block';
	}else{
		$(divId).style.display	=	'none';
	}
}
