﻿
function jumpPage(basepage, pageCount, suffix) {
	if (!document.getElementById('txtPager').value > pageCount) {
		window.location = basepage + document.getElementById('txtPager').value + suffix;
	} 
} function print() {
	var disp_setting = "toolbar=no,location=yes,directories=no,menubar=no,"; disp_setting += "scrollbars=yes,width=680, height=600, left=100, top=25, resizable=yes"; var content_vlue = document.getElementById("print_content").innerHTML; var docprint = window.open("", "", disp_setting); docprint.document.open(); docprint.document.write('<html><head><title>Print</title>'); docprint.document.write(String.format('<link rel="stylesheet" href="{0}assets/css/styles.css" type="text/css" />', getApplicationURL())); docprint.document.write('</head><body style="padding:20px;" onLoad="self.print()">'); docprint.document.write(content_vlue); docprint.document.write('</body></html>');
	docprint.document.close(); docprint.focus();
}
function CheckAll(checkAllBox) {
	var frm = document.aspnetForm; var chkState = checkAllBox.checked;
	for (i = 0; i < frm.length; i++) { e = frm.elements[i]; if (e.type == 'checkbox' && e.name.indexOf('Id') != -1) { e.checked = chkState; } } 
} function CheckChanged() { var frm = document.aspnetForm; var boolAllChecked; boolAllChecked = true; for (i = 0; i < frm.length; i++) { e = frm.elements[i]; if (e.type == 'checkbox' && e.name.indexOf('Id') != -1) { if (e.checked == false) { boolAllChecked = false; break; } } } for (i = 0; i < frm.length; i++) { e = frm.elements[i]; if (e.type == 'checkbox' && e.name.indexOf('checkAll') != -1) { if (boolAllChecked == false) { e.checked = false; } else { e.checked = true; } break; } } } function fadeInfadeOutAnimation(context) { context.fadeIn(400).fadeOut(400).fadeIn(400).fadeOut(400).fadeIn(400); } function IsValidEmail(email) { var filter = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; return filter.test(email); } var yaxisOffset = 100;


var modalContainerClass = 'generic-dialog';
var getCenterYPosition = function($object) 
{
var height = ($(window).height() - $object.height()) / 2 + $(window).scrollTop() - yaxisOffset + 'px'; return height;}; 
var getCenterXPosition = function($object) { var width = ($(window).width() - $object.width()) / 2 + $(window).scrollLeft() + 'px'; return width; }

function getQuerystringParamValue(key, default_)
{
    if (default_ == null) default_ = "";
    var keyInLower = key.toLowerCase();
    var url = window.location.href;
    var urlInLower = url.toLowerCase();
	key = key.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
	var regex = new RegExp("[\\?&]" + keyInLower + "=([^&#]*)");
	var qs = regex.exec(urlInLower);
	if (qs == null)
		return default_;
	else
		return qs[1];
}

var Communifire = {};
if (typeof (Communifire) == undefined || Communifire == null) { Communifire = {}; }
Communifire.Enum = function() {

};
if (typeof (Communifire.Enum) == undefined || Communifire.Enum == null) { Communifire.Enum = {}; }


Communifire.Enum.UserLoginStatus =
        {
        	InvalidCredentials: 0,
        	Success: 1,
        	AccountPending: 2,
        	AccountBanned: 3,
        	AccountDisapproved: 4,
        	EmptyUserNameOrPassword: 5
        }
