
/*##################################*/

window.PATH_BASE = '/';
window.PATH_TPL_IMG = '/templates/gfx/';

/*##################################*/

$(document).ready(
	function()
	{
		//########### NyroModal Config #########

		$.fn.nyroModal.settings.debug = false;

		$.fn.nyroModal.settings.minWidth = 50;
		$.fn.nyroModal.settings.minHeight = 50;

		//$.fn.nyroModal.settings.css.content = {'overflow': 'hidden'};

		//jQuery.fx.off = true;

		//######################################
	}
);


/*##################################*/

function preloadImg(image)
{
	var img = new Image();
	img.src = image;
}

/*##################################*/


function go_url(url)
{
	document.location.href = url;
}

function parent_go_url(url)
{
	window.parent.location.href = url;
}

function opener_go_url(url)
{
	window.opener.location.href = url;
}

function page_reload()
{
	document.location.reload()
}

function open_url(url, name)
{
	window.open(url, name);
}

/*##################################*/

String.prototype.trim = function()
{
	return this.replace(/^\s+|\s+$/g,"");
}

/*##################################*/

// Pop-up window

function popUpWindow(file, window_name, scrollbars, statusbar, resizable, width, height, left, top)
{
	return window.open(file, window_name, 'scrollbars='+scrollbars+', statusbar='+statusbar+', resizable='+resizable+', width='+width+', height='+height+', left='+left+', top='+top);
}

/*##################################*/

function Dump(d, l)
{
    if (l == null) l = 1;

	var s = '';
    
	if (typeof(d) == "object")
	{
        s += typeof(d) + " {\n";

        for (var k in d)
		{
            for (var i=0; i<l; i++) s += "  ";

			s += k+": " + Dump(d[k],l+1);
        }

		for (var i=0; i<l-1; i++) s += "  ";
        
		s += "}\n"
    }
	else
	{
        s += "" + d + "\n";
    }
    
	return s;
}

/*##################################*/

function is_num(val)
{
	return /^-?\d+$/.test(val);
}

/*##################################*/