function TV2_Theme() {
    this.name="";
    var p="http://inc.tv2.dk/img/top/";
    this.logoafile=p+"logo.gif";
    this.logobfile=p+"tv2dk.gif";
    this.topflash=p+"top.swf";
    this.topstatic=p+"top.jpg";
    this.bgcolor="740000";
    this.hovercolor="A72600";
    this.bodycolor="FFFFFF";
    this.width=760;
    this.site=window.location.hostname;
    this.set=Theme_set;
    this.setupFiles=Theme_setupFiles;
    this.topwidth2=0;
}
function Theme_set(name) {
    this.name="_"+name;
    this.setupFiles();
    switch (name) {
    case "finans":
        this.bgcolor="003265";
        this.hovercolor="215197";
        break;
    case "marked":
        this.bgcolor="0E672D";
        this.hovercolor="188E3B";
        break;
    case "mobil":
        this.bgcolor="478F02";
        this.hovercolor="5CB030";
        break;
    case "nyhederne":
        this.bgcolor="61060F";
        this.hovercolor="40181B";
        break;
    case "aktiespil":
        var p="http://inc.tv2.dk/img/top/";
        this.logoafile=p+"logo_spil.gif";
        this.topflash=p+"top_aktiespil_flex.swf";
        this.topflash2=p+"top_aktiespil_logo_flex.swf";
        this.topstatic=p+"top_aktiespil_flex.gif";
        this.topstatic2=p+"top_aktiespil_logo_flex.gif";
        this.topwidth2=103;
    case "spil":
        this.bgcolor="416989";
        this.hovercolor="508CAE";
        break;
    case "sporten":
        this.bgcolor="006699";
        this.hovercolor="1F85B6";
        break;
    case "tv":
        this.bgcolor="552A40";
        this.hovercolor="6C3551";
        break;
    case "jeopardy":
        this.bgcolor="006699";
        this.hovercolor="1F85B6";
        break;
    case "frizonen":
        this.bgcolor="83471C";
        this.hovercolor="A15621";
        break;
	case "zulu":
		this.bgcolor="87B783";
		this.hovercolor="528E5A";
		break;
    default:
        this.name=name;
        this.setupFiles();
        this.bgcolor="740000";
        this.hovercolor="A72600";
    }
}
function Theme_setupFiles() {
    var pf=(arguments.length==1?arguments[0]:(this.width==580?"_small":""));
    var p="http://inc.tv2.dk/img/top/";
    this.logoafile=p+"logo"+this.name+".gif";
    this.topflash=p+"top"+this.name+pf+".swf";
    this.topstatic=p+"top"+this.name+pf+".jpg";
}

var fd_reqVer = 5;
if (typeof(reqFlashVer)=="number") fd_reqVer = reqFlashVer;
var fd_minVer = 2;
var fd_maxVer = 7;
for (var i = fd_minVer; i<=fd_maxVer; i++) {
    eval('var fd_flash' + i + 'Installed = false;');
}
var fd_ver = 0;
var fd_ok = false;
var fd_isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var fd_isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;

if (fd_isIE && fd_isWin) {
    for (var i = fd_maxVer; i>=fd_minVer; i--) {
        document.write('<SCR' + 'IPT LANGUAGE="VBScript"\> \n');
        document.write('on error resume next \n');
        document.write('fd_flash' + i + 'Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.' + i + '"))) \n');
        document.write('</SCR' + 'IPT\> \n');
        if (eval('fd_flash' + i + 'Installed')) i = 0;
    }
}

function fd_detect() {
    if (navigator.plugins) {
        if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
            var fd_ver2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
            var fd_desc = navigator.plugins["Shockwave Flash" + fd_ver2].description;
            var fd_verNum = parseInt(fd_desc.charAt(fd_desc.indexOf(".")-1));
            for (var i = fd_minVer; i<=fd_maxVer; i++) {
                eval('fd_flash' + i + 'Installed = (fd_verNum==i);');
            }
            eval('fd_flash' + fd_maxVer + 'Installed = (fd_verNum >= fd_maxVer);');
        }
    }
    for (var i = fd_minVer; i<=fd_maxVer; i++) {
        if (eval('fd_flash' + i + 'Installed==true')) fd_ver = i;
    }
    if (navigator.userAgent.indexOf("WebTV") != -1) fd_ver = 3;
    if (fd_ver >= fd_reqVer) fd_ok = true;
}

/*
Plugin Detector()

Source: Webmonkey Code Library
(http://www.hotwired.com/webmonkey/javascript/code_library/)

Author: Nadav Savio
Author Email: webmonkey@giantant.com

*/

// this is where we write out the VBScript for MSIE Windows
var WM_startTagFix = '</';
var msie_windows = 0;
if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1)){
  msie_windows = 1;
  document.writeln('<script language="VBscript">');
  document.writeln('\'This will scan for plugins for all versions of Internet Explorer that have a VBscript engine version 2 or greater.');
  document.writeln('\'This includes all versions of IE4 and beyond and some versions of IE 3.');
  document.writeln('Dim WM_detect_through_vb');
  document.writeln('WM_detect_through_vb = 0');
  document.writeln('If ScriptEngineMajorVersion >= 2 then');
  document.writeln('  WM_detect_through_vb = 1');
  document.writeln('End If');
  document.writeln('Function WM_activeXDetect(activeXname)');
  document.writeln('  on error resume next');
  document.writeln('  If ScriptEngineMajorVersion >= 2 then');
  document.writeln('     WM_activeXDetect = False');
  document.writeln('     WM_activeXDetect = IsObject(CreateObject(activeXname))');
  document.writeln('     If (err) then');
  document.writeln('        WM_activeXDetect = False');
  document.writeln('     End If');
  document.writeln('   Else');
  document.writeln('     WM_activeXDetect = False');
  document.writeln('   End If');
  document.writeln('End Function');
  document.writeln(WM_startTagFix+'script>');
}

function WM_pluginDetect(plugindescription, pluginxtension, pluginmime, activeXname){

  //This script block will test all user agents that have a real plug-in array

  //(i.e. Netscape) and set the variables, otherwise it directs the routine

  // to WM_activeXDetect to detect the activeX control.

  

  // First define some variables
  var i,plugin_undetectable=0,detected=0, daPlugin=new Object();


  // Then we check to see if it's an MSIE browser that you can actually

  // check for the plugin in question. 

  if (msie_windows && WM_detect_through_vb){
      plugin_undetectable = 0;
  } else {
      plugin_undetectable = 1;
  }



  // If it has a real plugins or mimetypes array, we look there for the plugin first

  if(navigator.plugins) {
      numPlugins = navigator.plugins.length;
      if (numPlugins > 1) {
	  if (navigator.mimeTypes && navigator.mimeTypes[pluginmime] && navigator.mimeTypes[pluginmime].enabledPlugin && (navigator.mimeTypes[pluginmime].suffixes.indexOf(pluginxtension) != -1)) { // seems like we have it, let's just make sure and check the version (if specified)
	      if ((navigator.appName == 'Netscape') && (navigator.appVersion.indexOf('4.0') != -1)) { // stupid, stupid Netscape can't handle the references to navigator.plugins by number, sooo...
		  for(i in navigator.plugins) {
		      if ((navigator.plugins[i].description.indexOf(plugindescription) != -1) || (i.indexOf(plugindescription) != -1)) { // some versions of quicktime have no description. feh!
			  detected=1;
			  break;
		      }
		  }
	      } else {
		  for (i = 0; i < numPlugins; i++) {
		      daPlugin = navigator.plugins[i];
		      if ((daPlugin.description.indexOf(plugindescription) != -1) || (daPlugin.name.indexOf(plugindescription) != -1)) {
			  detected=1;
			  break;
		      }
		  }
	      }

	      // Mac weirdness
      if (navigator.mimeTypes[pluginmime] == null) {
		  detected = 0;
	      }
	  }
	  return detected;
      } else if((msie_windows == 1) && !plugin_undetectable){
	  return WM_activeXDetect(activeXname);
      } else { 		
	  return 0;
      }
  } else {
      return 0;
  }
}


// this next function just makes it easy to detect the common plugins

function WM_easyDetect(whichPlugin) {

    // this function just makes it easy to do basic plug-in detection without

    // knowing all the mimetypes and activeX names and such
    var isItThere = 0;
    if( (whichPlugin == 'flash') || (whichPlugin == 'Flash') ) {
	isItThere = WM_pluginDetect('Flash', 'swf', 'application/x-shockwave-flash', 'ShockwaveFlash.ShockwaveFlash');
    } else if( (whichPlugin == 'director') || (whichPlugin == 'Director') ) {
	isItThere = WM_pluginDetect('Shockwave', 'dcr', 'application/x-director', 'SWCtl.SWCtl.1');
    } else if( (whichPlugin == 'quicktime') || (whichPlugin == 'Quicktime') || (whichPlugin == 'QuickTime') ) {
	isItThere = WM_pluginDetect('QuickTime', 'mov', 'video/quicktime', '');
    } else if( (whichPlugin == 'realaudio') || (whichPlugin == 'Realaudio') || (whichPlugin == 'RealAudio') ) {
	isItThere = (WM_pluginDetect('RealPlayer', 'rpm', 'audio/x-pn-realaudio-plugin', 'RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)')) || (WM_pluginDetect('RealPlayer', 'rpm', 'audio/x-pn-realaudio-plugin','rmocx.RealPlayer G2 Control')) || (WM_pluginDetect('RealPlayer', 'rpm', 'audio/x-pn-realaudio-plugin','RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)')) || (WM_pluginDetect('RealPlayer', 'rpm', 'audio/x-pn-realaudio-plugin','RealVideo.RealVideo(tm) ActiveX Control (32-bit)'))
    } else {

	alert('You need to tell me which plug-in to look for, like so:\n\n' + '          WM_easyDetect(\'flash\')\n\n' + '          WM_easyDetect(\'director\')\n\n' + '          WM_easyDetect(\'quicktime\')\n\n' + '          WM_easyDetect(\'realaudio\')');
    }
    return isItThere;
}

function TV2_BrowserDetector() {
    this.name=navigator.appName+" "+navigator.appVersion;
    this.ver=navigator.appVersion.substring(0,1);
    this.ua=navigator.userAgent;
    this.isPhoe=(this.ua.indexOf('Phoenix')>-1);
    this.isNS=(!this.isPhoe&&(this.name.indexOf('Netscape')>-1));
    this.isNS4=!!document.layers;
    this.isGecko=(this.ua.indexOf('Gecko')>-1);
    this.isOpera=(this.ua.indexOf('Opera')>-1);
    this.isIE=(this.name.indexOf('MSIE')>-1 && !this.isOpera);
    this.IEVer=(this.isIE?parseFloat(this.ua.substr(this.ua.indexOf('MSIE')+5,3)):"na");
    this.isIE6=(this.isIE && this.IEVer>=6);
    if (this.isIE) this.ver=this.IEVer;
    this.isKonq=(this.ua.indexOf('Konqueror')>-1);    
    this.onWin=(this.ua.indexOf('Windows')>-1 ? true : (this.ua.indexOf('WinNT')>-1));
    this.onWinCE=(this.name.indexOf('Windows CE')>-1);
    this.onWinXP=(this.ua.indexOf('NT 5.1')>-1?true:(this.ua.indexOf('Windows XP')>-1));
    this.onMac=(this.name.indexOf('Mac')>-1);
    this.onLinux=(this.ua.indexOf('Linux')>-1);
    this.isIE6XP=(this.isIE6 && this.onWinXP);
    this.srSize=window.screen;
    if ((typeof(this.srSize)!="undefined")&&(this.srSize!=null)) {
        this.srW=this.srSize.width; 
        this.srH=this.srSize.height;
        this.srCD=this.srSize.colorDepth;
        if (this.isNS&&(this.ver>=4)) this.srCD=this.srSize.pixelDepth;
    } else {
        this.srW=this.srH=this.srCD="na";
    }   
    this.dom=!!document.getElementById;
    this.java=navigator.javaEnabled();
    this.cookie=(!this.isPhoe&&(typeof(navigator.cookieEnabled)!='undefined'))?navigator.cookieEnabled:"na";
    var d=new Date();
    this.timezone=d.getTimezoneOffset()/-60;
    this.lang=(((this.isNS&&this.ver>=4)||this.isOpera)?navigator.language:((this.isIE&&this.ver>=4)?navigator.userLanguage:"na"));
    this.refURL=escape(document.referrer);
    this.refURL=(this.refURL.length>=252?this.refURL.substring(0,252)+"...":this.refURL);
    this.conn=this.home="na";
    this.getConn=BrowserDetector_getConn;
    this.isHome=BrowserDetector_isHome;
}

function BrowserDetector_getConn() {
	if (typeof(document.body)!="undefined") {
    	if (this.isIE&&this.ver>=5&&!this.onMac&&!this.isOpera) {
    	    document.body.addBehavior("#default#clientCaps");
    	    this.conn=document.body.connectionType;
    	}
    }
    return (this.conn);
}

function BrowserDetector_isHome() {
	if (typeof(document.body)!="undefined") {
    	if (this.isIE&&this.ver>=5&&!this.onMac&&!this.isOpera) {
    	    document.body.addBehavior("#default#homePage");
    	    this.home=document.body.isHomePage(location.href);
    	}
    }
    return (this.home);
}


function getCookie(name) {
    var index = document.cookie.indexOf(name + "=");
    if (index == -1) return null;
    index += name.length + 1;
    var endval = document.cookie.indexOf(";", index);
    if (endval == -1)
        return unescape(document.cookie.substring(index))
    else
        return unescape(document.cookie.substring(index, endval));
}

function getCookieExpire(duration){
    var expireDay = new Date();
    expireDay.setTime(expireDay.valueOf()+duration*24*60*60*1000);
    return expireDay.toUTCString();
}

function setCookie(name,value,duration){
    var cookiestr = name+'='+escape(value)+';';
    if (duration!=null) {
     cookiestr += 'EXPIRES='+getCookieExpire(duration)+';';
    }
    cookiestr += 'path=/;domain=.tv2.dk;';
    document.cookie = cookiestr;
}

function TV2Page(browser, theme, features) {
    this.browser=browser;
    this.theme=theme;
    this.showtop=this.showpagebegin=this.showpageend=this.showbottom=this.stats=true;
    this.tablelayout=(this.browser.isNS4?'':' style="table-layout: fixed"');
    if (features!=null) {
        for (var i=0;i<features.length;i++) {
            var feature=features[i].toLowerCase();
            var x=feature.indexOf("=");
            if (x<feature.length-1) {
                var key=feature.substring(0,x);
                var value=feature.substring(x+1);
                if (key=="showtop"||key=="showbottom"||key=="showpagebegin"||key=="showpageend"||key=="stats") {
                    eval("this."+key+"=(value==\"true\");");
                }
            }
        }
    }
    this.getTop=Page_getTop;
    this.getBottom=Page_getBottom;
    this._getTopHtml=_Page_getTopHtml;
    this._getTopNavigation=_Page_getTopNavigation;
    this._getPageBegin=_Page_getPageBegin;
    this._getPageEnd=_Page_getPageEnd;
    this._getBottomHtml=_Page_getBottomHtml;
    this._getStatHtml=_Page_getStatHtml;
    this._spacer=_Page_spacer;
}
function Page_getTop(flash) {
    var h='';
    if (this.showtop) h+=this._getTopHtml(flash);
    if (this.showpagebegin) h+=this._getPageBegin();
    return (h);
}
function Page_getBottom() {
    var h="";
    if (this.showpageend) h+=this._getPageEnd();
    if (this.showbottom) h+=this._getBottomHtml();
    if (this.stats) {
        if (typeof(window.webm_url)!="undefined") window.pUrl=window.webm_url;
        window.pCid=((typeof(window.webm_pCid)!="undefined")?window.webm_pCid:"dk_tv2i_0");
        if (window.pUrl==null) pUrl="";
        if (window.pCid==null) pCid="";
        h+=this._getStatHtml(pUrl,pCid);
    }
    return (h);
}
function _Page_getTopHtml(flash) {
    var t=93;    var b=t;     var h='';    h+='<table'+this.tablelayout+' border="0" cellpadding="0" cellspacing="0" width="'+(10+this.theme.width+20)+'">';
    h+='<tr>';
    h+='<td width="10" height="46">'+this._spacer(10,46)+'</td>';
    h+='<td width="'+this.theme.width+'" height="46" valign="top" bgcolor="#FFFFFF">';
    h+='<table'+this.tablelayout+' border="0" cellpadding="0" cellspacing="0" width="'+this.theme.width+'" align="center">';
    h+='<tr>';
    h+='<td width="'+t+'" height="46" valign="top"><a href="http://tv2.dk"><img src="'+this.theme.logoafile+'" width="'+t+'" height="45" border="0" alt=""></a></td>';
    h+='<td width="1" height="46" bgcolor="#ffffff">'+this._spacer(1,46)+'</td>';
    h+='<td width="'+(this.theme.width-t-1)+'" height="46">';
    if (flash) {
        b+=this.theme.topwidth2;
        h+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="'+(this.theme.width-b-1)+'" height="45">';
        h+='<param name="movie" value="'+this.theme.topflash+'">';
        h+='<param name="quality" value="autohigh">';
        h+='<param name="menu" value="false">';
        h+='<embed src="'+this.theme.topflash+'" quality="autohigh" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+(this.theme.width-b-1)+'" height="45"></embed>';
        h+='</object>';
        if (this.theme.topwidth2>0) {
            h+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="'+this.theme.topwidth2+'" height="45">';
            h+='<param name="movie" value="'+this.theme.topflash2+'">';
            h+='<param name="quality" value="autohigh">';
            h+='<param name="menu" value="false">';
            h+='<embed src="'+this.theme.topflash2+'" quality="autohigh" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+this.theme.topwidth2+'" height="45"></embed>';
            h+='</object>';
        }
    } else {
        b+=this.theme.topwidth2;
        h+='<img src="'+this.theme.topstatic+'" border="0" width="'+(this.theme.width-b-1)+'" height="45" alt="">';
        if (this.theme.topwidth2>0) {
            h+='<img src="'+this.theme.topstatic2+'" border="0" width="'+this.theme.topwidth2+'" height="45" alt="">';
        }
    }
    h+='</td>';
    h+='</tr>';
    h+='</table>';
    h+='</td>';
    h+='<td width="7" height="46" background="http://inc.tv2.dk/img/dropshadow.gif">'+this._spacer(7,46)+'</td>';
    h+='<td width="13" height="46">'+this._spacer(13,46)+'</td>';
    h+='</tr>';
    h+='<tr>';
    h+='<td width="10" height="24">'+this._spacer(10,24)+'</td>';
    h+='<td width="'+(this.theme.width)+'" height="24" bgcolor="#ffffff">';
    h+='<table'+this.tablelayout+' border="0" cellpadding="0" cellspacing="0" width="'+(this.theme.width)+'" height="23">';
    h+='<tr bgcolor="#ffffff">';
    h+='<td width="'+t+'" height="23" bgcolor="#ffffff"><a href="http://tv2.dk"><img src="'+this.theme.logobfile+'" width="'+t+'" height="23" border="0" alt=""></a></td>';
    h+='<td width="1" height="23" bgcolor="#ffffff">'+this._spacer(1,23)+'</td>';
    h+=this._getTopNavigation(t);
    h+='</tr>';
    h+='</table>';
    h+=this._spacer(this.theme.width,1);
    h+='</td>';
    h+='<td width="7" height="24" background="http://inc.tv2.dk/img/dropshadow.gif">'+this._spacer(7,24)+'</td>';
    h+='<td width="13" height="24">'+this._spacer(13,24)+'</td>';
    h+='</tr>';
    h+='</table>';
    return (h);
}
function _Page_getTopNavigation(lw) {
    var b=23;
// This array is included from the following pages:
// inc.tv2.dk/webroot/js/Page.js.php 
// zulu.tv2.dk/inc/top.php

    var i=new Array(8);
    i[0]=new Array("Nyhederne","http://nyhederne.tv2.dk/?topmenu");
    i[1]=new Array("Finans","http://finans.tv2.dk/?topmenu");
    i[2]=new Array("Sporten","http://sporten.tv2.dk/?topmenu");
    i[3]=new Array("TV","http://tv.tv2.dk/?topmenu");
    i[4]=new Array("Marked","http://marked.tv2.dk/?topmenu");
    i[5]=new Array("Spil","http://spil.tv2.dk/?topmenu");
    i[6]=new Array("Frizonen","http://frizonen.tv2.dk/?topmenu");
    i[7]=new Array("Zulu","http://zulu.dk/?topmenu");
    var tw=this.theme.width-lw-1-(i.length-1);    var w=Math.floor(tw/i.length);    var t='';    var sw=0;    for (var c=0;c<i.length;c++) {
        if (c<(i.length-1)) {
            sw+=w+1;
        } else {
            w=this.theme.width-lw-1-sw;        }
        t+='<td width="'+w+'" height="'+b+'" align="center" valign="middle" class="tv2topnavcell" bgcolor="#'+this.theme.bgcolor+'" onClick="gotoPage(\''+i[c][1]+'\');" onMouseOver="overLink(this, \''+i[c][1]+'\',\'#'+this.theme.hovercolor+'\');" onMouseOut="outLink(this, \'#'+this.theme.bgcolor+'\');"><a href="'+i[c][1]+'" class="tv2topnavtext">'+i[c][0]+'</a></td>';
        if (c<(i.length-1)) t+='<td width="1" height="'+b+'" align="center" valign="middle" class="tv2topnavcell" bgcolor="#ffffff">'+this._spacer(1,b)+'</td>';
    }
    return (t);
}
function _Page_getPageBegin() {
    var h='';
    h+='<table border="0" cellpadding="0" cellspacing="0" width="'+(10+this.theme.width+20)+'">';
    h+='<col width="10"><col width="'+this.theme.width+'"><col width="7"><col width="13">';
    h+='<tr>';
    h+='<td width="10">'+this._spacer(10,10)+'</td>';
    h+='<td width="'+this.theme.width+'" bgcolor="'+this.theme.bodycolor+'" class="tv2pagebody">';
    return (h);
}
function _Page_getPageEnd() {
    var h='';
    h+='</td>';
    h+='<td width="7" background="http://inc.tv2.dk/img/dropshadow.gif">'+this._spacer(7,10)+'</td>';
    h+='<td width="13">'+this._spacer(13,10)+'</td>';
    h+='</tr>';
    h+='</table>';
    return (h);
}
function _Page_getBottomHtml() {
        var i=new Array();    i[i.length] = new Array("Om tv2.dk","http://omtv2.tv2.dk/credit.asp?bottommenu");
    i[i.length] = new Array("Om TV 2","http://omtv2.tv2.dk/?bottommenu");
    i[i.length] = new Array("Reklamer","http://sites2.tv2.dk/hvemervi/?bottommenu");
    i[i.length] = new Array("Kontakt","http://omtv2.tv2.dk/adresser/kontakt.asp?bottommenu");
    i[i.length] = new Array("Oversigt","http://tv2.dk/indeks/?bottommenu");
    i[i.length] = new Array("Login","http://login.tv2.dk/?bottommenu");
    var s=18;    var w=150;    var t="Søg på tv2.dk";    if (this.theme.width==580) {         s=9;
        w=68;
        t="Søg på tv2";
    }
    var h='';
    h+='<table'+this.tablelayout+' border="0" cellpadding="0" cellspacing="0" width="'+(10+this.theme.width+7)+'">';
    h+='<tr>';
    h+='<td width="10">'+this._spacer(10,10)+'</td>';
    h+='<td width="'+(this.theme.width)+'">';
    h+='<form id="tv2bottomsearchform" name="tv2bottomsearchform" action="http://google.tv2.dk/soeg.php" method="get" target="_top">';
    h+='<input type="hidden" name="omraade" value="tv2.dk">';
    h+='<table'+this.tablelayout+' border="0" cellspacing="0" cellpadding="0" width="'+(this.theme.width)+'">';
    h+='<tr class="tv2bottomnavrow" bgcolor="#'+this.theme.bgcolor+'">';
    var tw=this.theme.width-(w+33+43);    var iw=Math.floor((tw-(this.theme.width/22))/i.length);    for (var b=0;b<i.length;b++) {
        h+='<td align="center" class="tv2bottomnavcell" width="'+iw+'" height="25"><a href="'+i[b][1]+'" class="tv2bottomnavtext">'+i[b][0]+'</a></td>';
    }
    var lo=tw-(iw*i.length);    h+='<td align="right" class="tv2bottomnavcell" width="'+w+'" height="25">';
    h+='<input type="text" name="q" size="'+s+'" value="'+t+'" id="tv2bottomsearchfield" onFocus="bottomOnFocusSearchField(\''+t+'\');" onBlur="bottomOnBlurSearchField(\''+t+'\');">';
    h+='</td>';
    h+='<td align="center" class="tv2bottomnavcell" width="33" height="25">';
    h+='<a href="javascript:bottomSearchClicked();" class="tv2bottomsearchlink">Søg</a>';
    h+='</td>';
    if (lo>0) h+='<td align="center" class="tv2bottomnavcell" width="'+lo+'" height="25">'+this._spacer(lo,25)+'</td>';
    h+='<td align="left" class="tv2bottomnavcell" width="43" height="25">';
    h+='<a href="http://www.valus.dk" target="_blank"><img id="tv2bottomvalusicon" src="http://gfx.tv2.dk/images/valus/valus_bund.gif" width="36" height="22" alt="" border="0"></a>';
    h+='</td>';
    h+='</tr>';
    h+='</table>';
    h+='</form>';
    h+='</td>';
    h+='<td width="7" background="http://inc.tv2.dk/img/dropshadow.gif">'+this._spacer(7,10)+'</td>';
    //h+='<td width="13">'+this._spacer(13,10)+'</td>';
    h+='</tr>';
    h+='</table>';
    return (h);
}
function _Page_getStatHtml(url,cid) {
    var h='<img src="http://server-dk.imrworldwide.com/cgi-bin/count?url='+url;
    h+='&rnd='+(new Date()).getTime();
    h+='&cid='+cid;
    h+='&ref='+this.browser.refURL;
    h+='&sr=sr'+this.browser.srW+'x'+this.browser.srH;
    h+=':cd'+this.browser.srCD;
    h+=':lg'+this.browser.lang;
    h+=':je'+(this.browser.java?"y":"n");
    h+=':ck'+(this.browser.cookie?"y":"n");
    h+=':tz'+this.browser.timezone;
    h+=':ct'+this.browser.getConn();
    h+=':hp'+(typeof(this.browser.isHome())=="boolean"?(this.browser.isHome()?"y":"n"):this.browser.isHome());
    h+='" width="1" height="1">';
    if (url!="") url='<param name="url" value="'+url+'">';
    if (cid!="") cid='<param name="cid" value="'+cid+'">';
    var r='<param name="sr" value="sr'+this.browser.srW+'x'+this.browser.srH;
    r+=':cd'+this.browser.srCD;
    r+=':lg'+this.browser.lang;
    r+=':je'+(this.browser.java?"y":"n");
    r+=':ck'+(this.browser.cookie?"y":"n");
    r+=':tz'+this.browser.timezone;
    r+=':ct'+this.browser.getConn();
    r+=':hp'+(typeof(this.browser.isHome())=="boolean"?(this.browser.isHome()?"y":"n"):this.browser.isHome());
    r+='">';
    if (!this.browser.onMac&&!this.browser.isNS&&!this.browser.onWinCE&&!this.browser.onLinux&&!this.browser.isOpera&&this.browser.java&&!this.browser.isIE6XP) {
        h='<applet code="Measure.class" codebase="http://server-dk.imrworldwide.com/" width=1 height=2>';
        h+=url;
        h+=cid;
        h+=r;
        h+='<param name="ref" value="'+this.browser.refURL+'">';
        h+='</applet>';
    }
    return (h);
}
function _Page_spacer(w,h) {
    return ('<img src="http://icons.tv2.dk/dummy.gif" border="0" width="'+w+'" height="'+h+'" alt="">');
}

fd_detect();
var browser=new TV2_BrowserDetector();
var theme=new TV2_Theme();
theme.width=((typeof(bolWideMenu)!="undefined")?(bolWideMenu?760:580):580);
if (typeof(tv2toptheme)=="string") {
    theme.set(tv2toptheme);
} else {
    var host=window.location.hostname;
    var x=host.indexOf(".");
    var bySubDomain=false;
    if (x>-1) {
        var subDomain=host.substring(0,x);
        if (subDomain=="finans"||subDomain=="marked"||subDomain=="mobil"||subDomain=="nyhederne"||subDomain=="spil"||subDomain=="sporten"||subDomain=="tv") {
            bySubDomain = true;
            theme.set(subDomain);
        }

        //Da der ikke er adgang til de pågældende sites styres OAS_listpos herfra...
        if (subDomain=="pingpost"||subDomain=="oplysningen"||subDomain=="oplysning") {
            OAS_listpos = 'Bottom,Right,Middle';
        }
    }
    if (!bySubDomain) {
        theme.set("");
        if (typeof(topoenr)!="undefined") {
            var mappings = new Array("nyhederne","tv","tv","marked","spil");
            if (mappings.length>=topoenr) theme.set(mappings[topoenr-1]);
        }
    }
}
var tv2pagefeatures = null;
t_browser=false;
t_browserver=0;
var IE4=browser.isIE;
var NS4=browser.isNS4;
var W3C=DOM=browser.dom;
var Mac=browser.onMac;
if (browser.isOpera) {
    t_browser='opera';
    t_browserver=parseFloat(navigator.userAgent.substr(i+6,3));
} else if (browser.isIE) {
    t_browser='msie';
    t_browserver=parseFloat(navigator.userAgent.substr(i+5,3));
} else if(browser.isGecko) {
    t_browser='gecko';
    t_browserver=navigator.userAgent.substr(i+6,8);
} else if(browser.isNS4) {
    t_browser='ns4';
} else if(browser.isKonq) {
    t_browser='konqueror';
}
if (!window.bolWideMenu) {
    bolWideMenu=false;
}
m_ok=t_frys=false;
t_luktimer=null;
t_aaben=1;
topZ=1000;
t_contentW=theme.width;
function t_getelement(id) {
    return (W3C?document.getElementById(id):(IE4?document.all[id]:(NS4?document[id]:false)));
}
function t_startIt() {
    t_placerskyskraber();
    if (window.t_eftermenu) t_eftermenu();
}
function t_placerskyskraber() {
    var ss=t_getelement('skyskraber');
    if (ss) {
        var left=window.skyskraberleft?skyskraberleft:(theme.width+10+1+2);
        var top=window.skyskrabertop?skyskrabertop:(m_yPos+36+(window.livenyheder?24:0));
        if (!window.skyskrabernoscroll) {
            if (document.body&&document.body.scrollTop) {
                top=Math.max(document.body.scrollTop+2,top);
            } else if(window.pageYOffset) {
                top=Math.max(window.pageYOffset+2,top);
            }
        }
        if (NS4) {
            ss.moveTo(left,top);
            ss.visibility='show';
        } else {
            ss.style.left=left+'px';
            ss.style.top=top+'px';
            ss.style.visibility='visible';
        }
        setTimeout('t_placerskyskraber()',25);
    }
}
function t_offset() { return (0); }
function t_popop(id) {}
function t_over() {}
function t_ud() {}
function t_luk(id) {}
function t_flickmenu(id,vis) {}
function t_flickbanner(vis) {}
function t_flickdivs(vis) {}
function t_pingnewuser() {
    window.location.href = "http://login.tv2.dk";
}

if (IE4||NS4||W3C) window.onload = t_startIt;
t_compaq=loginnavn=loginnavn_chop=pingnavn=pingnavn_chop=null;
thisURL=location.href;
thisURLesc=escape(thisURL);
if (IE4||NS4||W3C) {
    t_menuson=true;
    m_yPos=34;
    t_compaq=false;
}

if (window.OAS_listpos) {

var OAS_kagenavn = 'OASannoy_1';

function OAS_getCookie(name){
  var cname = name + "=";
  var dc = document.cookie;
  if (dc.length > 0) {
    begin = dc.indexOf(cname);
    if (begin != -1) {
      begin += cname.length;
      end = dc.indexOf(";", begin);
      if (end == -1) end = dc.length;
      return unescape(dc.substring(begin, end));
    }
  }
  return null;
}

function OAS_setCookie(name, value, expires, path, domain, secure) {
  document.cookie = name + "=" + escape(value) +
    ((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
    ((path == null) ? "" : "; path=" + path) +
    ((domain == null) ? "" : "; domain=" + domain) +
    ((secure == null) ? "" : "; secure");
}

function OAS_listpos_remove(pos) {
  posarray = OAS_listpos.split(',');
  listpos = '';
  found = false;
  for(i=0; i<posarray.length; i++) if(posarray[i]!=pos) listpos += ',' + posarray[i]; else found = true;
  OAS_listpos = listpos.substring(1);
  return found;
}

function OAS_listpos_add(pos) {
  if(OAS_listpos.length>0) OAS_listpos += ",";
  OAS_listpos += pos;
}

function OAS_annoy() {
  kage = OAS_getCookie(OAS_kagenavn);
  if(kage == null) {
    OAS_setCookie(OAS_kagenavn, 'first', null, "/", "tv2.dk")
    return false;
  }
  imp = kage.split('#');
  if(imp.length != 3) return true;
  if(imp[0] > new Date().valueOf()) return false;
  if(imp[1] >= 4) return false;
  return true;
}

function OAS_annoyed() {
  if(!window.OAS_RICH) return;
  src = '' + OAS_RICH;
  pos = src.lastIndexOf('if (position == "Middle") {');
  pos = Math.max(pos, src.lastIndexOf("if (position == 'Middle') {"));
  if( pos == -1 ) return;
  if( src.substr(pos).indexOf('/RealMedia/ads/Creatives/default/empty.gif') != -1 ) return;

  kage = OAS_getCookie(OAS_kagenavn);
  pop = new Date().valueOf() + 2*60*1000;
  now = new Date();
  day = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 4, 0, 0).valueOf();
  if(day < now.valueOf()) day += 24*60*60*1000;

  no = 1;
  if(kage != null) {
    imp = kage.split('#');
    if(imp.length == 3) {
      no = new Number(imp[1]).valueOf() + 1;
      day = new Number(imp[2]).valueOf();
    }
  }
  OAS_setCookie(OAS_kagenavn, pop + '#' + no + '#' + day, new Date(day), "/", "tv2.dk")
}

if(OAS_listpos_remove('Middle') && OAS_annoy()) OAS_listpos_add('Middle')


OAS_url='http://banner.webdmz.tv2.dk/RealMedia/ads/';
//if (!window.OAS_sitepage) OAS_sitepage=window.location.hostname+window.location.pathname;
if(!window.OAS_sitepage) OAS_sitepage = (location.href.indexOf('.test.')!=-1)?'test.tv2.dk/':(window.location.hostname + window.location.pathname)
if (!window.OAS_query) OAS_query='';
if (!window.OAS_target) OAS_target='_blank';
OAS_rand = new String(Math.random()).substring(2,11);

// Følgende bruges på *.test.tv2.dk til at teste for om alle positionerne bliver trukket
OAS_posarray = OAS_listpos.split(",");
OAS_testsite = location.href.indexOf('.test.') != -1
if(OAS_testsite) setTimeout('OAS_Test()', 5000)

//OAS-stunt nu vil alle sider ligge i directory /oas/
OAS_sitepage = OAS_sitepage.replace(/\//, "/oas/");

document.write('<'+'SCRIPT LANGUAGE=JavaScript1.1 SRC="'+OAS_url+'adstream_mjx.ads/'+OAS_sitepage+'/1'+OAS_rand+'@'+OAS_listpos+'?'+OAS_query+'"><\/'+'SCRIPT>');


function OAS_Test() {
    if(window.OAS_posarray) {
        pos = ''
        for(i=0; i<OAS_posarray.length; i++)
            if(OAS_posarray[i] != '') pos += "," + OAS_posarray[i]
        if(pos != '')
            alert('BANNERFEJL:\nOAS_listpos indeholder positioner som ikke er blevet hentet. Da der tælles eksponeringer for alle de positioner som er indeholdt i OAS_listpos er det vigtigt at de vises!\n\nFølgende positioner er hentet: ['+OAS_listpos+']\nFølgende positioner er ikke vist: ['+pos.substr(1)+']')
        else if(!OAS_testsite)
            alert('Bannerne på denne side bliver kaldt korrekt')
    }
}

function OAS_AdText() {
    window.document.open();
    window.document.writeln('<div class="tv2adtext">Annoncer:<div class="hr"></div></div>');
    window.document.close();
}

function OAS_InternAdText() {
    window.document.open();
    window.document.writeln('<div class="tv2adtext">TV 2 tjenester:<div class="hr"></div></div>');
    window.document.close();
}

function OAS_CheckPos(pos) {
    if(window.OAS_posarray) {
        for(i=0; i<OAS_posarray.length; i++) {
            if (OAS_posarray[i] == pos && OAS_posarray[i] != '') {
                return true;
            }
        }
    }
    return false;
}

function OAS_AD(pos) {
    if(window.OAS_posarray)
        for(i=0; i<OAS_posarray.length; i++) if(OAS_posarray[i]==pos) OAS_posarray[i] = '';
    if (window.OAS_RICH) OAS_RICH(pos); else {}
}

function OAS_Link(track, url) {
    if(!window.track) return url;
    track = OAS_url + 'click_lx.ads/' + track;
    qmark = url.indexOf('?');
    if(qmark != -1) {
        query = url.substring(qmark);
        url = url.substring(7, qmark );
    }
    return track + ((window.query)?query:'') + ((url.length>0)?((window.query)?'&':'?')+'_RM_REDIR_='+url:'') + ((window.query)?'?__QUERY__':'');
}

function OAS_Submit(track, form) {
    var url = form.action;
    url += (url.indexOf('?') == -1) ? '?' : '&';
    for (var i = 0; i < form.elements.length; i++) {
        var v = null;
        var e = form.elements[i];
        if (e.type == 'checkbox' || e.type == 'radio') {
            if (e.checked) {
                v = e.value;
            }
        } else if (e.type == 'select-one') {
            if (e.selectedIndex != -1 && e.options[e.selectedIndex]) {
                v = e.options[e.selectedIndex].value;
            }
        } else {
            v = e.value;
        }
        if (typeof v != 'object' && e.name && !e.disabled) {
            url += e.name + '=' + escape(v) + '&';
        }
    }
    url = url.substr(0, url.length - 1);
    window.open(OAS_Link(track, url), form.target ? form.target : OAS_target);
    return false;
}
}

if (!document.getElementById&&document.all) document.getElementById=function(id) { return document.all[id]; }
var lt_tmotSync=null;
var lt_justEntered=true;
function lt_tmotSynchronize() {
    var q=document.getElementById('lt_queue');    var r=false;    lt_justEntered=false;
    if (q.contentWindow) {
        q.contentWindow.location.replace('http://live.tv2.dk/Live.asis?confuse='+new Date().valueOf());
        r=true;
    } else {         var f=document.frames['lt_queue'];        if ((f)&&(!browser.onMac)) {
            f.location.replace('http://live.tv2.dk/Live.asis?confuse='+new Date().valueOf());
            r=true;
        }
    }
    if (r) {
        lt_tmotSync=setTimeout(lt_tmotSynchronize,60000);
    } else {
        lt_tmotSync = false;
    }
}
function lt_onLoad() {
    if (document.getElementById) lt_tmotSync=setTimeout(lt_tmotSynchronize,60000);
}
function livekonsol_popup(skin,clip,text,category) {
    var p;
    p=window.open('http://konsol.tv2.dk/news_console.php?skin='+escape(skin)+'&clip='+escape(clip)+'&text='+escape(text)+'&category='+escape(category),'tv2livekonsol','resizable=no,toolbar=no,scrollbars=no,menubar=no,status=no,directories=no,width=535,height=486,left=10,top=10');
    p.focus();
}
function LiveTop(html,height) {
    this.html=html;
    this.height=height;
}
var livetopHeight=0; function lt_setHeight(height) {
    livetopHeight=height;
}
var lt_typCurrent=lt_typNext=lt_tmotEventOpen=lt_tmotEventClosing=null;
function lt_ImageLink(theme,typ) {
    switch (typ) {
        case 'nyhederne':
            this.link="javascript:livekonsol_popup('ny','http://video.tv2.dk/files/ram/live/live.ram','<b>TV 2 | NYHEDERNE - DIREKTE</b>','')";
            this.sound="http://inc.tv2.dk/sound/nyhederne.swf";
            this.alt='TV 2 Nyhederne - DIREKTE!';
            this.height=24;
            this.image=((theme.width==760)?'http://gfx.tv2.dk/images/nyhederlivebarwide.gif':'http://gfx.tv2.dk/images/nyhederlive_bar.gif');
            break;
        case 'goaften':
            this.link="javascript:livekonsol_popup('goaften','http://video.tv2.dk/files/ram/live/goaften.ram','<b>Go\\' aften Danmark - DIREKTE</b>','')";
            this.alt='Go\' aften Danmark - DIRKEKTE!';
            this.height=24;
            this.image=((theme.width==760)?'http://gfx.tv2.dk/images/goaften_live_wide.gif':'http://gfx.tv2.dk/images/goaften_live.gif');
            break;
        case 'gomorgen':
            this.link="javascript:livekonsol_popup('gomorgen','http://video.tv2.dk/files/ram/live/live.ram','<b>Go\\' morgen Danmark - DIREKTE</b>','')";
            this.alt='Go\'morgen Danmark - DIREKTE!';
            this.height=24;
            this.image=((theme.width==760)?'http://gfx.tv2.dk/images/topbar_gomorgen_wide.gif':'http://gfx.tv2.dk/images/topbar_gomorgen.gif');
            break;
        case 'station2':
            this.link="javascript:livekonsol_popup('station2','http://video.tv2.dk/files/ram/live/station2live.ram','<b>Station2 - DIREKTE</b>','')";
            this.alt='Station2 - DIREKTE!';
            this.height=24;
            this.image=((theme.width==760)?'http://gfx.tv2.dk/images/topbar_station2_wide.gif':'http://gfx.tv2.dk/images/topbar_station2.gif');
            break;
        case 'fn':
            this.link="javascript:livekonsol_popup('ny','http://video.tv2.dk/files/ram/live/livefn.ram','<b>FN - DIREKTE</b>','')";
            this.sound="http://inc.tv2.dk/sound/nyhederne.swf";
            this.alt='FN - DIREKTE!';
            this.height=24;
            this.image=((theme.width==760)?'http://gfx.tv2.dk/images/topbar_fn_wide.gif':'http://gfx.tv2.dk/images/topbar_fn.gif');
            break;
        case 'afrika':
            this.link="javascript:livekonsol_popup('afrika','http://video.tv2.dk/files/ram/live/afrika.ram','<b>TV 2 | Danmark - AFRIKA DIREKTE</b>','')";
            this.alt='TV 2 Danmark - AFRIKA DIREKTE!';
            this.height=24;
            this.image=((theme.width==760)?'http://gfx.tv2.dk/images/760_afrika.gif':'http://gfx.tv2.dk/images/760_afrika.gif');
            break;
        case 'rundfunk':
            this.link="javascript:livekonsol_popup('rundfunk','http://video.tv2.dk/files/ram/live/rundfunk.ram','<b>TV 2 | DANMARK - RUNDFUNK DIREKTE</b>','')";
            this.alt='TV 2 | Danmark - RUNDFUNK DIREKTE!';
            this.height=24;
            this.image=((theme.width==760)?'http://gfx.tv2.dk/images/760_rundfunk.gif':'http://gfx.tv2.dk/images/580_rundfunk.gif');
            break;
        case 'jesus':
            this.link="javascript:livekonsol_popup('jesusogjosefine','http://video.tv2.dk/files/ram/live/julekalender.ram','<b>TV 2 | Danmark - JULEKALENDER DIREKTE</b>','')";
            this.alt='TV 2 Danmark - JULEKALENDER DIREKTE!';
            this.height=24;
            this.image=((theme.width==760)?'http://gfx.tv2.dk/images/topbar_jesus.gif':'http://gfx.tv2.dk/images/topbar_jesus.gif');
            break;
    }
}
function lt_getImageLinkTop(theme,typ,enableSound) {
    var i=new lt_ImageLink(theme,typ);    return new LiveTop('<A HREF="'+i.link+'"><IMG NAME="lt_image" SRC="'+i.image+'"'+' BORDER="0" WIDTH="'+theme.width+'" HEIGHT="'+i.height+'"'+' ALT="'+i.alt+'"></A>'+((enableSound&&(typeof(i.sound)!='undefined'))?lt_getSoundHTML(i.sound):''),i.height);
}
var lt_intvFade=null;
function lt_intvFadeUp() {
    var l=document.getElementById('livetop');    l.filters.alpha.opacity+=4;
    if (l.filters.alpha.opacity>96) {
        clearInterval(lt_intvFade);
        lt_intvFade=null;
    }
}
function lt_intvFadeDown() {
    var l=document.getElementById('livetop');    l.filters.alpha.opacity-=4;
    if (l.filters.alpha.opacity<4) {
        clearInterval(lt_intvFade);
        lt_intvFade=null;
        l.style.visibility='hidden';
        l.style.display='none';
        l.innerHTML='';
        l.style.height=0;
        lt_setHeight(0);
    }
}
function lt_setAlpha(level) {
    var l=document.getElementById('livetop');    if (typeof(l.filters.alpha)=='undefined') {
        l.style.filter='alpha(opacity='+level+')';
    } else {
        l.filters.alpha.opacity=level;
    }
}
function lt_getSoundHTML(url) {
    return ((fd_ver>=4)?'<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0" WIDTH="0" HEIGHT="0"><PARAM NAME="movie" VALUE="'+url+'"><PARAM NAME="loop" VALUE="false"><PARAM NAME="menu" VALUE="false"><PARAM NAME="quality" VALUE="high"><EMBED SRC="'+url+'" HIDDEN="FALSE" LOOP="FALSE" MENU="FALSE" QUALITY="HIGH" WIDTH="0" HEIGHT="0" swLiveConnect="FALSE" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>':'');
}
function lt_openTop(ltEvent,typ) {
    var l=document.getElementById('livetop');    lt_typCurrent=typ;
    l.innerHTML=ltEvent.html;
    l.style.height=ltEvent.height + 'px';
    lt_setHeight(ltEvent.height);
    l.style.visibility='visible';
    l.style.display='';
    if (document.all) {
        lt_setAlpha(0);
        if (lt_intvFade!=null) clearInterval(lt_intvFade);
        lt_intvFade=setInterval("lt_intvFadeUp()",100);
    }
}
function lt_closeTop(theme) {
    var l=document.getElementById('livetop');    lt_typCurrent=null;
    if (document.all) {
        lt_setAlpha(100);
        if (lt_intvFade!=null) clearInterval(lt_intvFade);
        lt_intvFade=setInterval("lt_intvFadeDown()",100);
    } else {
        l.style.visibility='hidden';
        l.style.display='none';
        l.innerHTML='';
        l.style.height=0;
        lt_setHeight(0);
    }
}
function lt_openImageLinkTop(theme,typ,enableSound ) {
    lt_openTop(lt_getImageLinkTop(theme,typ,enableSound),typ);
}
function lt_openEvent() {
    lt_openImageLinkTop(theme,lt_typNext,true);
    lt_typNext=null;
    lt_tmotEventOpen=null;
}
function lt_closingEvent() {
        if (lt_tmotSync!=null) clearTimeout(lt_tmotSync);
    lt_tmotSynchronize();
    lt_tmotEventClosing=null;
}
function lt_Event(cookie) {
    var e=cookie.split(',');    this.tmBegin=e[0];
    this.tmEnd=e[1];
    this.typ=e[2];
}
function lt_check() {
    var c=getCookie('tv2livetop');    if (c!=null) {
        var e=new lt_Event(c);        if (e.tmBegin==0) {             if (lt_tmotEventOpen!=null) { clearTimeout(lt_tmotEventOpen); lt_tmotEventOpen=null; }
            if (lt_typCurrent!=null) {
                if (lt_typCurrent!=e.typ) {
                    lt_openImageLinkTop(theme,e.typ,true);
                }
            } else {
                lt_openImageLinkTop(theme,e.typ,(!lt_justEntered));             }
        } else {
            if ((lt_typCurrent==null)||(lt_typCurrent!=e.typ)) {                 if (lt_typCurrent!=null) {
                    lt_closeTop(theme);
                }
                if (lt_tmotEventOpen!=null) clearTimeout(lt_tmotEventOpen);
                lt_typNext=e.typ;
                lt_tmotEventOpen=setTimeout(lt_openEvent,e.tmBegin);
            }
        }
        if (e.tmEnd>0) {             if (lt_tmotEventClosing!=null) clearTimeout(lt_tmotEventClosing);
                lt_tmotEventClosing=setTimeout(lt_closingEvent,e.tmEnd);
        } else {
            if (lt_tmotEventClosing!=null) clearTimeout(lt_tmotEventClosing);
            lt_tmotEventClosing=null;
        }
    } else {         if (lt_tmotEventOpen!=null) { clearTimeout(lt_tmotEventOpen); lt_tmotEventOpen=null; }
        if (lt_tmotEventClosing!=null) { clearTimeout(lt_tmotEventClosing); lt_tmotEventClosing=null; }
        if (lt_typCurrent!=null) lt_closeTop(theme);
    }
}
function lt_print(theme) {
    var c=getCookie('tv2livetop');    var h=0;    var v='hidden';    var d='display:none;';    var cH='';    if (c!=null) {
        var e=new lt_Event(c);        if (e.tmBegin==0) {             var l=lt_getImageLinkTop(theme,e.typ,false);            cH=l.html;
            h=l.height;
            lt_setHeight(h);
            v='visible';
            d='';
            lt_typCurrent=e.typ;
        }
    }
    if (document.getElementById) {
        document.write('<IFRAME ID="lt_queue" NAME="lt_queue" onLoad="lt_check()" STYLE="position:absolute;visibility:hidden;top:0;left:0;width:0;height:0;font-size:0px" SRC="http://live.tv2.dk/Live.asis?confuse='+new Date().valueOf()+'"></IFRAME>');
        document.write('<DIV ID="livetop" style="position:relative;'+d+'visibility:'+v+';width:'+theme.width+';height:'+h+';font-size:0px">');
        if (cH!='') document.write(cH);
        document.write('</DIV>');
                window.onload=lt_onLoad;
            }
    else {
        if (cH!='') document.write(cH);
    }
}

