function openPlayer(vid, player)
{
	var player = window.open(player + '?vid=' + vid, 'playerwindow', 'height=427, width=488, top=50, left=50, toolbar=no, menubar=no, scrollbars=no, resizable=yes,location=no, status=no');
}


function showFlash(url, width, height)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + width + '" height="' + height + '">');							
	document.write('<param name="movie" value="' + url + '" />');			   
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="opaque">');
	document.write('<embed src="' + url + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>');	
	document.write('</object>');		
}

function showMediaPlayer(url, width, height)
{
	document.write('<OBJECT id="MediaPlayer" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="' + width + '" height="' + height + '">');							
	document.write('<param name="enableContextMenu " value="false">');			   
	document.write('<param name="enabled " value="0">');	
	document.write('<param name="uiMode" value="none">');	
	document.write('<param name="currentPosition" value="0">');	
	document.write('<param name="autostart" value="1">');	
	document.write('<param NAME="allowScan" value="-1">');	
	document.write('<param NAME="autoSize" VALUE="0">');	
	document.write('<param NAME="stretchToFit" VALUE="true">');	
	document.write('<param name="url" value="' + url + '"></OBJECT>');	
}


function ScrollBar(mainid, subid1, subid2, mainspeed, subspeed, step)
{
	this.MainBoxID = mainid;
	this.SubBoxID1 = subid1;
	this.SubBoxID2 = subid2;
	this.MainSpeed = mainspeed || 2000;
	this.SubSpeed = subspeed || 30;
	
	this.Step = step || -1;
	var Me = this;
	
	this.lock = false;
	this.i = 1;
	this.maininterval = null;
	this.subinterval = null;
	
	this.Load = function()
	{
		document.getElementById(this.SubBoxID2).innerHTML=document.getElementById(this.SubBoxID1).innerHTML;
		document.getElementById(this.MainBoxID).scrollTop=document.getElementById(this.MainBoxID).scrollHeight;
		document.getElementById(this.MainBoxID).ScrollBar = this;
		
		document.getElementById(this.MainBoxID).onmouseover=function()
		{
			this.ScrollBar.Stop();
		}
		document.getElementById(this.MainBoxID).onmouseout=function()
		{
			this.ScrollBar.Play(true);
		}
		
		this.Play();
	}
	
	
	this.Marquee = function()
	{
		if(Me.lock)
			return;
			
		Me.lock = true;
		if(document.getElementById(Me.SubBoxID2).offsetTop-document.getElementById(Me.MainBoxID).scrollTop<=0)
			document.getElementById(Me.MainBoxID).scrollTop-=document.getElementById(Me.SubBoxID1).offsetHeight-1;
		else
			document.getElementById(Me.MainBoxID).scrollTop++;

		if(Me.MainSpeed != -1)
		{
			if(Me.i >= Me.Step)
			{
				Me.Pause();
				Me.i = 1;
			}
			else
				Me.i++;
		}
		
		Me.lock = false;
	}
	
	this.Play = function(instant)
	{
		if(Me.MainSpeed == -1)
		{
			Me.Continue();
		}
		else
		{
			Me.Stop();
			
			if(instant) Me.Continue();
			Me.maininterval=setInterval(Me.Continue, Me.MainSpeed);
		}
	}
	
	this.Continue = function()
	{
		Me.Pause();
		Me.subinterval=setInterval(Me.Marquee, Me.SubSpeed);
	}
	
	this.Stop = function()
	{
		clearInterval(Me.maininterval);
		clearInterval(Me.subinterval);
	}
	
	this.Pause = function()
	{
		clearInterval(Me.subinterval);
	}	
}