/**
 * Here was old javascript crap used on old version of itzone website,
 * now there are more-or-less just placeholders... They are supposed to not be
 * used but nobody knows, so it's just better, for 100% compatibility...
 *
 */
var PreloadFlag = false;
var expDays = 90;
var exp = new Date();
var tmp = '';
var tmp_counter = 0;
var tmp_open = 0;
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));


/**
 * Simply sets a cookie
 *
 */
function SetCookie(name, value)
{
	ITzone.cookie.set(name, value);
}

/**
 * Simply returns value of cookie
 *
 */
function GetCookie(name)
{
	ITzone.cookie.get(name);
}

/**
 * Switches visibility of one or two elements, and it could set cookie to save
 * whether has element been hidden or shown
 *
 */
function ShowHide(id1, id2, id3)
{
	var res = expMenu(id1);
	if (id2 != '') expMenu(id2);
	if (id3 != '') SetCookie(id3, res, exp);
}

/**
 * Switches visibility of item with specified id
 *
 */
function expMenu(id)
{
	return $('#' + id).toggle();
}

/**
 * Shows element with specified ID
 *
 */
function Show(id)
{
    return $('#' + id).show();
}

/**
 * Hides element with specified ID
 *
 */
function Hide(id)
{
	return $('#' + id).hide();
}

/**
 * Shows warning when user clicks on external link
 *
 */
function ShowExternLinkWarning(url)
{
	if (url.indexOf("http://" + document.domain) == 0 ||
		url.indexOf("https://" + document.domain) == 0)
	{
		window.open(url);
	}
	else if (confirm(ITzone.lang.externalLinkWarning + '\n\n' + ITzone.lang.reallyWantToResume))
	{
		window.open(url);
	}
	return false;
}
