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 __fncEditPlan(id){

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



function __fncCheckSaveAdditoinPlan(id){	
	if(trim($('txtName').value) == '') {
		$('txtName').className	=	'inputTextRed';
		$('tdName').className	=	'inputLabelRed';
		$('txtName').focus();
		return false;
	}else{
		$('txtName').className	=	'inputText';
		$('tdName').className	=	'';
	}
	
	if(trim($('txtName_pg').value) == ''){
		$('txtName_pg').className	=	'inputTextRed';
		$('tdName_pg').className	=	'inputLabelRed';
		$('txtName_pg').focus();
		return false;
	}else{
		$('txtName_pg').className	=	'inputText';
		$('tdName_pg').className	=	'';
	}
	
	if(trim($('txtDomain').value) == ''){
		$('txtDomain').className	=	'inputTextRed';
		$('tdDomain').className	=	'inputLabelRed';
		$('txtDomain').focus();
		return false;
	}else{
		$('txtDomain').className	=	'inputText';
		$('tdDomain').className	=	'';
	}
	if(trim($('txtDomain_pg').value) == ''){
		$('txtDomain_pg').className	=	'inputTextRed';
		$('tdDomain_pg').className	=	'inputLabelRed';
		$('txtDomain_pg').focus();
		return false;
	}else{
		$('txtDomain_pg').className	=	'inputText';
		$('tdDomain_pg').className	=	'';
		$('tdDomain_pg').className	=	'';
	}
	
	if(trim($('txtCertificate').value) == ''){
		$('txtCertificate').className	=	'inputTextRed';
		$('tdCertificate').className	=	'inputLabelRed';
		$('txtCertificate').focus();
		return false;
	}else{
		$('txtCertificate').className	=	'inputText';
		$('tdCertificate').className	=	'';
	}
	
	
	if(trim($('txtCertificate_pg').value) == ''){
		$('txtCertificate_pg').className	=	'inputTextRed';
		$('tdCertificate_pg').className	=	'inputLabelRed';
		$('txtCertificate_pg').focus();
		return false;
	}else{
		$('txtCertificate_pg').className	=	'inputText';
		$('tdCertificate_pg').className	=	'';
	}
	
	
	
	if(trim($('txtAPricing').value) == ''){
		$('txtAPricing').className	=	'inputTextRed';
		$('tdAPricing').className	=	'inputLabelRed';
		$('txtAPricing').focus();
		return false;
	}else{
		$('txtAPricing').className	=	'inputText';
		$('tdAPricing').className	=	'';
	}
	
	if(trim($('txtAPricing_pg').value) == ''){
		$('txtAPricing_pg').className	=	'inputTextRed';
		$('tdAPricing_pg').className	=	'inputLabelRed';
		$('txtAPricing_pg').focus();
		return false;
	}else{
		$('txtAPricing_pg').className	=	'inputText';
		$('tdAPricing_pg').className	=	'';
	}
	
	
	if(trim($('txtBPricing').value) == ''){
		$('txtBPricing').className	=	'inputTextRed';
		$('tdBPricing').className	=	'inputLabelRed';
		$('txtBPricing').focus();
		return false;
	}else{
		$('txtBPricing').className	=	'inputText';
		$('tdBPricing').className	=	'';
	}
	
	
	
	if(trim($('txtBPricing_pg').value) == ''){
		$('txtBPricing_pg').className	=	'inputTextRed';
		$('tdBPricing_pg').className	=	'inputLabelRed';
		$('txtBPricing_pg').focus();
		return false;
	}else{
		$('txtBPricing_pg').className	=	'inputText';
		$('tdBPricing_pg').className	=	'';
	}
	
	if(trim($('txtMonthlyPrice').value) == ''){
		$('txtMonthlyPrice').className	=	'inputTextRed';
		$('tdMonthlyPrice').className	=	'inputLabelRed';
		$('txtMonthlyPrice').focus();
		return false;
	}else{
		$('txtMonthlyPrice').className	=	'inputText';
		$('tdMonthlyPrice').className	=	'';
	}
	
	
	if(trim($('txtMonthlyPrice_pg').value) == ''){
		$('txtMonthlyPrice_pg').className	=	'inputTextRed';
		$('tdMonthlyPrice_pg').className	=	'inputLabelRed';
		$('txtMonthlyPrice_pg').focus();
		return false;
	}else{
		$('txtMonthlyPrice_pg').className	=	'inputText';
		$('tdMonthlyPrice_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 __fncShowHideLojaDiv(Id,lanID){	
	var imgArray=Array();
	if(lanID==1){
		imgArray[0]="features";
		imgArray[1]="advantages";
		imgArray[2]="tools";
		imgArray[3]="how-its-works";
		imgArray[4]="success-stories";
		imgArray[5]="faq";	
	}else{
		imgArray[0]="features_pg";
		imgArray[1]="advantages_pg";
		imgArray[2]="tools_pg";
		imgArray[3]="how-its-works_pg";
		imgArray[4]="success-stories_pg";
		imgArray[5]="faq_pg";	
	}
	
	var divId="div"+Id;
	var imgId="loja"+Id;
	//alert(divId);
	if($(divId).style.display	==	'none'){
		for(var i = 1; i <= 6; i++){
			imgoff = 'loja'+i;
			imageName	= imgArray[i-1]+".gif";
			//alert("imageName=" + imageName);
			//alert("imgoff=" + imgoff);
			$(imgoff).src = "Images/"+imageName;
		}
		
		for(var i = 1; i <= 6; i++){
			div = 'div'+i;
			$(div).style.display	=	'none';
		}
		
		$(divId).style.display	=	'block';
		imgName=imgArray[Id-1]+"_mover.gif";
		$(imgId).src =	"Images/"+imgName;
	}else{
		$(divId).style.display	=	'none';
		imgName=imgArray[Id-1]+".gif";
		$(imgId).src =	"Images/"+imgName;
	}
}


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

function showSlidingDiv(divId){
	
	
	for(var i=1;i<=5;i++) {
		var faqid="#faqdiv"+i;
		if(i==divId)continue;
		jQuery(faqid).animate({"height": "hide"}, { duration: 500 });
	}
		var faqid="#faqdiv"+divId;	
		jQuery(faqid).animate({"height": "toggle"}, { duration: 500 });
	
}

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 __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;
	//alert(postStr);
	//return false;
	//$('divLoja').innerHTML = '<img src="./Images/ajax-loader2.gif" border="0" style="padding-left:25px;" />';
	general.makePOSTRequestCommon('ajaxposts.php?action=LOADLOJATABLE', postStr, 'divLoja');
}


function __fncSetTestimonial()
{
	general.makePOSTRequestCommon('ajaxposts.php?action=LOADLOJATESTIMONIAL', '', 'loja_testimonial');
}

function __fncShowPaymentdiv(id){ 	
	document.getElementById(id).style.background = '#444446';
}
function __fncChangeBGColor(id){
	document.getElementById(id).style.background = '#6D7276';
}
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 fncCloudComputingFlash(){
	general.makePOSTRequestCommon('ajaxposts.php?action=CLOUDCOMPUTINGFLSHSHOW', '','quicklookpopupajax');
}


function __fncCheckSaveNew(){
	if(trim($('txtName').value) == ''){
		$('txtName').className	=	'inputTextRed';
		$('tdDiv').className	=	'inputLabelRed';
		$('txtName').focus();
		return;
	}else{
		$('txtName').className	=	'inputText';
		$('tdDiv').className	=	'';
	}
	if((trim($('txtemail').value) == '') || (!isValidEmail($('txtemail').value))){
		$('txtemail').className	=	'inputTextRed';
		$('tdEmail').className	=	'inputLabelRed';
		$('txtemail').focus();
		return;
	}else{
		$('txtemail').className	=	'inputText';
		$('tdEmail').className	=	'';
	}
	
	
	if(trim($('txtComment').value) == ''){
		$('txtComment').className	=	'inputTextareatestRed';
		$('tdComment').className	=	'inputLabelRed';
		$('txtComment').focus();
		return;
	}else{
		$('txtComment').className	=	'inputTextareatest';
		$('tdComment').className	=	'';
	}
	thisForm.txtWhat2Do.value = 'SAVE';
	thisForm.submit();
}

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

function __fncCheckSaveDetails(strid) {
	if(trim($('txtName').value) == ''){
		$('txtName').className	=	'inputTextRed';
		$('tdName').className	=	'inputLabelRed';
		$('txtName').focus();
		return;
	}else{
		$('txtName').className	=	'inputText';
		$('tdName').className	=	'';
	}
	if((trim($('txtemail').value) == '') || (!isValidEmail($('txtemail').value))){
		$('txtemail').className	=	'inputTextRed';
		$('tdEmail').className	=	'inputLabelRed';
		$('txtemail').focus();
		return;
	}else{
		$('txtemail').className	=	'inputText';
		$('tdEmail').className	=	'';
	}
	
	
	if(trim($('txtComment').value) == ''){
		$('txtComment').className	=	'inputTextareatestRed';
		$('tdComment').className	=	'inputLabelRed';
		$('txtComment').focus();
		return;
	}else{
		$('txtComment').className	=	'inputTextareatest';
		$('tdComment').className	=	'';
	}
	thisForm.txtWhat2Do.value = 'UPDATE';
	thisForm.txtId.value = strid;
	thisForm.submit();
}

function __fncActivetOpening(strId, status){
	if(status == 'A'){
		return;
	}else{
		thisForm.status.value = 'A';
	}
	thisForm.txtWhat2Do.value = 'ACTIVATE';
	thisForm.txtId.value = strId;
	thisForm.submit();
}