function TableMonitoringSort(curPage, sortColumn, sortMethod)
{	
	$(document).ready(function() {
    window.setTimeout(function() {
    $('.skype_pnh_container').html('');
    $('.skype_pnh_print_container').removeClass('skype_pnh_print_container');
    }, 800);
    });
	gE('iLoader').style.display = 'block';	
	var oAjax;
	
	if (window.XMLHttpRequest)
	{
		oAjax = new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
		try 
		{
			oAjax = new ActiveXObject('Msxml2.XMLHTTP');
		} catch (e){}
		try 
		{
			oAjax = new ActiveXObject('Microsoft.XMLHTTP');
		} catch (e){}
	}

	if (oAjax)
	{
		oAjax.onreadystatechange = function()
		{
			if (oAjax.readyState == 4 && oAjax.status == 200) 
			{
				gE('iAjaxReplace').innerHTML = oAjax.responseText;				
				gE('iLoader').style.display 		= 'none';
				gE('iAjaxReplace').style.display 	= 'block';
				SetOverlay();
			}
		};		
		oAjax.open("GET", SITE_ROOT_INDEX + 'monitoring/index/'  + curPage + '/' + sortColumn + '/' + sortMethod + '/1/', true);
		//oAjax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		oAjax.send();
	}
	else
	{
		alert("AJAX not init!");
	}
}

function SearchMonitoring(in_real_demo)
{
	$(document).ready(function() {
    window.setTimeout(function() {
    $('.skype_pnh_container').html('');
    $('.skype_pnh_print_container').removeClass('skype_pnh_print_container');
    }, 800);
    });
    if (in_real_demo != '' && in_real_demo != undefined)
    {   
        if (in_real_demo == 'only_demo')
        {      
            $("#t_between").removeClass("between_active"); 
            $("#t_between").addClass("between");
            
            $("#t_real").removeClass("real_active"); 
            $("#t_real").addClass("real");
            
            $("#t_demo").removeClass("demo"); 
            $("#t_demo").addClass("demo_active");
            
            $("#t_right").removeClass("right"); 
            $("#t_right").addClass("right_active");
        }
        else
        {
            $("#t_between").removeClass("between"); 
            $("#t_between").addClass("between_active");
            
            $("#t_real").removeClass("real"); 
            $("#t_real").addClass("real_active");
            
            $("#t_demo").removeClass("demo_active"); 
            $("#t_demo").addClass("demo");
            
            $("#t_right").removeClass("right_active"); 
            $("#t_right").addClass("right");
        }
    }
    
	gE('iLoader').style.display = 'block';
	
	var in_account 			= gE('in_account').value;
        if(in_account == text)
            in_account = '';
	var real_demo 		    = in_real_demo;
	var in_s_rating 		= gE('in_s_rating').value;	
	var in_balance			= gE('in_balance').value;
	var in_equity			= gE('in_equity').value;
	var in_deals_market		= gE('in_deals_market').value;
	var in_total_deals		= gE('in_total_deals').value;
	var in_day_balance		= gE('in_day_balance').value;	
	var in_day_equity		= gE('in_day_equity').value;

	var list_page			= gE('list_page').value;
    	
    var show_only_pamm		= 0;    
    var chk_sop = $('#show_only_pamm').attr('checked');
    if (chk_sop && in_real_demo != 'only_demo')
    {
        show_only_pamm  = 1;
    }
    
    /*
    if (in_real_demo == 'only_real')
    {
        $("#chb_only_pamm").css("visibility", "visible");
    }
    else
    {
        $("#chb_only_pamm").css("visibility", "hidden");
    }
    */
    
	parameters = '';
	parameters += 'in_account=' 		+ in_account + "&";
	parameters += 'real_demo=' 		    + real_demo + "&";
	parameters += 'in_s_rating=' 		+ in_s_rating + "&";	
	parameters += 'in_balance=' 		+ in_balance + "&";
	parameters += 'in_equity=' 			+ in_equity + "&";
	parameters += 'in_deals_market=' 	+ in_deals_market + "&";
	parameters += 'in_total_deals=' 	+ in_total_deals + "&";
	parameters += 'in_day_balance=' 	+ in_day_balance + "&";	
	parameters += 'in_day_equity=' 		+ in_day_equity + "&";
    parameters += 'show_only_pamm=' 	+ show_only_pamm + "&";
	parameters += 'list_page=' 			+ list_page + "&";
	parameters += 'is_ajax=1';
	
	
	 //alert (parameters);

	
	var oAjax;
	
	if (window.XMLHttpRequest)
	{
		oAjax = new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
		try 
		{
			oAjax = new ActiveXObject('Msxml2.XMLHTTP');
		} catch (e){}
		try 
		{
			oAjax = new ActiveXObject('Microsoft.XMLHTTP');
		} catch (e){}
	}

	if (oAjax)
	{
		oAjax.onreadystatechange = function()
		{
			if (oAjax.readyState == 4 && oAjax.status == 200) 
			{
				gE('iAjaxReplace').innerHTML = oAjax.responseText;				
				gE('iLoader').style.display 		= 'none';
				gE('iAjaxReplace').style.display 	= 'block';
				onBlur("input#in_account");
				SetOverlay();
			}
		};		
		oAjax.open("POST", ROOT_HTTP + 'index.php/' + LANG + '/monitoring/', true);
		oAjax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		oAjax.send(parameters);
	}
	else
	{
		alert("AJAX not init!");
	}
}

function ResetSearch()
{
	$(document).ready(function() {
    window.setTimeout(function() {
    $('.skype_pnh_container').html('');
    $('.skype_pnh_print_container').removeClass('skype_pnh_print_container');
    }, 800);
    });
	gE('iLoader').style.display = 'block';
	
	var oAjax;
	
	if (window.XMLHttpRequest)
	{
		oAjax = new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
		try 
		{
			oAjax = new ActiveXObject('Msxml2.XMLHTTP');
		} catch (e){}
		try 
		{
			oAjax = new ActiveXObject('Microsoft.XMLHTTP');
		} catch (e){}
	}

	if (oAjax)
	{
		oAjax.onreadystatechange = function()
		{
			if (oAjax.readyState == 4 && oAjax.status == 200) 
			{
				gE('iAjaxReplace').innerHTML        = oAjax.responseText;				
				gE('iLoader').style.display 		= 'none';
				gE('iAjaxReplace').style.display 	= 'block';
				SetOverlay();
			}
		};		
		oAjax.open("POST", SITE_ROOT + LANG + '/monitoring/resetsearch/', true);
		oAjax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		oAjax.send();
	}
	else
	{
		alert("AJAX not init!");
	}
}


function SetOverlay()
{
	$(document).ready(function() {
    window.setTimeout(function() {
    $('.skype_pnh_container').html('');
    $('.skype_pnh_print_container').removeClass('skype_pnh_print_container');
    }, 800);
    });
	$(document).ready
	(
		function() 
		{
			var h = $("#iAjaxReplace").height() + 1;
			var w = $("#iAjaxReplace").width() + 1;
			$("#i_ui_overlay").height(h);
			$("#i_ui_overlay").width(w);
		}
	);	
}

function SearchMonitoringSmall(in_real_demo)
{
	$(document).ready(function() {
        window.setTimeout(function() {
    $('.skype_pnh_container').html('');
    $('.skype_pnh_print_container').removeClass('skype_pnh_print_container');
    }, 800);
    });
    if (in_real_demo != '' && in_real_demo != undefined)
    {
        if (in_real_demo == 'only_demo')
        {
            $("#t_between").removeClass("between_active");
            $("#t_between").addClass("between");

            $("#t_real").removeClass("real_active");
            $("#t_real").addClass("real");

            $("#t_demo").removeClass("demo");
            $("#t_demo").addClass("demo_active");

            $("#t_right").removeClass("right");
            $("#t_right").addClass("right_active");
        }
        else
        {
            $("#t_between").removeClass("between");
            $("#t_between").addClass("between_active");

            $("#t_real").removeClass("real");
            $("#t_real").addClass("real_active");

            $("#t_demo").removeClass("demo_active");
            $("#t_demo").addClass("demo");

            $("#t_right").removeClass("right_active");
            $("#t_right").addClass("right");
        }
    }

	gE('iLoader').style.display = 'block';

	var in_account 			= gE('in_account').value;
	var real_demo                   = in_real_demo;
	var in_s_rating 		= gE('in_s_rating').value;
	var in_balance			= gE('in_balance').value;

	parameters = '';
	parameters += 'in_account=' 		+ in_account + "&";
	parameters += 'real_demo=' 		    + real_demo + "&";
	parameters += 'in_s_rating=' 		+ in_s_rating + "&";
	parameters += 'in_balance=' 		+ in_balance + "&";


	 //alert (parameters);


	var oAjax;

	if (window.XMLHttpRequest)
	{
		oAjax = new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
		try
		{
			oAjax = new ActiveXObject('Msxml2.XMLHTTP');
		} catch (e){}
		try
		{
			oAjax = new ActiveXObject('Microsoft.XMLHTTP');
		} catch (e){}
	}

	if (oAjax)
	{
		oAjax.onreadystatechange = function()
		{
			if (oAjax.readyState == 4 && oAjax.status == 200)
			{
				gE('iAjaxReplace').innerHTML = oAjax.responseText;
				gE('iLoader').style.display 		= 'none';
				gE('iAjaxReplace').style.display 	= 'block';
				SetOverlay();
			}
		};
		oAjax.open("POST", ROOT_HTTP + 'index.php/' + LANG + '/monitoring/indexSmallAjax/', true);
		oAjax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		oAjax.send(parameters);
	}
	else
	{
		alert("AJAX not init!");
	}
}

function ResetSearchSmall()
{
	$(document).ready(function() {
    window.setTimeout(function() {
    $('.skype_pnh_container').html('');
    $('.skype_pnh_print_container').removeClass('skype_pnh_print_container');
    }, 800);
    });
	gE('iLoader').style.display = 'block';

	var oAjax;

	if (window.XMLHttpRequest)
	{
		oAjax = new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
		try
		{
			oAjax = new ActiveXObject('Msxml2.XMLHTTP');
		} catch (e){}
		try
		{
			oAjax = new ActiveXObject('Microsoft.XMLHTTP');
		} catch (e){}
	}

	if (oAjax)
	{
		oAjax.onreadystatechange = function()
		{
			if (oAjax.readyState == 4 && oAjax.status == 200)
			{
				gE('iAjaxReplace').innerHTML        = oAjax.responseText;
				gE('iLoader').style.display 		= 'none';
				gE('iAjaxReplace').style.display 	= 'block';
				SetOverlay();
			}
		};
		oAjax.open("POST", SITE_ROOT + LANG + '/monitoring/resetsearch/1/1/', true);
		oAjax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		oAjax.send();
	}
	else
	{
		alert("AJAX not init!");
	}
}

function TableMonitoringSortSmall(curPage, sortColumn, sortMethod)
{	
	$(document).ready(function() {
    window.setTimeout(function() {
    $('.skype_pnh_container').html('');
    $('.skype_pnh_print_container').removeClass('skype_pnh_print_container');
    }, 800);
    });
	gE('iLoader').style.display = 'block';	
	var oAjax;
	
	if (window.XMLHttpRequest)
	{
		oAjax = new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
		try 
		{
			oAjax = new ActiveXObject('Msxml2.XMLHTTP');
		} catch (e){}
		try 
		{
			oAjax = new ActiveXObject('Microsoft.XMLHTTP');
		} catch (e){}
	}

	if (oAjax)
	{
		oAjax.onreadystatechange = function()
		{
			if (oAjax.readyState == 4 && oAjax.status == 200) 
			{
				gE('iAjaxReplace').innerHTML = oAjax.responseText;				
				gE('iLoader').style.display 		= 'none';
				gE('iAjaxReplace').style.display 	= 'block';
				SetOverlay();
			}
		};		
		oAjax.open("GET", SITE_ROOT_INDEX + 'monitoring/indexSmallAjax/'  + curPage + '/' + sortColumn + '/' + sortMethod + '/', true);
		//oAjax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		oAjax.send();
	}
	else
	{
		alert("AJAX not init!");
	}
}

$(document).ready
	(
		function() 
		{
			SetOverlay();
		}
	);
