

/***********************************************
* Image Thumbnail viewer- © Dynamic Drive (www.dynamicdrive.com)
* Last updated Sept 26th, 03'. This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
var urlText=""
var tauto="auto"
var tpointer="pointer"
var ie=document.all
var videowidth=320
var videoheight=270
var ns6=document.getElementById && !document.all
var enablevideo=false
if (ie||ns6)
var sidevideoobj=document.all? document.all["sidevideo"] : document.getElementById? document.getElementById("sidevideo") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat" && !window.opera)? document.documentElement : document.body
}

function sidevideo(thetext){
if (ns6||ie){
/*	urlText=thetext.toLowerCase() */
 	urlText=thetext  
	enablevideo=true
	sidevideoobj.innerHTML="<table style='width:320px'><tr><td style='width:100%'><span id=titletext2>"+thetext+"</span></td><td><span id=closetext onClick='hsidevideo()'>x</span></td></tr>"
	sidevideoobj.innerHTML+="<tr><td colspan=2><iframe FRAMEBORDER=0 SCROLLING=NO height=270 width=320 marginwidth=0 marginheight=0 src=http://download.mcneel.com/s3/mcneel/rhino/4.0/clips//"+urlText+".htm></iframe></td></tr></table>"
	positionsidevideo()
	sidevideoobj.style.visibility="visible"
	return false
	}
}

/* function showsidevideo(){
	if (ie||ns6)
		sidevideoobj.innerHTML="<div align=right id=dragbar><span id=closetext onClick='hsidevideo()'>Close</span></div><br><iframe FRAMEBORDER=0 SCROLLING=NO height=240 width=320 marginwidth=0 marginheight=0 src="+urlText+"></iframe>"
		sidevideoobj.style.visibility="visible"
	} */

function clearshowsidevideo(){
	if (window.delayshowst)
		clearTimeout(delayshowst)
}



function positionsidevideo(e){
if (enablevideo){
	if (ie||ns6){
		pgyoffset=ns6? parseInt(pageYOffset) : parseInt(ietruebody().scrollTop)
		horzpos=ns6? pageXOffset+20 : ietruebody().scrollLeft+20
		vertpos=ns6? pgyoffset+window.innerHeight/2-imgheight/2 : pgyoffset+ietruebody().clientHeight/2-imgheight/2
		if (window.opera && window.innerHeight) //compensate for Opera toolbar
			vertpos=pgyoffset+window.innerHeight/2-imgheight/2
		vertpos=Math.max(pgyoffset, vertpos)
		sidevideoobj.style.left=horzpos+"px"
		sidevideoobj.style.top=vertpos+"px"
		}		
	}
}


function hsidevideo(){
if (ns6||ie){
	enablevideo=false
	sidevideoobj.style.visibility="hidden"
	sidevideoobj.style.left="-1000px"
	sidevideoobj.style.backgroundColor=''
	sidevideoobj.style.width=320
	sidevideoobj.innerHTML=""
	}
}

function hidesidevideo(){
	if (ie||ns6){
		clearshowsidevideo()
		delayhidest=setTimeout("hsidevideo()",500)
		}
	}

function clearhidesidevideo(){
	if (window.delayhidest)
		clearTimeout(delayhidest)
}

document.onmousemove=positionsidevideo
