//////////////////////////////////////////////////////////////
// PWG Controls
// v1.00 (Pelco)
//
// Description:
//////////////////////////////////////////////////////////////
// Various PWG Portfolio functions
//////////////////////////////////////////////////////////////
//
// Usage:
//////////////////////////////////////////////////////////////
// <script language="javascript" src="js/pwg.js"></script>
//////////////////////////////////////////////////////////////
//
// v1.00 Notes
// -----------
//
// Known Issues
// ------------
//
//////////////////////////////////////////////////////////////

currentId = 0;



// Fires when user mouses over / out a home page thumbnail
function Hilight( id, isHilighted )
{
	var div = document.getElementById( "frame_still" + id );

	div.className = isHilighted ? "hilighted" : "normal";
}


// Fires when user mouses over / out a portfolio page thumbnail / link
function HilightThumb( id, isHilighted )
{
	// Return if current video is already highlighted
	if( id == currentId )return;


	var img = document.getElementById( "image_" + id );
	var link = document.getElementById( "link_" + id );

	img.className = isHilighted ? "selectedImage" : "";
	link.className = isHilighted ? "selectedText" : "";
}



// Fires when user clicks a video thumbnail
function SelectVideo( id, videoFile )
{
	// Return if current video clicked again
	if( id == currentId )	return;


	// Swap video
	if (navigator.appName.indexOf("Microsoft") != -1)
		videoPlayer.Reload( videoFile );
	else
		videoPlayer2.Reload( videoFile );


	// Swap styles
	if( currentId != 0 )
	{
		document.getElementById( "link_" + currentId ).className = "";
		document.getElementById( "image_" + currentId ).className = "";
	}

	document.getElementById( "link_" + id ).className = "selectedText";
	document.getElementById( "image_" + id ).className = "selectedImage";


	currentId = id;
}
