/*
VIDEO FUNCTIONS FOR H.O.C. TEMPLATE SYSTEM
REQUIRES JWPLAYER
*/
	currentvideo = 0;
	oldvideo = 0;

	function initvideo()
	{
		vdiv = document.getElementById('vidframe');
		pdiv = document.getElementById('playerframe');
		pdiv.style.left = vdiv.offsetLeft+40;
		pdiv.style.top = vdiv.offsetTop;
	}

	function thisMovie(swf) {
	  if(navigator.appName.indexOf("Microsoft") != -1) {
		return document.getElementById(swf);
	  } else {
	    return document[swf];
	  }
	};

	function stopcurrentvideo()
	{
		if (oldvideo > 0)
		{
			thisMovie('mediaplayer').sendEvent('stop');
//			vdiv = document.getElementById('vidframe'+oldvideo);
//			pdiv = document.getElementById('playerframe');
//			pdiv.style.visibility = 'hidden';
//			vdiv.style.height = 1;
//			vdiv.style.border = 'none 1px;';
			oldvideo = 0;
		}
	}

	function playvideo(vid,vfile)
	{
		currentvideo = vid;
		if (currentvideo != oldvideo)
		{
			stopcurrentvideo();
			vdiv = document.getElementById('vidframe');
			pdiv = document.getElementById('playerframe');
//			vdiv.style.height = 320;
//			vdiv.style.border = 'solid 1px;';
//			pdiv.style.left = vdiv.offsetLeft+50;
//			pdiv.style.top = vdiv.offsetTop;
//			pdiv.style.visibility = 'visible';
			thisMovie('mediaplayer').loadFile(vfile); 
			thisMovie('mediaplayer').sendEvent('playitem',0); 
			oldvideo = currentvideo;
		} else {stopcurrentvideo();currentvideo = 0}
 	}

	function xxplayvideo(file,fdesc)
	{
		thisMovie('mediaplayer').sendEvent('stop');
		thisMovie('mediaplayer').loadFile(file); 
		thisMovie('mediaplayer').sendEvent('playitem',0); 
		vdlay = document.getElementById('videodesc');
		vdlay.innerHTML = 'Geladen: '+fdesc;
	}

