function __fncEdit(id){
	thisForm.txtWhat2Do.value = 'EDIT';
	thisForm.txtId.value = id;
	thisForm.submit();
}

function __fncCheckSaveAdditoin(id){
	
	if(id != ''){
		thisForm.txtWhat2Do.value = 'UPDATE';
		thisForm.txtId.value = id;
	}
	thisForm.submit();
}

function __fncEditLicense(id){

	if(id){
		thisForm.txtWhat2Do.value = 'EDIT';
		thisForm.txtId.value = id;
		thisForm.submit();
	}else{
		thisForm.txtWhat2Do.value = 'ADD';
		thisForm.submit();
	}
}

function __fncCheckSaveAdditoinLicense(id){
	
	
	
	if(trim($('txtTitle').value) == ''){
		$('txtTitle').className	=	'inputTextRed';
		$('tdTitle').className	=	'inputLabelRed';
		$('txtTitle').focus();
		return false;
	}else{
		$('txtTitle').className	=	'inputText';
		$('tdTitle').className	=	'';
	}
	
	if(trim($('txtTitle_pg').value) == ''){
		$('txtTitle_pg').className	=	'inputTextRed';
		$('tdTitle_pg').className	=	'inputLabelRed';
		$('txtTitle_pg').focus();
		return false;
	}else{
		$('txtTitle_pg').className	=	'inputText';
		$('tdTitle_pg').className	=	'';
	}

	
	if(trim($('txtInterAPricing').value) == ''){
		$('txtInterAPricing').className	=	'inputTextRed';
		$('tdInterAPricing').className	=	'inputLabelRed';
		$('txtInterAPricing').focus();
		return false;
	}else{
		$('txtInterAPricing').className	=	'inputText';
		$('tdInterAPricing').className	=	'';
	}
	
	if(trim($('txtInterAPricing_pg').value) == ''){
		$('txtInterAPricing_pg').className	=	'inputTextRed';
		$('tdInterAPricing_pg').className	=	'inputLabelRed';
		$('txtInterAPricing_pg').focus();
		return false;
	}else{
		$('txtInterAPricing_pg').className	=	'inputText';
		$('tdInterAPricing_pg').className	=	'';
	}
	
	if(trim($('txtInterBPricing').value) == ''){
		$('txtInterBPricing').className	=	'inputTextRed';
		$('tdInterBPricing').className	=	'inputLabelRed';
		$('txtInterBPricing').focus();
		return false;
	}else{
		$('txtInterBPricing').className	=	'inputText';
		$('tdInterBPricing').className	=	'';
	}
	
	if(trim($('txtInterBPricing_pg').value) == ''){
		$('txtInterBPricing_pg').className	=	'inputTextRed';
		$('tdInterBPricing_pg').className	=	'inputLabelRed';
		$('txtInterBPricing_pg').focus();
		return false;
	}else{
		$('txtInterBPricing_pg').className	=	'inputText';
		$('tdInterBPricing_pg').className	=	'';
	}
	
	
	
	
	
	if(trim($('txtInterTPricing').value) == ''){
		$('txtInterTPricing').className	=	'inputTextRed';
		$('tdInterTPricing').className	=	'inputLabelRed';
		$('txtInterTPricing').focus();
		return false;
	}else{
		$('txtInterTPricing').className	=	'inputText';
		$('tdInterTPricing').className	=	'';
	}
	
	if(trim($('txtInterTPricing_pg').value) == ''){
		$('txtInterTPricing_pg').className	=	'inputTextRed';
		$('tdInterTPricing_pg').className	=	'inputLabelRed';
		$('txtInterTPricing_pg').focus();
		return false;
	}else{
		$('txtInterTPricing_pg').className	=	'inputText';
		$('tdInterTPricing_pg').className	=	'';
	}
	
	
	
	
	
	if(trim($('txtInterMonthlyPrice').value) == ''){
		$('txtInterMonthlyPrice').className	=	'inputTextRed';
		$('tdInterMonthlyPrice').className	=	'inputLabelRed';
		$('txtInterMonthlyPrice').focus();
		return false;
	}else{
		$('txtInterMonthlyPrice').className	=	'inputText';
		$('tdInterMonthlyPrice').className	=	'';
	}
	
	
	if(trim($('txtInterMonthlyPrice_pg').value) == ''){
		$('txtInterMonthlyPrice_pg').className	=	'inputTextRed';
		$('tdInterMonthlyPrice_pg').className	=	'inputLabelRed';
		$('txtInterMonthlyPrice_pg').focus();
		return false;
	}else{
		$('txtInterMonthlyPrice_pg').className	=	'inputText';
		$('tdInterMonthlyPrice_pg').className	=	'';
	}
	
	if(trim($('txtExternAPricing').value) == ''){
		$('txtExternAPricing').className	=	'inputTextRed';
		$('tdExternAPricing').className	=	'inputLabelRed';
		$('txtExternAPricing').focus();
		return false;
	}else{
		$('txtExternAPricing').className	=	'inputText';
		$('tdExternAPricing').className	=	'';
	}	
	
	
	if(trim($('txtExternAPricing_pg').value) == ''){
		$('txtExternAPricing_pg').className	=	'inputTextRed';
		$('tdExternAPricing_pg').className	=	'inputLabelRed';
		$('txtExternAPricing_pg').focus();
		return false;
	}else{
		$('txtExternAPricing_pg').className	=	'inputText';
		$('tdExternAPricing_pg').className	=	'';
	}	
	
	
	if(trim($('txtExternBPricing').value) == ''){
		$('txtExternBPricing').className	=	'inputTextRed';
		$('tdExternBPricing').className	=	'inputLabelRed';
		$('txtExternBPricing').focus();
		return false;
	}else{
		$('txtExternBPricing').className	=	'inputText';
		$('tdExternBPricing').className	=	'';
	}	
	
	
	if(trim($('txtExternBPricing_pg').value) == ''){
		$('txtExternBPricing_pg').className	=	'inputTextRed';
		$('tdExternBPricing_pg').className	=	'inputLabelRed';
		$('txtExternBPricing_pg').focus();
		return false;
	}else{
		$('txtExternBPricing_pg').className	=	'inputText';
		$('tdExternBPricing_pg').className	=	'';
	}

	
	
	if(trim($('txtExternTPricing').value) == ''){
		$('txtExternTPricing').className	=	'inputTextRed';
		$('tdExternTPricing').className	=	'inputLabelRed';
		$('txtExternTPricing').focus();
		return false;
	}else{
		$('txtExternTPricing').className	=	'inputText';
		$('tdExternTPricing').className	=	'';
	}	
	
	
	if(trim($('txtExternTPricing_pg').value) == ''){
		$('txtExternTPricing_pg').className	=	'inputTextRed';
		$('tdExternTPricing_pg').className	=	'inputLabelRed';
		$('txtExternTPricing_pg').focus();
		return false;
	}else{
		$('txtExternTPricing_pg').className	=	'inputText';
		$('tdExternTPricing_pg').className	=	'';
	}
	
	
	
	if(trim($('txtExternMonthlyPrice').value) == ''){
		$('txtExternMonthlyPrice').className	=	'inputTextRed';
		$('tdExternMonthlyPrice').className	=	'inputLabelRed';
		$('txtExternMonthlyPrice').focus();
		return false;
	}else{
		$('txtExternMonthlyPrice').className	=	'inputText';
		$('tdExternMonthlyPrice').className	=	'';
	}
	
	if(trim($('txtExternMonthlyPrice_pg').value) == ''){
		$('txtExternMonthlyPrice_pg').className	=	'inputTextRed';
		$('tdExternMonthlyPrice_pg').className	=	'inputLabelRed';
		$('txtExternMonthlyPrice_pg').focus();
		return false;
	}else{
		$('txtExternMonthlyPrice_pg').className	=	'inputText';
		$('tdExternMonthlyPrice_pg').className	=	'';
	}
	
	
	
	
	if(trim($('txtDisplayOrder').value) != ''){
		if(isNaN($('txtDisplayOrder').value)){
			
			$('txtDisplayOrder').className	=	'inputTextRed';
			$('txtDisplayOrder').className	=	'inputLabelRed';
			$('txtDisplayOrder').focus();
			alert("Display Order Should be a number");
			return false;
		}
		else{
			$('txtDisplayOrder').className	=	'inputText';
			$('txtDisplayOrder').className	=	'';
		}
	}
	
	if(id != ''){
		thisForm.txtWhat2Do.value = 'UPDATE';
		thisForm.txtId.value = id;
	}else{
		thisForm.txtWhat2Do.value = 'SAVE';
	}
	thisForm.submit();
}

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


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 changeLanguage(lng)
{	
	
	thisForm.language.value	= lng;
	thisForm.action 		= "language.php";	
	thisForm.submit();
}
function ResetSession()
{
	thisForm.action 		= "language.php";	
	thisForm.submit();
}
/*
function __fncShowPaymentData(divID){ 	
		document.getElementById(divID).style.display	='block'; 	
}
function __fncHidePaymentData(divID){ 	
		document.getElementById(divID).style.display	='none'; 
}
*/

function __fncShowPaymentData(divID){
	//alert(divID);
	if(document.getElementById(divID).style.display	== 'none'){
		//alert("none");
		document.getElementById(divID).style.display	='block'; 
	}else{
		//alert("block");
		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 lan=document.getElementById('lan').value;
	var postStr	=	'';	
	postStr	+=	'id='+value+'&txtPaymentType='+val+'&lan='+lan;	
	//$('divCpanel').innerHTML="";
	//$('divCpanel').innerHTML = '<img src="./Images/ajax-loader2.gif" border="0" style="padding-left:25px;" />';
	general.makePOSTRequestCommon('ajaxposts.php?action=LOADCPANELTABLE', postStr, 'divCpanel');
}

function __fncShowPaymentdiv(id){ 	
	document.getElementById(id).style.background = '#444446';
}
function __fncChangeBGColor(id){
	document.getElementById(id).style.background = '#7ea8bd';
}
function deleteImage(id){
	if(confirm('Do you really want to delete this image?')){		
		var postStr	=	'';
		postStr	+=	'id='+id;
		general.makePOSTRequestCloud('ajaxposts.php?action=DELETEIMAGE', postStr,'divServerError');
	}
}


function fncLicenseDetails(){
	
	//alert(document.getElmentById('lan').value);
	var lan=document.getElementById('lan').value;
	//alert(lan);
	general.makePOSTRequestCommon('ajaxposts.php?action=CPANELLICENSEDETAILSHOW&lan='+lan, '','quicklookpopupajax');
}

function fncCloudComputingFlash(){
	general.makePOSTRequestCommon('ajaxposts.php?action=CLOUDCOMPUTINGFLSHSHOW', '','quicklookpopupajax');
}

function hide_popup()
{
	if(document.getElementById('popcontent').value=='1')
	{
		
		document.getElementById('quicklookCpanelpopup').onclick();
	}
	
	
}


 /*function openInNewWindow(obj) {
	
 	/*var newWindow = window.open(obj.getAttribute('href'), '_blank');
	newWindow.focus();
	return false;
}
*/
 
 function cPanelEnglishVersion(obj)
{	
	thisForm.lan.value	= 1;	
	thisForm.action 		= obj.getAttribute('href');	
	thisForm.target 		= "_blank";		
	thisForm.submit();
}
