function dog( winner, time, type ) {
	if(navigator.cookieEnabled || typeof(navigator.cookieEnabled) != 'undefined')
	{
		type = typeof(type) != 'undefined' ? type : 'winner' ;
		
		var date = new Date();
		date.setTime( date.getTime() + (time*1000) );
		var expires = '; expires=' + date.toGMTString();
		
		if( type == 'draw' )
		{
			document.cookie = 'winner=x' + expires + '; path=/';
		}
		else if( type == 'winner' )
		{
			document.cookie = 'winner='+ winner + expires + '; path=/';
		}
		
		window.location.reload();
	}
};

function imagePreview( id, el ) {
	var imgObj = document.getElementById(id);
	
	var pos = 0;
	if (window.innerHeight)
	{
		pos = window.pageYOffset
	}
	else if (document.documentElement && document.documentElement.scrollTop)
	{
		pos = document.documentElement.scrollTop
	}
	else if (document.body)
	{
		pos = document.body.scrollTop
	}
	
	imgObj.style.top = pos + 'px';
	imgObj.style.display = 'block';
};
function imgPrevClose( id ) {
	var imgObj = document.getElementById(id);
	imgObj.style.display = 'none';
};