﻿var win;

var performAjaxCall = function (url, data) {
	//	var response = $.ajax({
	//		type: "POST",
	//		url: url,
	//		data: data,
	//		contentType: "application/x-www-form-urlencoded",
	//		//dataType: "json",
	//		async: false
	//	}).responseText;

	//	//return jQuery.parseJSON(response);
	//	return response;
    
	var response = $.post(url, data);
	return response;
};

$.keenAjax = function(settings) {
    if (!settings.contentType)
        settings.contentType = 'application/json; charset=utf-8';
    if (!settings.type)
        settings.type = 'POST';
    if (settings.data && typeof settings.data != 'string')
        settings.data = JSON.stringify(settings.data);
       
    $.ajax(settings);
};


function PopUp(url, winName, features) {
	remote = window.open(url, winName, features);
	if (remote.opener == null) remote.opener = window;
	remote.opener.name = "opener";
	remote.focus();
}

function MemberPhotoPopup(height, width, strUrl, resetCookies, windowName, windowParameters) {
	var strHeight = (height + 125);
	var strWidth = 150;
	var settings;
	
	if (width > strWidth) {
		strWidth = (width + 30);
	}

	if (!win || win.closed) {
		//setting the cookies (bug 36383)
		if (resetCookies == "1") {
			document.cookie = "MPhV=1;path=/";
		}

		settings = "height=" + strHeight + ",width=" + strWidth + "," + windowParameters;

		win = window.open(strUrl, windowName, settings);
		win.focus();
	}
	else {
		win.focus();
	}
}

$.keenAjax = function (settings) {
    if (!settings.contentType)
        settings.contentType = 'application/json; charset=utf-8';
    if (!settings.type)
        settings.type = 'POST';
    if (settings.data && typeof settings.data != 'string')
        settings.data = JSON.stringify(settings.data);

    $.ajax(settings);
};

