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

function __fncCheckSaveGerenciamento(strId){
	if(trim($('txtTitle').value) == ''){
		$('txtTitle').className	=	'inputTextRed';
		$('tdTitle').className		=	'inputLabelRed';
		$('txtTitle').focus();
		return false;
	}else{
		$('txtTitle').className	=	'inputText';
		$('tdTitle').className	=	'';
	}
	
	if(trim($('txtSem').value) == ''){
		$('txtSem').className	=	'inputTextRed';
		$('tdSem').className		=	'inputLabelRed';
		$('txtSem').focus();
		return false;
	}else{
		$('txtSem').className	=	'inputText';
		$('tdSem').className	=	'';
	}
	
	if(trim($('txtTotal').value) == ''){
		$('txtTotal').className	=	'inputComboRed';
		$('tdTotal').className		=	'inputLabelRed';
		$('txtTotal').focus();
		return false;
	}else{
		$('txtTotal').className	=	'inputCombo';
		$('tdTotal').className		=	'';
	}
	if(strId){
		thisForm.txtId.value = strId;
		thisForm.txtWhat2Do.value = 'UPDATE';
	}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 __fncGo(){
	thisForm.submit();
}

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

function __fncShowHideSoftwareDiv(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 __fncCheckSaveMonitoramentoDetails(id){
	if(id == ''){
		if(trim($('cboCategory').value) == '0'){
			$('cboCategory').className	=	'inputComboRed';
			$('tdCategory').className		=	'inputLabelRed';
			$('cboCategory').focus();
			return false;
		}else{
			$('cboCategory').className	=	'inputCombo';
			$('tdCategory').className	=	'';
		}
	}
	if(trim($('txtTitle').value) == ''){
		$('txtTitle').className	=	'inputTextRed';
		$('tdTitle').className		=	'inputLabelRed';
		$('txtTitle').focus();
		return false;
	}else{
		$('txtTitle').className	=	'inputText';
		$('tdTitle').className	=	'';
	}
	
	if(trim($('txtDateTime').value) == ''){
		$('txtDateTime').className	=	'inputTextRed';
		$('tdDateTime').className		=	'inputLabelRed';
		$('txtDateTime').focus();
		return false;
	}else{
		$('txtDateTime').className	=	'inputText';
		$('tdDateTime').className	=	'';
	}
	
	if(trim($('txtDescription').value) == ''){
		$('txtDescription').className	=	'inputTextRed';
		$('tdDescription').className		=	'inputLabelRed';
		$('txtDescription').focus();
		return false;
	}else{
		$('txtDescription').className	=	'inputText';
		$('tdDescription').className	=	'';
	}
	
	if(id == ''){
		thisForm.txtWhat2Do.value	=	'SAVENEW';
	}else{
		thisForm.txtId.value	=	id;
		thisForm.txtWhat2Do.value	=	'UPDATE';	
	}
	thisForm.submit();
}

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){
	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	+=	'hidId='+value+'&txtPaymentType='+val;
	$('divDedicados').innerHTML = '<img src="./Images/ajax-loader.gif" border="0" style="padding-left:250px;" />';
	general.makePOSTRequestCommon('ajaxposts.php?action=RELOADDEDICADOS', postStr, 'divDedicados');
}
function __fncShowPaymentdiv(id){
	document.getElementById(id).style.background = '#444446';
}
function __fncChangeBGColor(id){
	document.getElementById(id).style.background = '#6D7276';
}

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

function __fncShowHideFaxDiv(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';
	}
}









