/*------------------------------------------------------------------------------*/
jQuery.fn.exists = function(){
	return jQuery(this).length>0;
}

/*------------------------------------------------------------------------------*/
function setCookie(c_name,value,expiredays)
{
	$.cookie(c_name, value, { path: '/', expires: expiredays });
}

/*------------------------------------------------------------------------------*/
function getCookie(c_name)
{
	return $.cookie(c_name, undefined, { path: '/'});
}

/*------------------------------------------------------------------------------*/
function rand(min, max) 
{   
	var argc = arguments.length;
	if (argc === 0) 
	{
		min = 0;
		max = 2147483647;
	} 
	else if (argc === 1) 
	{
		throw new Error('Warning: rand() expects exactly 2 parameters, 1 given');
	}
	return Math.floor(Math.random() * (max - min + 1)) + min;
}

/*------------------------------------------------------------------------------*/
//DEPRECATED
function IFrameAutoHeight(the_iframe) 
{
    if(the_iframe.contentWindow)
    {
		the_iframe.height = the_iframe.contentWindow.document.body.scrollHeight + 10;
    }
}
