// JavaScript Document


function showPanel( objPanel )
{
	if ( document.getElementById(objPanel).style.display != 'none' )
	{
		document.getElementById(objPanel).style.display = 'none';
	}
	else
	{
		document.getElementById(objPanel).style.display = 'block';
	}
}


function submitForm() {
	//make sure hidden and iframe values are in sync before submitting form
	//to sync only 1 rte, use updateRTE(rte)
	//to sync all rtes, use updateRTEs
//	updateRTE('rte1');
	updateRTEs();
	//change the following line to true to submit form
	return true;
}

function hiLightRow()
{
	
}


function nextArticle( page, obj )
{
	window.location = page + "?id=" + obj.value;
}

function showWp( filename, width, height ) 
{
	window.open('showwp.php?image='+filename,'','width='+width+',height='+height+',scrollbars=1, resize=yes,location=no,status=yes');
}

function showInputs( numberToShow )
{
	var item3 = document.getElementById('item3');
	var item4 = document.getElementById('item4');
	var item5 = document.getElementById('item5');
	var itemtxt3 = document.getElementById('itemtxt3');
	var itemtxt4 = document.getElementById('itemtxt4');
	var itemtxt5 = document.getElementById('itemtxt5');	

	item3.style.visibility = 'visible';
	item4.style.visibility = 'visible';
	item5.style.visibility = 'visible';	
	itemtxt3.style.visibility = 'visible';
	itemtxt4.style.visibility = 'visible';
	itemtxt5.style.visibility = 'visible';	
		

	if ( numberToShow == 2 ) {
		item3.style.visibility = 'hidden';
		itemtxt3.style.visibility = 'hidden';			
	}
	if ( numberToShow <= 3 ) {
		item4.style.visibility = 'hidden';
		itemtxt4.style.visibility = 'hidden';			
	}
	if ( numberToShow <= 4 ) {
		item5.style.visibility = 'hidden';	
		itemtxt5.style.visibility = 'hidden';			
	}
}

	var oldClass;

	function highlightVideo( table )
	{
		oldClass = table.className
		table.className = 'videoHighlight';
		table.style.cursor = 'pointer';
	}



	function lowlightVideo( table )
	{
		table.className = oldClass;
		table.style.cursor = 'auto';
	}

	function showVideo( video, videoItem )
	{
		var objFillVal = document.getElementById('videoFrame');
		var temp;
		var strFlash;
		
		for ( var i = 1; i <= 3; i++ ) {
			temp = document.getElementById('video_' + i );
			if ( temp ) 
				temp.className = 'videoNormal';
		}
		if ( typeof(videoItem) == 'object' )
			videoItem.className = 'videoSelected';		
		oldClass = 'videoSelected';
		strFlash = 	'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="230" height="210" id="vidplay" align="middle">';
		strFlash = strFlash + '	<param name="allowScriptAccess" value="sameDomain" />';
		strFlash = strFlash + '	<param name="movie" value="vidplay.swf?video=' + video + '" />';
		strFlash = strFlash + '	<param name="quality" value="high" />';
		strFlash = strFlash + '	<param name="bgcolor" value="#ffffff" />';
		strFlash = strFlash + '	<embed src="vidplay.swf?video=' + video + '" quality="high" bgcolor="#ffffff" width="230" height="210" name="vidplay" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
		strFlash = strFlash + '</object>';
		
		objFillVal.innerHTML = strFlash;				
	}

