// 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(strId == ''){
		if($('cboPlanOS').value == '0'){
			$('cboPlanOS').className	=	'inputComboRed';
			$('tdPlanOS').className		=	'inputLabelRed';
			$('cboPlanOS').focus();
			return false;
		}else{
			$('cboPlanOS').className	=	'inputCombo';
			$('tdPlanOS').className		=	'';
		}
	
		/*if($('cboPaymentType').value == '0'){
			$('cboPaymentType').className	=	'inputComboRed';
			$('tdPaymentType').className	=	'inputLabelRed';
			$('cboPaymentType').focus();
			return false;
		}else{
			$('cboPaymentType').className	=	'inputCombo';
			$('tdPaymentType').className	=	'';
		}*/
	}
	
	/*if(trim($('txtAmount').value) == ''){
		$('txtAmount').className	=	'inputTextRed';
		$('tdAmount').className		=	'inputLabelRed';
		$('txtAmount').focus();
		return false;
	}else{
		$('txtAmount').className	=	'inputText';
		$('tdAmount').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 __fncSelectedDiv(id){
	var divId				=	'';	
	var contentDivId		=	'';	
	var selectedDiv			=	'';
	var selectedContentDiv	=	'';
	for(var i = 1; i <= 5; i++){
		divId			=	'labelDiv_'+i;
		contentDivId	=	'contendDiv_'+i;
		$(divId).className				=	'divLabelUnSelected';
		$(contentDivId).style.display	=	'none';
	}
	selectedDiv			=	'labelDiv_'+id;
	selectedContentDiv	=	'contendDiv_'+id;
	$(selectedDiv).className	=	'divLabelSelected';
	$(selectedContentDiv).style.display	=	'block';
}

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 __fncShowPaymentData(divID){
	if(document.getElementById(divID).style.display	== 'none'){
		document.getElementById(divID).style.display	='block'; 
	}else{
		document.getElementById(divID).style.display	='none'; 
	}
}			
function __fncSetSelectedPaymentValue(id, value, os){
	var val = document.getElementById(id).innerHTML;
	document.getElementById('txtPaymentType').value = val;
	document.getElementById('PaymentDiv').style.display	='none'; 
	document.getElementById('hidId').value = value;
	var postStr	=	'';
	postStr	+=	'id='+os+'&hidId='+value+'&txtPaymentType='+val;
	$('divHospedagem').innerHTML = '<img src="./Images/ajax-loader2.gif" border="0" style="padding-left:25px;" />';
	general.makePOSTRequestCommon('ajaxposts.php?action=RELOADHOSPEDAGEM', postStr, 'divHospedagem');
}
function __fncShowPaymentdiv(id){
	document.getElementById(id).style.background = '#444446';
}
function __fncChangeBGColor(id){
	document.getElementById(id).style.background = '#6D7276';
}


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

function __fncSwichDiv(id){
	if(id == 1){
		var div		=	"descDiv2";
		var plusdiv =	"plusMinus1";
		var mindiv 	=	"plusMinus2";
		var hidDiv 	=	"descDiv1";
		
	}else{
		var div			=	"descDiv1";
		var plusdiv		=	"plusMinus2";
		var mindiv 		=	"plusMinus1";
		var hidDiv		=	"descDiv2";
	}
	$(div).style.display	=	'block';
	$(plusdiv).innerHTML	=	'+';
	$(mindiv).innerHTML		=	'-';
	$(hidDiv).style.display	=	'none';	
}


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

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

function __fncShowHideFantasticoDivs(id){
	var divId	=	'contentDiv'+id;
	var PMdiv	=	'plusMinus'+id;
	if($(divId).style.display == 'none'){
		$(PMdiv).innerHTML			=	'-';
		$(divId).style.display	=	'block';
	}else{
		$(PMdiv).innerHTML			=	'+';
		$(divId).style.display	=	'none';		
	}
}

function __fncOpenWindiwNossosServidores(){
	window.open ("nossosservidores.html", "","menubar=0,resizable=0,width=899,height=540"); 
}
	
function __fncOpenWindiwNovosServidores(){
	window.open ("novosservidores1.html", "","menubar=0,resizable=0,width=899,height=540"); 
}	

function __fncCheckSavePriceDetails(){
	if(trim($('txtAnnualPlan1').value) == ''){
		$('txtAnnualPlan1').className	=	'inputTextSmallRed';
		$('tdAnnualPlan').className	=	'inputLabelRed';
		$('txtAnnualPlan1').focus();
		return false;
	}else{
		$('txtAnnualPlan1').className	=	'inputTextSmall';
		$('tdAnnualPlan').className	=	'';
	}
	
	if(trim($('txtAnnualPlan2').value) == ''){
		$('txtAnnualPlan2').className	=	'inputTextSmallRed';
		$('tdAnnualPlan').className	=	'inputLabelRed';
		$('txtAnnualPlan2').focus();
		return false;
	}else{
		$('txtAnnualPlan2').className	=	'inputTextSmall';
		$('tdAnnualPlan').className	=	'';
	}
	
	if(trim($('txtAnnualPlan3').value) == ''){
		$('txtAnnualPlan3').className	=	'inputTextSmallRed';
		$('tdAnnualPlan').className	=	'inputLabelRed';
		$('txtAnnualPlan3').focus();
		return false;
	}else{
		$('txtAnnualPlan3').className	=	'inputTextSmall';
		$('tdAnnualPlan').className	=	'';
	}
	
	if(trim($('txtSemesterPlan1').value) == ''){
		$('txtSemesterPlan1').className	=	'inputTextSmallRed';
		$('tdSemesterPlan').className	=	'inputLabelRed';
		$('txtSemesterPlan1').focus();
		return false;
	}else{
		$('txtSemesterPlan1').className	=	'inputTextSmall';
		$('tdSemesterPlan').className	=	'';
	}
	
	if(trim($('txtSemesterPlan2').value) == ''){
		$('txtSemesterPlan2').className	=	'inputTextSmallRed';
		$('tdSemesterPlan').className	=	'inputLabelRed';
		$('txtSemesterPlan2').focus();
		return false;
	}else{
		$('txtSemesterPlan2').className	=	'inputTextSmall';
		$('tdSemesterPlan').className	=	'';
	}
	
	if(trim($('txtSemesterPlan3').value) == ''){
		$('txtSemesterPlan3').className	=	'inputTextSmallRed';
		$('tdSemesterPlan').className	=	'inputLabelRed';
		$('txtSemesterPlan3').focus();
		return false;
	}else{
		$('txtSemesterPlan3').className	=	'inputTextSmall';
		$('tdSemesterPlan').className	=	'';
	}
	
	if(trim($('txtMonthlyPlan1').value) == ''){
		$('txtMonthlyPlan1').className	=	'inputTextSmallRed';
		$('tdMonthlyPlan').className	=	'inputLabelRed';
		$('txtMonthlyPlan1').focus();
		return false;
	}else{
		$('txtMonthlyPlan1').className	=	'inputTextSmall';
		$('tdMonthlyPlan').className	=	'';
	}
	
	if(trim($('txtMonthlyPlan2').value) == ''){
		$('txtMonthlyPlan2').className	=	'inputTextSmallRed';
		$('tdMonthlyPlan').className	=	'inputLabelRed';
		$('txtMonthlyPlan2').focus();
		return false;
	}else{
		$('txtMonthlyPlan2').className	=	'inputTextSmall';
		$('tdMonthlyPlan').className	=	'';
	}
	
	if(trim($('txtMonthlyPlan3').value) == ''){
		$('txtMonthlyPlan3').className	=	'inputTextSmallRed';
		$('tdMonthlyPlan').className	=	'inputLabelRed';
		$('txtMonthlyPlan3').focus();
		return false;
	}else{
		$('txtMonthlyPlan3').className	=	'inputTextSmall';
		$('tdMonthlyPlan').className	=	'';
	}
	thisForm.txtWhat2Do.value	=	'UPDATE';
	thisForm.submit();
}

function __fncCheckSaveRegisterDeDomino(id){
	if(trim($('txtExtension').value) == ''){
		$('txtExtension').className	=	'inputTextRed';
		$('tdExtension').className	=	'inputLabelRed';
		$('txtExtension').focus();
		return false;
	}else{
		$('txtExtension').className	=	'inputText';
		$('tdExtension').className	=	'';
	}
	
	if(trim($('txtAmount').value) == ''){
		$('txtAmount').className	=	'inputTextRed';
		$('tdAmount').className	=	'inputLabelRed';
		$('txtAmount').focus();
		return false;
	}else{
		$('txtAmount').className	=	'inputText';
		$('tdAmount').className	=	'';
	}
	if(id != ''){
		thisForm.txtId.value		=	id;
		thisForm.txtWhat2Do.value	=	'UPDATE';
	}else{
		thisForm.txtWhat2Do.value	=	'SAVENEW';
	}
	
	thisForm.submit();
}
	
	
	