// JavaScript Document
var mHeight, mWidth, mSrc, mName, uFlag;
var overlay, mov_player, movie_file, info_layer, movielay, closebtn;
var jdtop = 0;

function djBox_remove() {
		movielay.set('tween', { duration: 550 }); movielay.tween('opacity', 0.9, 0);
		closebtn.set('tween', { duration: 550 }); closebtn.tween('opacity', 1, 0);
		overlay.set('tween', { duration: 550 }); overlay.tween('opacity', 0.8, 0);
		overlay.set('tween', {
           duration: 650,
			onComplete: function(){
                if ($('djBox')) { $('djBox').dispose(); $('movieBox').dispose(); $('close_btn').dispose(); }
            }
        });
        overlay.tween('opacity', 0.8, 0);

	}


	function prepare_Page(mSrc, mWidth, mHeight) {
		
	
		// mWidth = 960; mHeight =540+16; 
		mHeight =mHeight+16;
		//overlay
		overlay = new Element('div', { 'id':'djBox','styles':{ 'opacity':'0','visibility':'visible' }}).inject($(document.body));
		overlay.setStyles({'left': $(document.body).getCoordinates().left+1,'top':Window.getScrollTop(),'height':Window.getHeight(), 'width': $(document.body).getCoordinates().width-2});	

		//movie frame
		movielay = new Element('div', { 'id':'movieBox','styles':{ 'opacity':'0','visibility':'visible' }}).injectInside(document.body);
		movielay.setStyles({ 'top': Window.getScrollTop()+(Window.getHeight()/2-(mHeight/2)-16),'height':mHeight, 'width':mWidth, 'left': $(document.body).getCoordinates().width/2-(mWidth/2)-15});
		
		closebtn = new Element('div', { 'id':'close_btn','styles':{ 'opacity':'0','visibility':'visible' }}).injectInside(document.body);
		closebtn.setStyles({ 'top': $(movielay).getCoordinates().top-12,'height':24, 'width':24, 'left': $(movielay).getCoordinates().left+mWidth+20 });
		closebtn.innerHTML = '<img src="/_images/_interface/utility/close.png" width="24" height="24" class="iepngfix">';

	    overlay.set('tween', { duration: 650 }); overlay.tween('opacity', 0, 0.8);
		movielay.set('tween', { duration: 650 }); movielay.tween('opacity', 0, 0.9);
		closebtn.set('tween', { duration: 650 }); closebtn.tween('opacity', 0, 1);
		
		//close button
		//overlay.onclick = djBox_remove;
		closebtn.onclick = djBox_remove;
	
				info_layer = '';
	
					
					mov_player = '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"'+ 
					'codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="'+mWidth+'" height="'+mHeight+'" id="movie1">'+ 
					'<param name="src" value="'+ mSrc +'">'+ 
					'<param name="autoplay" value="true">'+
					'<param name="controller" value="true">'+
					'<param name="scale" value="tofit">'+
					'<param name="enablejavascript" value="true">'+
					'<param name="loop" value="true">'+
					'<param name="bgcolor" value="#000">'+
					'<embed width="'+mWidth+'" height="'+mHeight+'" enablejavascript="true" name="movie1"'+ 
					' src="'+ mSrc +'" scale="tofit"  controller="true" loop="true" bgcolor="#000"  pluginspage="http://www.apple.com/quicktime/download/">'+ 
					'</embed></object>' + info_layer;
					
					$('movieBox').innerHTML = mov_player;

				
			uFlag = true;


}
