

function AddPlayItem( strItem )
{
	var win = window.open( "/playlist_add.asp?item=" + strItem, 'addtolist', 'width=250,height=150,top=250,left=300,scrollbars=no,resizable=0');
	win.focus();
}

function ShowBiggerImg( image_file )
{
	var path = window.open( '','bigger',
			'height=500,width=500,top=50,left=50,scrollbars=yes,resizable=yes',true );
	path.document.open()		
	path.document.write( "<html><head><title>Bigger Image</title></head>" )
	path.document.write( "<body><table border=1 cellpadding=2 cellspacing=1 style='border-collapse:collapse;' bordercolor=#888888><tr><td><img style='border-width:0px;' src='" )
	path.document.write( image_file + "'></td></tr></table><br>")
	path.document.write( "<center><a href='javascript:window.close()'>close window</a></center></body></html>" )
	path.document.close()
}



<!-- top bar menu functions -->

var mTmr1 = null;
var mTmrc = null;

clearTimeout(mTmr1);
clearTimeout(mTmrc);

var inMn1 = false;
var inMnc = false;

var c_id1 = '';
var c_idc = '';

// preload images
var preImages = new Array(20);

preImages[0] = new Image;
preImages[0].src = '/images/menu-bg-wo-child-0.gif';
preImages[1] = new Image;
preImages[1].src = '/images/menu-bg-wo-child-1.gif';

preImages[2] = new Image;
preImages[2].src = '/images/menu-bg-w-child-0.gif';
preImages[3] = new Image;
preImages[3].src = '/images/menu-bg-w-child-1.gif';

function SwapBGImage( me )
{
	var src = me.background
		
	var pos = src.indexOf( '-0.' )
	if( pos == src.length - 6 )
	{
		me.background = src.substring(0,src.length - 5)+'1'+src.substring( src.length - 4, src.length );		
	}
	else
	{
		pos = src.indexOf( '-1.' )
		if( pos == src.length - 6 )
		{
			me.background = src.substring(0,src.length - 5)+'0'+src.substring( src.length - 4, src.length );	
		}
	}	
}

// categories under a channel
function ToggleChannelMenuOn( channel_id, i )
{
		// clear time out
		clearTimeout(mTmrc);
		clearTimeout(mTmr1);

		// show current and adjust position according to screen
		var item = document.getElementById( 'top_menu_' + channel_id)
		/*var margin = document.body.clientWidth-770
		if( margin < 0 )
			margin = 0*/
		item.style.left = /*margin/2 +*/ 70 + (i-1)*82 // this is absolute position,works for both IE and Mozilla
		item.style.visibility = 'visible';

		// hide previous menu and submenu, if any
		if( channel_id != c_idc )
		{
			if(document.getElementById('top_sub_'+c_id1))
			{		
				document.getElementById('top_sub_'+c_id1).style.visibility='hidden';			
			}

			if(document.getElementById('top_menu_'+c_idc))
			{		
				document.getElementById('top_menu_'+c_idc).style.visibility='hidden';			
			}

			// record current value
			c_idc = channel_id;
		}		

//		inMnc = true;

}

function ToggleChannelMenuOff( channel_id )
{
		inMnc = false;
		mTmrc = setTimeout("timeOut()",300);	
}

function ct1(){
	clearTimeout(mTmr1);
	inMn1 = true;
}
	
function timeOut()
{
	if(  !inMn1 )
	{	
		// kill menu
		if(document.getElementById('top_sub_'+c_id1))
		{		
			document.getElementById('top_sub_'+c_id1).style.visibility='hidden';			
		}
	

		if( !inMnc )
		{
			if(document.getElementById('top_menu_'+c_idc))
			{		
				document.getElementById('top_menu_'+c_idc).style.visibility='hidden';			
			}
		}
	}
}

// sub menu under categories in channel
function rollOn1( id, i )
{
	ct1();

	if( id != c_id1)
	{
		var citem = document.getElementById( 'top_sub_'+c_id1 )
		if( citem )
			citem.style.visibility='hidden';			
	}
	
	var sub = document.getElementById( 'top_sub_'+id )
	if( sub )
	{		
		/*var margin = document.body.clientWidth-770
		if( margin<0 )
			margin = 0*/
		sub.style.left = /*margin/2 + */205 + (i-1)*82
		sub.style.visibility='visible';	
		sub.style.zindex = 99999;	
	}

	c_id1 = id;
}

function rollOff1( )
{
	inMn1 = false;
	mTmr1 = setTimeout("timeOut()",300);	
}


<!-- flashing programs on home page -->

	var mTmr = null;
	var NUM_BLOCKS = 4;
	var NUM_PROGRAM = 3;

	function setTimer()
	{
		clearTimeout(mTmr);
		mTmr = setTimeout("RotateFlash()",6000);	
	}

	var flashIndex = 0;

	function RotateFlash()
	{
		var i = flashIndex;
		

		for( i=flashIndex; i<flashIndex+ NUM_BLOCKS; i++ )
		{
			var o = document.all['flash_' + i];
			if( o != null )
				o.style.display = 'none';		

			o = document.all[ 'flash_' + ( (i+ NUM_BLOCKS) % (NUM_BLOCKS*NUM_PROGRAM) )];
			if( o != null )
				o.style.display = '';

		}

		flashIndex = i % (NUM_BLOCKS*NUM_PROGRAM);

		setTimer();
	}

	function RotateChannel( channel_id, current, next )
	{
			var o = document.all['flash_' + channel_id + current];
			o.style.display = 'none';		

			o = document.all[ 'flash_' + channel_id + next];
			o.style.display = '';
	}


	function OpenSearch()
	{
		window.open( "/googlesearch.asp", "searchwindow", 'width=250,height=80,top=150,left=600,scrollbars=auto,resizable=1,statusbar=no').focus();
	}

	function OpenPlayer( file, title )
	{
		window.open( "/fplayer.asp?file=" + file + "&title=" + title, "fplayer", 'width=400,height=40,top=150,left=600,scrollbars=no,resizable=0,statusbar=no').focus();
	}