function showstatus(sURL)
{
   window.status = sURL;
   return true;
}
function goto(sURL)
{
	document.location = sURL;
	return false;
}

var currentPlayer=null;
var placePlayer=null;
var currentFile;
var currentImage;

function removeOldPlayer() {busy=false;
	document.getElementById(placePlayer).className = 'vid-off';
	document.getElementById(currentPlayer).innerHTML = '<img src="'+currentImage+'" border="0" onclick="createPlayer(\''+currentPlayer+'\', \''+currentFile+'\', \''+currentImage+'\')">';
}

function createPlayer(thePlace, theFile, theImage, go, nid) {
	if (currentPlayer!=null) { removeOldPlayer(); }

	currentPlayer=thePlace;
	currentFile=theFile;
	currentImage=theImage;
	placePlayer='place' + nid;
	
	var o = document.getElementById(placePlayer);
	o.className = 'vid-on';

	var s = new SWFObject("/files/Player.swf","thePlayerId","130","100","7");
	s.addParam("allowfullscreen","true");
	s.addVariable("file",theFile);
	s.addVariable("width","130");
	s.addVariable("height","100");
	s.addVariable("displayheight","100");
	s.addVariable("overstretch","fit");
	s.addVariable("image",theImage);
	s.addVariable("showicons","false");
	if (go) { s.addVariable("autostart","true"); }

	s.write(thePlace);
}
function setSortBy(sb)
{
	document.getElementById('sortby').value = sb;
	document.form1.submit();
}



function toggle(obj)
{
	var o = document.getElementById(obj);
	
	if(o.style.display = "")
	{
		o.style.display = "none";
	}
	else
	{
		o.style.display = "";
	}
}

function changeClass(obj, className)
{
	var o = document.getElementById(obj);
	o.className = className;
}

function promoToggle(expander, content)
{
	var ex = document.getElementById(expander);
	var co = document.getElementById(content);
	
	if(co.style.display == "")
	{
		co.style.display = "none";
		ex.className = "promoExpand";
	}
	else
	{
		co.style.display = "";
		ex.className = "promoCollapse";
	}
}

function formSubmit(obj)
{
	var o = document.getElementById(obj);
	o.submit();
}

/*pop up
***********************/

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}