function toggleArrow( obj )
{
	var image = obj.childNodes[0]; /* get image */
	if( image.src.lastIndexOf( "_right" ) != -1 )
		image.src = image.src.replace( "_right", "_down" );
	else
		image.src = image.src.replace( "_down", "_right" );
}

function bookmarkSite( title, url )
{
    if( document.all )
    {
        window.external.AddFavorite( url, title );
    }
    else if( window.sidebar )
    {
        window.sidebar.addPanel( title, url, "" );
    }
}

function openImage( imageSrc, width, height )
{
	var imgWindow = open( "", "", "width=" + width + ",height=" + height );
	if( typeof width == 'undefined' )
		width = 400;
	if( typeof height == 'undefined' )
		height = 300;
	
	imgWindow.document.write( "<body style='margin: 0px' oncontextmenu='return false'>" );
	imgWindow.document.write( "<table width='100%' height='100%' cellpadding='0' cellspacing='0'>" );
	imgWindow.document.write( "<tr><td align='center' valign='center'>" );
	imgWindow.document.write( "<img src='" + imageSrc + "' />" );
	imgWindow.document.write( "</td></tr></table></body>" );
	imgWindow.document.close();
	imgWindow.focus();
}

function showTime( showSeconds )
{
	var date = new Date();
	var localTime = document.getElementById( 'localTime' );
	if( localTime )
	{
		var hours = date.getHours();
		var minutes = date.getMinutes();
		var seconds = date.getSeconds();
		
		if( hours < 10 )
			hours = "0" + hours;
		if( minutes < 10 )
			minutes = "0" + minutes;
		if( seconds < 10 )
			seconds = "0" + seconds;
		
		var time = hours + ":" + minutes;
		if( typeof showSeconds == 'undefined' || showSeconds )
			time += ":" + seconds;
		localTime.innerHTML = time;
	}
	
	var gmtTime = document.getElementById( 'gmtTime' );
	if( gmtTime )
	{
		var hours = date.getUTCHours();
		var minutes = date.getUTCMinutes();
		var seconds = date.getUTCSeconds();
		
		if( hours < 10 )
			hours = "0" + hours;
		if( minutes < 10 )
			minutes = "0" + minutes;
		if( seconds < 10 )
			seconds = "0" + seconds;
		
		var time = hours + ":" + minutes;
		if( typeof showSeconds == 'undefined' || showSeconds )
			time += ":" + seconds;
		gmtTime.innerHTML = time;
	}
	
	if( localTime || gmtTime )
	{
		if( typeof showSeconds == 'undefined' || showSeconds )
			setTimeout( "showTime()", 200 );
		else
			setTimeout( "showTime( false )", 200 );
	}
	
	var localDate = document.getElementById( 'localDate' );
	if( localDate )
	{
		var month = date.getMonth();
		var monthStr = getMonthAbbrev( month );
		var day = date.getDate();
		
		var dateStr = monthStr + " " + day;
		localDate.innerHTML = dateStr;
	}
	
	var gmtDate = document.getElementById( 'gmtDate' );
	if( gmtDate )
	{
		var month = date.getUTCMonth();
		var monthStr = getMonthAbbrev( month );
		var day = date.getUTCDate();
		
		var dateStr = monthStr + " " + day;
		gmtDate.innerHTML = dateStr;
	}
}

function getMonthAbbrev( month )
{
	switch( month )
	{
		case 0: return 'Jan';
		case 1: return 'Feb';
		case 2: return 'Mar';
		case 3: return 'Apr';
		case 4: return 'May';
		case 5: return 'Jun';
		case 6: return 'Jul';
		case 7: return 'Aug';
		case 8: return 'Sep';
		case 9: return 'Oct';
		case 10: return 'Nov';
		case 11: return 'Dec';
	}
	
	return '';
}
