
function getcookie(logoimg) {
 var cookiestring=""+document.cookie;
 var index1=cookiestring.indexOf(logoimg);
 if (index1==-1 || logoimg=="") return ""; 
 var index2=cookiestring.indexOf(';',index1);
 if (index2==-1) index2=cookiestring.length; 
 return unescape(cookiestring.substring(index1+logoimg.length+1,index2));
 }

flash= getcookie("fontsize");
if(flash=="0")
{logo0();}
else if(flash=="")
{logo0();}
else if(flash=="1")
{logo1();}
else if(flash=="2")
{logo2();}
else if(flash=="3")
{logo3();}

random_num2 = (Math.round((Math.random()*9)+1)) 
function logo0(){
document.write("<style type='text/css'>@import url('/Portals/0/skins/radiolive/fontnormal.css?rnd=+');</style>")
}
function logo1(){
document.write("<style type='text/css'>@import url('/Portals/0/skins/radiolive/fontnormal.css?');</style>")
}
function logo2(){
document.write("<style type='text/css'>@import url('/Portals/0/skins/radiolive/fontlarge.css?');</style>")
}
function logo3(){
document.write("<style type='text/css'>@import url('/Portals/0/skins/radiolive/fontsmall.css?');</style>")
}
  function setBGCookie(imgno) {
        var c = "fontsize=" + imgno + ";path=/; expires=Thu, 31 Dec 2099 23:59:59 GMT";
        document.cookie = c;
    }
	function submitThis(){ 
          window.location.reload(); 
    } 

function addbookmark() {
var locBrow=wheret;
bookmarkurl=window.location.href;
bookmarktitle=locBrow;

if (document.all) window.external.AddFavorite(bookmarkurl,bookmarktitle);

else if (window.sidebar)
window.sidebar.addPanel(bookmarktitle, bookmarkurl, "")
}

function kH(e) {
var pK = document.all? window.event.keyCode:e.which;
return pK != 13;
}
document.onkeypress = kH;
if (document.layers) document.captureEvents(Event.KEYPRESS);

/* pop up video */

	function filterid(id){
	if (id ==1){id="262";}//Film 3
	else if (id ==2){id="259";}//60 Minutes
	else if (id ==3){id="261";}//Campbell Live
	else if (id ==4){id="260";}//Nightline Video
	else if (id ==5){id="254";}//News-Business
	else if (id ==6){id="251";}//News-Entertainment
	else if (id ==7){id="255";}//News-Health/Science
	else if (id ==8){id="252";}//News-International
	else if (id ==9){id="249";}//News-National
	else if (id ==10){id="112";}//News Video (all)
	else if (id ==11){id="256";}//News-Politics
	else if (id ==12){id="250";}//News-Sport
	else if (id ==13){id="253";}//News-Technology
	else if (id ==14){id="257";}//News-Weather
	else if (id ==15){id="206";}//Programmes
	else if (id ==16){id="258";}//Extended Video
	var where= "http://www.tv3.co.nz/Home/Video/tabid/"+ id +"/Default.aspx";
	winBRopen(where,'videoplayer','768','680','toolbar=no,scrollbars=no, location=no,menubar=no,noresizeable=no,status=no') 
	}
	
	/* homepage */
	function setHomePage(siteURL) {
  if (document.all)
  {
    document.body.style.behavior = "url(#default#homepage)";
    document.body.setHomePage(siteURL);
  }
  else
    alert("only works in IE 4.0 or higher! \n to Add tv3 as you home page from other browsers simply go \n1) tools \n 2) options and add it here");
}



function openWindowLouis(){
	newWindow=window.open("/Portals/0/LVpopup/popup.html","blitz","width=470,height=600,toolbar=no,scrollbars=no, location=no,menubar=no,noresizeable=no,status=no")
}
