function loadVideo(path, widescreen, img, plugins, mediaId, mediaGroup, trackId, trackDomain) {
	
	if(widescreen) {
		nHeight = 314;
		nWidth = 556;
	} else {
		nHeight = 314;
		nWidth = 421;
	}
	
	if (typeof (webtrekk) != undefined){
		//webtrekk.mediaPlayerId = 'video1';
		//webtrekk.mediaId = mediaId;
	}
	
	var s1 = new SWFObject('/global/utils/player.swf','player',nWidth,nHeight,'9');
	s1.addParam('allowfullscreen','true');
	s1.addParam('allowscriptaccess','always');
	s1.addParam('flashvars','image=/files/smthumbnaildata/550x'+img+'&backcolor=ffffff&frontcolor=193647&autostart=false&file=' + path + '&plugins='+plugins+'&webtrekk.media_id='+mediaId+'&webtrekk.media_group='+mediaGroup+'&webtrekk.track_id='+trackId+'&webtrekk.track_domain='+trackDomain);
	s1.write('videocontent');
}

function goToVideo(id) {
	loadVideo(aVids[id]);
	actVid = id;
	
	if(actVid == 0)
		document.getElementById("prevbutton").style.display = "none";
	else	
		document.getElementById("prevbutton").style.display = "block";
		
	if(actVid == aVids.length - 1)
		document.getElementById("nextbutton").style.display = "none";
	else	
		document.getElementById("nextbutton").style.display = "block";
}


function doVideoPopUp(path, widescreen, pk, img, dat, plugins, mediaId, mediaGroup, trackId, trackDomain) {
		
	if (windowG) {
		windowG.destroy();
	}
	
	if(widescreen) {
		nWidth = 587;
		nWinWidth = 640;
	} else {
		nWidth = 452;
		nWinWidth = 505;
	}
	
	if(document.getElementById(pk + 'credit').innerHTML.length)
		sPipe = " | ";
	else
		sPipe = "";
	
	windowG = new Ext.Window({       
		renderTo: Ext.getBody(),
		resizable:false,        
		width: nWinWidth,
		cls: 'gallerypopup videopopup profilepopup',		
        minWidth: 300,
        minHeight: 200,    
        bodyStyle:'',
        buttonAlign:'center',
        items:	[{html:
					'	<div class="gallerypopup" style="width:' + nWidth + 'px">'+
					'		<h1 style="margin:0px 0px 5px 0px; float: left;">' + document.getElementById(pk + 'filetitle').innerHTML + '</h1><br clear="all" />'+
					'		<div class="clearfix">'+
					'			<div id="videocontent"></div>'+
					'			<div class="fullsize" style="width:'+nWidth+'px;"><div class="description"><div class="caption clearfix"><div class="flr">' + dat + sPipe + document.getElementById(pk + 'credit').innerHTML + '</div>		</div>		<div class="line_dashed"><!--leer--></div>		<div class="text">'+ document.getElementById(pk + 'filedescription').innerHTML +'</div>	</div></div>'+
					'		</div>'+
					'	</div>'							
				}],
		plain:false,
	    floating:true,
	    modal:true,
	    title:'<a style="cursor:pointer" class="mysitegallerydestroy" onclick="windowG.destroy()"><span class="flr" style="font-size:11px !important;padding-right:5px; padding-top:1px; color:#FFFFFF !important;">Schlie&szlig;en</span></a>',
	    shadow:false
    });
	windowG.setPosition(200,75);
	windowG.show();	
	
	loadVideo(path, widescreen, img, plugins, mediaId, mediaGroup, trackId, trackDomain);
}
