
var viewportWidth,viewportHeight;


// http://www.jr.pl/www.quirksmode.org/viewport/compatibility.html
function getViewport() {
    var x,y;
    if (self.innerHeight) // all (inc. Wii, except netgem) except Explorer (except IE8)
    {
        x = self.innerWidth;
        y = self.innerHeight;
    }
    else if (document.documentElement && document.documentElement.clientHeight)
    // Explorer 6 Strict Mode
    {
        x = document.documentElement.clientWidth;
        y = document.documentElement.clientHeight;
    }
    else if (document.body) // other Explorers
    {
        x = document.body.clientWidth;
        y = document.body.clientHeight;
        if (y==0) {
            // netgem comes in here (only shows viewport values when everything fits on the page)
            x = document.body['clientWidth'];
            y = document.body['clientHeight'];
        }
    }
    viewportWidth = x;
    viewportHeight = y;
}

// http://www.quirksmode.org/js/cookies.html
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;
}

