var b= navigator.userAgent.toLowerCase();
var $ = {

	browser: {
		version: (b.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1],
		safari: /webkit/.test(b),
		opera: /opera/.test(b),
		msie: /msie/.test(b) && !/opera/.test(b),
		mozilla: /mozilla/.test(b) && !/(compatible|webkit)/.test(b)
	}
};



if(typeof g_windowWidth == 'undefined' || typeof g_windowHeight == 'undefined'){
	var g_windowWidth = ($.browser.msie && parseInt($.browser.version) <= 6) ? 1010 :1014;
	var g_windowHeight = ($.browser.msie && parseInt($.browser.version) <= 6) ? 696 :700;
}

function getTimestamp()
{
	var dateObj = new Date();
	return dateObj.getTime();
}

if(typeof openwindow == 'undefined') {
function openwindow(url) {
g_windowHeight = $.browser.safari ? 704 : g_windowHeight;
var yPos = (screen.availHeight-g_windowHeight) / 2;
var xPos  = (screen.availWidth-g_windowWidth) / 2;
g_ZDFmediathekWindow = window.open(url, "ZDFmediathek" + getTimestamp(), "width="+g_windowWidth+",height="+g_windowHeight+",left="+xPos+",top="+yPos+",location=no,menubar=no,resizable=yes,toolbar=no");
if(g_ZDFmediathekWindow)
g_ZDFmediathekWindow.focus();
}
}
if(typeof openFullWindow == 'undefined') {
function openFullWindow(url) {
var win = window.open(url, "ZDFmediathek2", "left=0,top=0,location=yes,menubar=yes,resizable=yes,toolbar=yes,scrollbars=yes");
if(win)
win.focus();
}
}
var g_window = {
resizeTo: function(width,height){
if(g_oldSafari) {
height += 20;
window.resizeTo(width,height);
} else if (self.innerHeight)
{
self.innerWidth = width;
self.innerHeight = height;
}
else
{
if(navigator.userAgent.indexOf('NT 6.0') != -1) {
width += 10;
height += 62;
}
window.resizeTo(width,height);
}
},
getInner: function(){
var x,y;
if (self.innerHeight)
{
x = self.innerWidth;
y = self.innerHeight;
}
else if (document.documentElement && document.documentElement.clientHeight)
{
x = document.documentElement.clientWidth;
y = document.documentElement.clientHeight;
}
else if (document.body)
{
x = document.body.clientWidth;
y = document.body.clientHeight;
}
return [x,y];
}
};

