//SUPER FISH STARTS HERE 


/*
 * Superfish v1.4.8 - jQuery menu widget
 * Copyright (c) 2008 Joel Birch
 *
 * Dual licensed under the MIT and GPL licenses:
 * 	http://www.opensource.org/licenses/mit-license.php
 * 	http://www.gnu.org/licenses/gpl.html
 *
 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
 */

;(function($){
	$.fn.superfish = function(op){

		var sf = $.fn.superfish,
			c = sf.c,
			$arrow = $(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),
			over = function(){
				var $$ = $(this), menu = getMenu($$);
				clearTimeout(menu.sfTimer);
				$$.showSuperfishUl().siblings().hideSuperfishUl();
			},
			out = function(){
				var $$ = $(this), menu = getMenu($$), o = sf.op;
				clearTimeout(menu.sfTimer);
				menu.sfTimer=setTimeout(function(){
					o.retainPath=($.inArray($$[0],o.$path)>-1);
					$$.hideSuperfishUl();
					if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}
				},o.delay);	
			},
			getMenu = function($menu){
				var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
				sf.op = sf.o[menu.serial];
				return menu;
			},
			addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };
			
		return this.each(function() {
			var s = this.serial = sf.o.length;
			var o = $.extend({},sf.defaults,op);
			o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){
				$(this).addClass([o.hoverClass,c.bcClass].join(' '))
					.filter('li:has(ul)').removeClass(o.pathClass);
			});
			sf.o[s] = sf.op = o;
			
			$('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
				if (o.autoArrows) addArrow( $('>a:first-child',this) );
			})
			.not('.'+c.bcClass)
				.hideSuperfishUl();
			
			var $a = $('a',this);
			$a.each(function(i){
				var $li = $a.eq(i).parents('li');
				$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
			});
			o.onInit.call(this);
			
		}).each(function() {
			var menuClasses = [c.menuClass];
			if (sf.op.dropShadows  && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
			$(this).addClass(menuClasses.join(' '));
		});
	};

	var sf = $.fn.superfish;
	sf.o = [];
	sf.op = {};
	sf.IE7fix = function(){
		var o = sf.op;
		if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined)
			this.toggleClass(sf.c.shadowClass+'-off');
		};
	sf.c = {
		bcClass     : 'sf-breadcrumb',
		menuClass   : 'sf-js-enabled',
		anchorClass : 'sf-with-ul',
		arrowClass  : 'sf-sub-indicator',
		shadowClass : 'sf-shadow'
	};
	sf.defaults = {
		hoverClass	: 'sfHover',
		pathClass	: 'overideThisToUse',
		pathLevels	: 1,
		delay		: 800,
		animation	: {opacity:'show'},
		speed		: 'normal',
		autoArrows	: true,
		dropShadows : true,
		disableHI	: false,		// true disables hoverIntent detection
		onInit		: function(){}, // callback functions
		onBeforeShow: function(){},
		onShow		: function(){},
		onHide		: function(){}
	};
	$.fn.extend({
		hideSuperfishUl : function(){
			var o = sf.op,
				not = (o.retainPath===true) ? o.$path : '';
			o.retainPath = false;
			var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
					.find('>ul').hide().css('visibility','hidden');
			o.onHide.call($ul);
			return this;
		},
		showSuperfishUl : function(){
			var o = sf.op,
				sh = sf.c.shadowClass+'-off',
				$ul = this.addClass(o.hoverClass)
					.find('>ul:hidden').css('visibility','visible');
			sf.IE7fix.call($ul);
			o.onBeforeShow.call($ul);
			$ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); });
			return this;
		}
	});

})(jQuery);

/*
 * Supersubs v0.2b - jQuery plugin
 * Copyright (c) 2008 Joel Birch
 *
 * Dual licensed under the MIT and GPL licenses:
 * 	http://www.opensource.org/licenses/mit-license.php
 * 	http://www.gnu.org/licenses/gpl.html
 *
 *
 * This plugin automatically adjusts submenu widths of suckerfish-style menus to that of
 * their longest list item children. If you use this, please expect bugs and report them
 * to the jQuery Google Group with the word 'Superfish' in the subject line.
 *
 */

;(function($){ // $ will refer to jQuery within this closure

	$.fn.supersubs = function(options){
		var opts = $.extend({}, $.fn.supersubs.defaults, options);
		// return original object to support chaining
		return this.each(function() {
			// cache selections
			var $$ = $(this);
			// support metadata
			var o = $.meta ? $.extend({}, opts, $$.data()) : opts;
			// get the font size of menu.
			// .css('fontSize') returns various results cross-browser, so measure an em dash instead
			var fontsize = $('<li id="menu-fontsize">&#8212;</li>').css({
				'padding' : 0,
				'position' : 'absolute',
				'top' : '-999em',
				'width' : 'auto'
			}).appendTo($$).width(); //clientWidth is faster, but was incorrect here
			// remove em dash
			$('#menu-fontsize').remove();
			// cache all ul elements
			$ULs = $$.find('ul');
			// loop through each ul in menu
			$ULs.each(function(i) {	
				// cache this ul
				var $ul = $ULs.eq(i);
				// get all (li) children of this ul
				var $LIs = $ul.children();
				// get all anchor grand-children
				var $As = $LIs.children('a');
				// force content to one line and save current float property
				var liFloat = $LIs.css('white-space','nowrap').css('float');
				// remove width restrictions and floats so elements remain vertically stacked
				var emWidth = $ul.add($LIs).add($As).css({
					'float' : 'none',
					'width'	: 'auto'
				})
				// this ul will now be shrink-wrapped to longest li due to position:absolute
				// so save its width as ems. Clientwidth is 2 times faster than .width() - thanks Dan Switzer
				.end().end()[0].clientWidth / fontsize;
				// add more width to ensure lines don't turn over at certain sizes in various browsers
				emWidth += o.extraWidth;
				// restrict to at least minWidth and at most maxWidth
				if (emWidth > o.maxWidth)		{ emWidth = o.maxWidth; }
				else if (emWidth < o.minWidth)	{ emWidth = o.minWidth; }
				emWidth += 'em';
				// set ul to width in ems
				$ul.css('width',emWidth);
				// restore li floats to avoid IE bugs
				// set li width to full width of this ul
				// revert white-space to normal
				$LIs.css({
					'float' : liFloat,
					'width' : '100%',
					'white-space' : 'normal'
				})
				// update offset position of descendant ul to reflect new width of parent
				.each(function(){
					var $childUl = $('>ul',this);
					var offsetDirection = $childUl.css('left')!==undefined ? 'left' : 'right';
					$childUl.css(offsetDirection,emWidth);
				});
			});
			
		});
	};
	// expose defaults
	$.fn.supersubs.defaults = {
		minWidth		: 9,		// requires em unit.
		maxWidth		: 25,		// requires em unit.
		extraWidth		: 0			// extra width can ensure lines don't sometimes turn over due to slight browser differences in how they round-off values
	};
	
})(jQuery); // plugin code ends














//mobile redirector
var isCE = navigator.appVersion.indexOf("Windows CE")>0;
if (isCE)
{
 //window.location.href="/Home/TV3Mobile/tabid/109/Default.aspx";
}
var currentVid="";

// get variable from url
function varPull( name )
{

  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

//cookie
  var allcookies = document.cookie; 
    var logo_pos = allcookies.indexOf("loc=");
    var logo_value = '';
    if(logo_pos != -1) {
        var logo_start = logo_pos + 6;
        var logo_end = allcookies.indexOf(";", logo_start);
        if(logo_end == -1) logo_end = allcookies.length;
        logo_value = allcookies.substring(logo_start,logo_end);
        logo_value = unescape();
    }

 function getFlashMovie(movieName) {
  var isIE = navigator.appName.indexOf("Microsoft") != -1;
  return (isIE) ? window[movieName] : document[movieName];
 }

function updateRegion(id) {

//thisMovie("myweathersm").SetVariable("where",id);

	if(window.myweathersm) window.document["myweathersm"].SetVariable("where", id);
	if(document.myweathersm) document.myweathersm.SetVariable("where", id);

}
function updateRegion2(id) {

	if(window.myweather3days) window.document["myweather3days"].SetVariable("where", id);
	if(document.myweather3days) document.myweather3days.SetVariable("where", id);


}

 function setlogoCookie(logono) {
        var d = "loc=" + logono + "; " + "expires=Thu, 31 Dec 2099 23:59:59 GMT;path=/;"
        document.cookie = d;
		updateRegion(logono);
	
		}
		 function setlogoCookie2(logono) {
        var d = "loc=" + logono + "; " + "expires=Thu, 31 Dec 2099 23:59:59 GMT;path=/;"
        document.cookie = d;
		updateRegion2(logono);
	
		}


//weather
 function submitThis(){ 
         // window.location.reload(); 
    } 
	 function submitWeather(){ 
        //  window.location = "/News/WeatherNews/WeatherMap/tabid/197/Default.aspx"; 
    } 
	
	//pop ups
function winBRopen(theURL, Name, popW, popH, scroll) { // V 1.0
var winleft = (screen.width - popW) / 2;
var winUp = (screen.height - popH) / 2;
winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable'
Win = window.open(theURL, Name, winProp)
if (parseInt(navigator.appVersion) >= 4) { Win.window.focus(); }

}

//page style
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));
 }

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, "")
}


	/* set 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 getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}
function GetCookieFont (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
	
  }
  return null;
}
function SetCookieFont (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

function DeleteCookie (name,path,domain) {
  if (GetCookieFont(name)) {
    document.cookie = name + "=" +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

function getActiveStyleSheet() {

  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}


var fontSize = GetCookieFont('fonttextsize');
if(fontSize != null) {
		setActiveStyleSheet(fontSize, 1);
}	

 
function mailWrite(){
var pageurl = document.URL + "?src=email";
var message ="Hi. Check out this page  "+ pageurl +".";
document.getElementById('mailWrite').href ="mailto:?subject=Check it out!&body="+ message;
	 }
function storySend(pageurl, pageTitle){
var pageurl = pageurl;
var message ="Hi. I was on http://www.3news.co.nz and saw this article. I thought you might be interested to read it too. click here to read " + pageurl;
document.getElementById('storySend').href ="mailto:?subject="+pageTitle+"&body="+ message;
}
	 
//pop up radio streams
function openStreamWindow(url) { 
newWindow=window.open(url,"blitz","width=470,height=400,toolbar=no,scrollbars=no, location=no,menubar=no,noresizeable=no,status=no") 
} 



/* serve flash widgets */

newsRotater = function(){
var fo = new FlashObject("/portals/0/flash/newsRotater4.0.swf", "newsRotater4", "320", "120", "8", "#ffffff");   
fo.addParam("allowScriptAccess", "sameDomain"); 
fo.addParam("quality", "high"); 
fo.addParam("scale", "noscale"); 
  fo.addParam("wmode", "transparent");
fo.addParam("salign", "t"); 
fo.addParam("loop", "false"); 
fo.write("newsHeadlines"); 
}

newsRegion = function(){
var fo = new FlashObject("/portals/0/flash/regionNews.swf", "newsRegion", "322", "215", "8", "#ffffff"); 
fo.addParam("allowScriptAccess", "sameDomain"); 
fo.addParam("quality", "high"); 
fo.addParam("scale", "noscale"); 
  fo.addParam("wmode", "transparent");
fo.addParam("salign", "t"); 
fo.addParam("loop", "false"); 
fo.write("regionHeadlines"); 
}



topNewsScroller= function(){
  random_num = (Math.round((Math.random()*9)+1)) 
  var fo = new FlashObject("/portals/0/flash/scroller.swf", "scroller", "600", "28", "8", "#ffffff"); 
  fo.addParam("allowScriptAccess", "sameDomain"); 
  fo.addParam("quality", "high"); 
  fo.addParam("scale", "noborder"); 
  fo.addParam("wmode", "transparent");
  fo.addParam("salign", "t"); 
  fo.addParam("loop", "false"); 
  fo.write("scrollerPane"); 
}


vidSearch= function(){
	var fo = new FlashObject("/portals/0/flash/vidsearch.swf", "vidSearch", "180", "30", "7", "#ffffff"); 
	fo.addParam("allowScriptAccess", "sameDomain"); 
	fo.addParam("quality", "high"); 
	fo.addParam("scale", "noscale");
	fo.addParam("wmode", "transparent"); 
	fo.addParam("salign", "t"); 
	fo.addParam("loop", "false"); 
	fo.write("vidsearch");
}
runDartAds2=function(mytab,sect,genre,show){


		}
	

/* Article Manager Scripts */
function postBackHiddenField(hiddenFieldID, hiddenFieldValue){
	var hiddenField = $get(hiddenFieldID);
	if (hiddenField) {
		__doPostBack(hiddenFieldID, hiddenFieldValue);
	}
}
function pageClickEvent(what){
	//loopCSSChange(document, "vis", "hid");
 	document.getElementById('pw_'+what).className="ajaxtranz";
}


/*function pageClickEvent(what){
//loopCSSChange(document, "vis", "hid");

xx= document.getElementById('pw_'+what);
xx.className="ajaxtranz";

}*/


/*function loopCSSChange(el, class, newclass)
{
   for (var x=0;x<el.childNodes.length;x++)
  {
        loopCSSChange(el.childNodes[x], class, newclass);

  }

  if (el.className==class) el.className=newclass;

}*/


function setVidCookie(logono) {
        var d = "vdisp=" + logono + "; " + "expires=Thu, 31 Dec 2099 23:59:59 GMT;path=/;"
        document.cookie = d;
		// setting cookie to show what the user has filtered by
    }
	
	function showVid(what)
	{
		exist =  document.getElementById('dnn_videoBarOpt1');
		if((exist!=undefined)&&(exist!="")){
		
	document.getElementById('dnn_videoBarOpt1').className='hiddy';
	document.getElementById('dnn_videoBarOpt2').className='hiddy';
	document.getElementById('dnn_videoBarOpt3').className='hiddy';
	document.getElementById('dnn_videoBarOpt4').className='hiddy';

	document.getElementById('dnn_videoBarOpt1Link').className='vidnonactive';
	document.getElementById('dnn_videoBarOpt2Link').className='vidnonactive';
	document.getElementById('dnn_videoBarOpt3Link').className='vidnonactive';
	document.getElementById('dnn_videoBarOpt4Link').className='vidnonactive';

	
	document.getElementById(what).className='vissy';
	document.getElementById(what+"Link").className='vidactive';
	setVidCookie(what);
		}
	}
	function showVid3Options(what)
	{ 
		exist =  document.getElementById('dnn_videoBarOpt2');
		if((exist!=undefined)&&(exist!="")){
		
	document.getElementById('dnn_videoBarOpt1').className='hiddy';
	document.getElementById('dnn_videoBarOpt2').className='hiddy';
	document.getElementById('dnn_videoBarOpt3').className='hiddy';

	
	document.getElementById('dnn_videoBarOpt1Link').className='vidnonactive';
	document.getElementById('dnn_videoBarOpt2Link').className='vidnonactive';
	document.getElementById('dnn_videoBarOpt3Link').className='vidnonactive';

	
	document.getElementById(what).className='vissy';
	document.getElementById(what+"Link").className='vidactive';
	setVidCookie(what);
		}
	}
	
	function showVid5Options(what)
	{ 
		exist =  document.getElementById('dnn_videoBarOpt2');
		if((exist!=undefined)&&(exist!="")){
		
	document.getElementById('dnn_videoBarOpt1').className='hiddy';
	document.getElementById('dnn_videoBarOpt2').className='hiddy';
	document.getElementById('dnn_videoBarOpt3').className='hiddy';
	document.getElementById('dnn_videoBarOpt4').className='hiddy';
	document.getElementById('dnn_videoBarOpt6').className='hiddy';

	
	document.getElementById('dnn_videoBarOpt1Link').className='vidnonactive';
	document.getElementById('dnn_videoBarOpt2Link').className='vidnonactive';
	document.getElementById('dnn_videoBarOpt3Link').className='vidnonactive';
	document.getElementById('dnn_videoBarOpt4Link').className='vidnonactive';
	document.getElementById('dnn_videoBarOpt6Link').className='vidnonactive';

	
	document.getElementById(what).className='vissy';
	document.getElementById(what+"Link").className='vidactive';
	setVidCookie(what);
		}
	}

	function showVidHomepage(what)
	{ 
		exist =  document.getElementById('dnn_videoBarOpt2');
		if((exist!=undefined)&&(exist!="")){
		
	document.getElementById('dnn_videoBarOpt1').className='hiddy';
	document.getElementById('dnn_videoBarOpt2').className='hiddy';
	document.getElementById('dnn_videoBarOpt3').className='hiddy';
	document.getElementById('dnn_videoBarOpt4').className='hiddy';
	document.getElementById('dnn_videoBarOpt5').className='hiddy';
	document.getElementById('dnn_videoBarOpt6').className='hiddy';
	
	document.getElementById('dnn_videoBarOpt1Link').className='vidnonactive';
	document.getElementById('dnn_videoBarOpt2Link').className='vidnonactive';
	document.getElementById('dnn_videoBarOpt3Link').className='vidnonactive';
	document.getElementById('dnn_videoBarOpt4Link').className='vidnonactive';
	document.getElementById('dnn_videoBarOpt5Link').className='vidnonactive';
	document.getElementById('dnn_videoBarOpt6Link').className='vidnonactive';
	
	document.getElementById(what).className='vissy';
	document.getElementById(what+"Link").className='vidactive';
		}
	}


function showVideo(what)
	{
	document.getElementById('dnn_videoLatest').className='hiddy';
	document.getElementById('dnn_videoPopular').className='hiddy';
	document.getElementById('dnn_videoComment').className='hiddy';

	document.getElementById('dnn_videoLatestLink').className='menVideo';
	document.getElementById('dnn_videoPopularLink').className='menVideo';
	document.getElementById('dnn_videoCommentLink').className='menVideo';
	
	document.getElementById(what).className='vissy';
	document.getElementById(what+"Link").className='menVideoActive';
	}

function showNews2(what)
	{
	document.getElementById('dnn_newsLatest').className='hiddy';
	document.getElementById('dnn_newsPopular').className='hiddy';

	document.getElementById('dnn_newsLatestLink').className='menuInactive';
	document.getElementById('dnn_newsPopularLink').className='menuInactive';
	
	document.getElementById(what).className='vissy';
	document.getElementById(what+"Link").className='menuActive';
	}
function showNews(what)
	{
	document.getElementById('dnn_newsLatest').className='hiddy';
	document.getElementById('dnn_newsPopular').className='hiddy';
	document.getElementById('dnn_newsComment').className='hiddy';

	document.getElementById('dnn_newsLatestLink').className='menNews';
	document.getElementById('dnn_newsPopularLink').className='menNews';
	document.getElementById('dnn_newsCommentLink').className='menNews';
	
	document.getElementById(what).className='vissy';
	document.getElementById(what+"Link").className='menNewsActive';
	}
	
	function showNewsRegion(what)
	{
	
	document.getElementById('dnn_akl').className='hiddy';
	document.getElementById('dnn_wel').className='hiddy';
	document.getElementById('dnn_chc').className='hiddy';

	document.getElementById('dnn_aklLink').className='menNewsRegion';
	document.getElementById('dnn_welLink').className='menNewsRegion';
	document.getElementById('dnn_chcLink').className='menNewsRegion';
	
	document.getElementById(what).className='vissy';
	document.getElementById(what+"Link").className='menNewsRegionActive';
	}






/*JQUERY FUNCTIONS */
jQuery.noConflict()
jQuery(document).ready(function(){


	jQuery('#relatedVideo').hide();
	
	jQuery('#relvideo').click(function(){
	jQuery('#relatedArticles').hide();
	jQuery('#relatedVideo').fadeIn('fast');
	jQuery('#relvideo').removeClass('menNews');
	jQuery('#relvideo').addClass('menNewsActive');
	jQuery('#relArticles').removeClass('menNewsActive');
	jQuery('#relArticles').addClass('menNews');
	});
	
	
	jQuery('#relArticles').click(function(){
	jQuery('#relatedVideo').hide();
	jQuery('#relatedArticles').fadeIn('fast');	
	jQuery('#relvideo').removeClass('menNewsActive');
	jQuery('#relvideo').addClass('menNews');
	jQuery('#relArticles').removeClass('menNews');
	jQuery('#relArticles').addClass('menNewsActive');
	
	});


	jQuery('.hostContainer').slideUp('normal');	

	jQuery('.hostAccordion').click(function() {
		jQuery('.hostContainer').slideUp('normal');	
		jQuery(this).next().slideDown('normal');
	});
	
	
	
	var backColor = jQuery("#SubMenuBar").css("background-color");
	var SubMenu=jQuery('#SubMenuBar');
	


	//MENU
	jQuery("ul.sf-menu").superfish({ 
	  	hoverClass:    'sfHover',    
		delay:       50,                            // one second delay on mouseout 
		animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
		speed:       'fast',                          // faster animation speed 
		autoArrows:  false,                           // disable generation of arrow mark-up 
		dropShadows: true                            // disable drop shadows 			
	});
	/* COMMENTED OUT SUPERSUBS BY TJ 20-07-2011
	jQuery("ul.sf-menu").supersubs({ 
		minWidth:    12,   // minimum width of sub-menus in em units 
		maxWidth:    27,   // maximum width of sub-menus in em units 
		extraWidth:  1,     // extra width can ensure lines don't sometimes turn over 
		pathLevels:   1
						   // due to slight rounding differences and font-family 
	}).superfish({ 
	  hoverClass:    'sfHover',    
		delay:       50,                            // one second delay on mouseout 
		animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
		speed:       'fast',                          // faster animation speed 
		autoArrows:  false,                           // disable generation of arrow mark-up 
		dropShadows: true                            // disable drop shadows 			
	});*/
	
	
	
	jQuery("#PTabs a").removeAttr("title");		
	

	
	jQuery("#sliderBlog").easySlider({prevId: 'prevBtn2', nextId: 'nextBtn2', prevText: '&nbsp;', nextText: '&nbsp;', auto: true, continuous: false, pause: 9000});
	
	jQuery("#slider").easySlider({prevText: '&nbsp;', nextText: '&nbsp;', auto: true, continuous: false, pause: 9000});
	//$("#sliderPhotoGallery").easySlider({prevId: 'prevBtn2', nextId: 'nextBtn2', prevText: '&nbsp;', nextText: '&nbsp;', auto: true, continuous: true});


});

function writeFlash(){
	var fo = new FlashObject("/Portals/0/flash/streamingNow.swf", "streamingNow", "300", "30", "8", "#ffffff"); 
	fo.addParam("allowScriptAccess", "sameDomain"); 
	fo.addParam("quality", "high"); 
	fo.addParam("scale", "noscale"); 
	fo.addParam("wmode", "transparent");
	// fo.addParam("salign", "t"); 
	fo.addParam("loop", "true"); 
	fo.write("streamingNow");
}

	function streamNow(){
var myArray = new Array("00000","20696","18808","16131","12841","12974","12874","12873");
//blank, firstline, the nation, middday news, 6pm news, campbellive, nightline, sports tonight
					
	var listItems = myArray.length;
	var cnt = 0;
	var i=0;
	while(i<listItems){
		if(nower===myArray[i]){
		cnt += 1;
		}
		else{
			cnt += 0;
			}
		++i;
	}
	if(cnt >= 1){
	writeFlash();
}
	else{}
	}
	
		/* Displays the current date time*/
	function GetCurrentDateTime(){
	    var d_names = new Array("Sunday", "Monday", "Tuesday",
        "Wednesday", "Thursday", "Friday", "Saturday");
        var m_names = new Array("January", "February", "March", 
        "April", "May", "June", "July", "August", "September", 
        "October", "November", "December");
        var d = new Date();
        var curr_day = d.getDay();
        var curr_date = d.getDate();
        var curr_month = d.getMonth();
        var curr_year = d.getFullYear(); 
		var a_p = "";	
		var curr_hour = d.getHours();
		if (curr_hour < 12){a_p = "a.m.";}
		else {a_p = "p.m.";}
		if (curr_hour == 0){ curr_hour = 12; }
		if (curr_hour > 12){ curr_hour = curr_hour - 12;  }
		var curr_min = d.getMinutes();
		curr_min = curr_min + "";
		if (curr_min.length == 1){curr_min = "0" + curr_min;}
        return unescape(d_names[curr_day] + ", " + curr_date + " " + m_names[curr_month] + " " + curr_year + " " + curr_hour + ":" + curr_min + a_p);	
	}
	
	/*set video button URL */
	function setVideoButton(sect,genre){
	
		if (document.getElementById("dynvidbut")) {
			
			
			if(sect=="national"){
			document.getElementById("dynvidbut").href='/Video/National.aspx';
			document.getElementById("dynaudbut").href='/Audio/National.aspx';
			}
			else if(sect=="world"){
			document.getElementById("dynvidbut").href='/Video/World.aspx';
			document.getElementById("dynaudbut").href='/Audio/World.aspx';
			}
			else if(sect=="3sport"){
			document.getElementById("dynvidbut").href='/Video/3Sport.aspx';
			document.getElementById("dynaudbut").href='/Audio/3Sport.aspx';
			}
			else if(sect=="lifestyle"){
			document.getElementById("dynvidbut").href='/Video/Lifestyle.aspx';
			document.getElementById("dynaudbut").href='/Audio/Lifestyle.aspx';
			}
			else if(sect=="entertainment"){
			document.getElementById("dynvidbut").href='/Video/Entertainment.aspx';
			document.getElementById("dynaudbut").href='/Video/National.aspx';
			}
			else if(sect=="business"){
			document.getElementById("dynvidbut").href='/Video/Business.aspx';
			document.getElementById("dynaudbut").href='/Audio/Business.aspx';
			}
			else if(sect=="politics"){
			document.getElementById("dynvidbut").href='/Video/Politics.aspx';
			document.getElementById("dynaudbut").href='/Audio/Politics.aspx';
			}
			else if(sect=="technology"){
			document.getElementById("dynvidbut").href='/Video/Technology.aspx';
			document.getElementById("dynaudbut").href='/Audio/Technology.aspx';
			}
			else if(sect=="oddnews"){
			document.getElementById("dynvidbut").href='/Video/Odd.aspx';
			document.getElementById("dynaudbut").href='/Video/National.aspx';
			}
			else if(sect=="weather"){
			document.getElementById("dynvidbut").href='/Video/Weather.aspx';
			document.getElementById("dynaudbut").href='/Video/National.aspx';
			}
			else if(sect=="tvshows"){
			if(genre=="campbelllive"){
				document.getElementById("dynvidbut").href='/Video/CampbellLive.aspx';
				document.getElementById("dynaudbut").href='/Video/National.aspx';
				}
				else if(genre=="nightline"){
		document.getElementById("dynvidbut").href='/Video/Nightline.aspx';
		document.getElementById("dynaudbut").href='/Video/National.aspx';
				}
				else if(genre=="sunrise"){
		document.getElementById("dynvidbut").href='/Video/Sunrise.aspx';
		document.getElementById("dynaudbut").href='/Video/National.aspx';
				}
				else if(genre=="3news"){
		document.getElementById("dynvidbut").href='/Video/Weather.aspx';
		document.getElementById("dynaudbut").href='/Video/National.aspx';
				}
				else if(genre=="sportstonight"){
		document.getElementById("dynvidbut").href='/Video/3Sport.aspx';
		document.getElementById("dynaudbut").href='/Video/National.aspx';
				}
				else if(genre=="60minutes"){
		document.getElementById("dynvidbut").href='/Video/60Minutes.aspx';
		document.getElementById("dynaudbut").href='/Video/National.aspx';
				}
				else{
					document.getElementById("dynvidbut").href='/Video/Weather.aspx';
		document.getElementById("dynaudbut").href='/Video/National.aspx';
					
					
					}
		}
		else{
		document.getElementById("dynvidbut").href='/Video/National.aspx';
		document.getElementById("dynaudbut").href='/Audio/National.aspx';	
			
			}
		}
	
	
	}
	


