/**
 * Old javascript crap used on old version of itzone website,
 * some of this stuff is still required (just while new version is in
 * development stage, slowly - slowly is unnecessary crap gonna be bounced
 * and neccessary stuff is gonna be rewrited as some nice part of Page object)
 *
 */
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();
}
