cpVideoplayer = function(id,videofile,type,w,h){
	this.name=id;
	this.videofile=videofile;
	this.h=h;
	this.w=w;
	if(type=='qt') this.video='<embed src="'+this.videofile+'" type="video/quicktime" pluginspace="http://www.apple.com/quicktime/download/" scale="TOFIT" autoplay="true" controller="true" name="movie1" height="'+this.h+'" width="'+this.w+'">';
	if(type=='flash') this.video='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="480" height="360" id="videoplayer2" align="middle">'+
		'<param name="flashVars" Value="VidName='+this.videofile+'" >'+
		'<param name="allowScriptAccess" value="sameDomain" />'+
		'<param name="allowFullScreen" value="true" />'+
		'<param name="movie" value="pic/videoplayer2.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" />	<embed src="pic/videoplayer2.swf" quality="high" bgcolor="#000000" width="480" height="360" name="videoplayer2" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" flashVars="VidName='+this.videofile+'" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer_de" />'+
		'</object>';
	this.init=function(){
		drawBGDiv(this.name+'BG');
		var contentDiv=document.createElement("div");
		contentDiv.id=contentDiv.name=this.name+'ContentDiv';
		contentDiv.style.zIndex='101';
		contentDiv.style.position='absolute';
		contentDiv.style.top=(Math.max(document.documentElement.scrollTop,document.body.scrollTop)) + ((document.documentElement.clientHeight-this.h)/2)-20+'px';
		contentDiv.style.left=((document.documentElement.clientWidth-this.w)/2)-2+'px';
		contentDiv.style.width=this.w+'px';
//		contentDiv.style.height=this.h+45+'px';
		contentDiv.style.padding='2px';
		contentDiv.style.background='#000000';
		document.getElementsByTagName('body')[0].appendChild(contentDiv);
		contentDiv.innerHTML='<div style="background:#ff7d00;border-bottom:1px solid #000000;height:38px;"><img style="float:left;" src="pic/popuplogo.jpg" /><img style="float:right; cursor:pointer;" onCLick="cpVideoplayerItem[\''+this.name+'\'].close();" src="pic/close.jpg" /></div>'+
			this.video+
			'<div style="background:#ff7d00;border-top:1px solid #000000;height:5px;"></div>';

	}

	this.close=function(){
		removeBGDiv(this.name+'BG');
		if(document.getElementById(this.name+'ContentDiv')!=null) document.getElementsByTagName('body')[0].removeChild(document.getElementById(this.name+'ContentDiv'));
		cpVideoplayerItem[this.name]=null;
	}

	this.init();
}


var cpVideoplayerItem=Array();

function addcpVideoplayer(id,videofile,type,w,h){
	if(cpVideoplayerItem[id]==null) {
		cpVideoplayerItem[id]=new cpVideoplayer(id,videofile,type,w,h);
	}
}
