﻿Type.registerNamespace("SoftAINCMS");

SoftAINCMS.ShowPaymentDialog = function(objectType, objectId)
{
	document.getElementById('Site_SoftAINCMSPaymentType').value = objectType;
	document.getElementById('Site_SoftAINCMSPaymentObject').value = objectId;
	
		
	__doPostBack('Site$SoftAINCMSPaymentButton', '');
}

SoftAINCMS.SendEmail = function(senderName, senderEmail, emailBody, callback)
{
	if (senderName.length == 0) 
	{
		alert("Введите имя");
		return;
	}
	
	if (senderEmail.length == 0) 
	{
		alert("Введите Email");
		return;
	}
	
	if (emailBody.length == 0) 
	{
		alert("Введите текст сообщения");
		return;
	}
	
	$.post('/Modules/Service/EmailSenderService.ashx', { name: senderName, email: senderEmail, body: emailBody }, function(data) { if (typeof(callback) != 'undefined') callback(data); else alert('' + data); });
}

SoftAINCMS.EmailSent = function(data)
{
	var sendFormContainer = document.getElementById("EmailSenderContainer");
	
	if (sendFormContainer) $(sendFormContainer).html(data);
}


if (typeof(Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();
