function wanted_gametime(hours, minutes, runscript)
{		
    if(runscript == 'True')
    {
	    minutes += 1;
	    if(minutes > 59)
	    {
		    minutes = 0;
		    hours += 1;
	    }
	    if(hours > 23)
	    {
		    hours = 0;
	    }
    	
	    t_hours = hours;
	    t_minutes = minutes;
    	
    	
	    if(minutes < 10)
	    {
		    t_minutes = "0"+minutes;
	    }
	    if(hours < 10)
	    {
		    t_hours = "0"+hours;
	    }
    	
	    obj_gametimehours = document.getElementById('gametime_hours');
	    obj_gametimehours.innerHTML = t_hours;
    	
	    obj_gametimeminutes = document.getElementById('gametime_minutes');
	    obj_gametimeminutes.innerHTML = t_minutes;
    				
	    setTimeout("wanted_gametime("+hours+", "+minutes+", 'True')", 60000/4);		
    }
}

function readCookie(name) 
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) 
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

/* COOKIES */
var Cookies = {
	init: function () {
		var allCookies = document.cookie.split('; ');
		for (var i=0;i<allCookies.length;i++) {
			var cookiePair = allCookies[i].split('=');
			this[cookiePair[0]] = cookiePair[1];
		}
	},
	create: function (name,value,days) {
		if (days) {
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else var expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
		this[name] = value;
	},
	erase: function (name) {
		this.create(name,'',-1);
		this[name] = undefined;
	}
};
Cookies.init();


function popWindow(url, width, height)
{
	window.open(url, 'popup', 'width=' + width + ',height=' + height + ',scrollbars=yes,resizable=yes');
}