﻿		
		
function sendSubscribeEmail(btn)
{
    _gaq.push(['_trackEvent', 'USER', 'Click','AddSubscriber']);
    return __doCustomPostBack('addSubscriber', $(btn).prev().val() ,false,'');
}

function initMediaGallery() {
	$("a[rel^='prettyPhoto']").prettyPhoto({
		animationSpeed: 'fast', /* fast/slow/normal */
		padding: 40, /* padding for each side of the picture */
		opacity: 0.35, /* Value betwee 0 and 1 */
		showTitle: false, /* true/false */
		wmode: 'window',                
		showDescription: false,
		supports_video_tag: IS_HTML5_VIDEO_READY,
		allowresize: true, /* true/false */
		counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
		theme: 'facebook', /* light_rounded / dark_rounded / light_square / dark_square */
		hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
		modal: false, /* If set to true, only the close button will close the window */
		changepicturecallback: function() { }, /* Called everytime an item is shown/changed */
		callback: function() { } /* Called when prettyPhoto is closed */
	});
}

function __doCustomPostBack(targetMethod, targetMethodArgument, mustConfirm, confirmMessage)
{
	if (mustConfirm == undefined || !mustConfirm || (mustConfirm && confirm(confirmMessage))) {
		$('#__TARGETMETHOD').val(targetMethod);
		$('#__TARGETMETHODARGUMENT').val(targetMethodArgument);
		$('#aspnetForm').submit();
		return true;
	} else {
		return false;
	}
}

function pageMethod(fn, params, successFn, errorFn) {  
	//var pagePath = window.location.pathname;  
	var pagePath = '/root/signup.aspx';
	
	var jsonData = $.toJSON(params);
	
	$.ajax({  
		type: "POST",  
		url: pagePath + "/" + fn,  
		contentType: "application/json; charset=utf-8",  
		data: jsonData,  
		dataType: "json",  
		success: successFn,  
		error: errorFn  
	});
}

