var uniworld__flash_play_time=0;
(function($){
		  
		  
		  
		  $.fn.show_flash=function(video_swf,video_url,video_width,video_height,auto_play)
		  {
			  	var html="";
				html+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+video_width+'" height="'+video_height+'" id="flash_video" align="middle">';
				html+='<param name="wmode" value="transparent" />';
				html+='<param name="allowScriptAccess" value="sameDomain" />';
				html+='<param name="FlashVars" value="video_url='+video_url+'&auto_play='+auto_play+'" />';
				html+='<param name="movie" value="'+video_swf+'" />';
				html+='<param name="quality" value="high" />';
				html+='<param name="wmode" value="transparent" />';
				//html+='<param name="wmode" value="window" />';
				html+='<param name="allowFullScreen" value="true" />';
				html+='<param name="bgcolor" value="#ffffff" />';
				html+='<embed src="'+video_swf+'" quality="high" bgcolor="#ffffff"  width="'+video_width+'" height="'+video_height+'" name="flash_video" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"  FlashVars="video_url='+video_url+'&auto_play='+auto_play+'" wmode="transparent" allowfullscreen="true"/>';
				html+='</object>';
				$(this).html(html);
		  }
})(jQuery)


jQuery.flash=function(video_swf,video_url,video_width,video_height,auto_play)
{
		var html="";
		
		html=uniworld_flash__string(video_swf,video_url,video_width,video_height,auto_play);
	
		document.write(html);
}
	


function uniworld_flash__string(video_swf,video_url,video_width,video_height,auto_play)
{
	var html="";
	if (uniworld__flash_play_time==0)
	{		
		
		html+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+video_width+'" height="'+video_height+'" id="flash_video" align="middle">';
		html+='<param name="wmode" value="transparent" />';
		html+='<param name="allowScriptAccess" value="sameDomain" />';
		html+='<param name="FlashVars" value="video_url='+video_url+'&auto_play='+auto_play+'" />';
		html+='<param name="movie" value="'+video_swf+'" />';
		html+='<param name="quality" value="high" />';
		html+='<param name="bgcolor" value="#ffffff" />';
		//html+='<param name="wmode" value="transparent" />';

		html+='<param name="allowFullScreen" value="true" />';
		html+='<embed src="'+video_swf+'" quality="high" bgcolor="#ffffff"  width="'+video_width+'" height="'+video_height+'" name="flash_video" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"  FlashVars="video_url='+video_url+'&auto_play='+auto_play+'" wmode="transparent" allowFullScreen="true"/>';
		html+='</object>';
		//document.write(html);
	}
	else
	{
		
		html+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+video_width+'" height="'+video_height+'" id="flash_video" align="middle">';
		html+='<param name="wmode" value="transparent" />';
		html+='<param name="allowScriptAccess" value="sameDomain" />';
		html+='<param name="FlashVars" value="video_url='+video_url+'&auto_play='+auto_play+'&time_image="'+uniworld__flash_play_time+' />';
		html+='<param name="movie" value="'+video_swf+'" />';
		html+='<param name="quality" value="high" />';
		html+='<param name="bgcolor" value="#ffffff" />';
		html+='<param name="wmode" value="transparent" />';
		html+='<param name="wmode" value="window" />';
		html+='<param name="allowFullScreen" value="true" />';
		html+='<embed src="'+video_swf+'" quality="high" bgcolor="#ffffff"  width="'+video_width+'" height="'+video_height+'" name="flash_video" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"  FlashVars="video_url='+video_url+'&auto_play='+auto_play+'" wmode="transparent"/>';
		html+='</object>';
		
		
	}
	
	return html;

}

$(function(){
$("body").append('<div id="uniworld_flash_full_screen_wrap" style="display:none;"></div><div id="uniworld_flash_full_screen" style="display:none;"></div>');
		   });



function uniworld_flash__black_background(html)
{
	var Height_e
	var width=document.body.clientWidth;
	if(document.documentElement.scrollHeight<window.screen.availHeight)
	{
		Height_e=window.screen.availHeight;
	}
	else
	{
		Height_e=document.documentElement.scrollHeight;		
	}
	
	
	
	$("#uniworld_flash_full_screen_wrap").css("position","absolute");
	$("#uniworld_flash_full_screen_wrap").css("left","0px");
	$("#uniworld_flash_full_screen_wrap").css("width",width+"px");
	$("#uniworld_flash_full_screen_wrap").css("height",Height_e+"px");
	$("#uniworld_flash_full_screen_wrap").css("top","0px");
	$("#uniworld_flash_full_screen_wrap").css("background-color","#fff");
	$("#uniworld_flash_full_screen_wrap").css("filter","alpha(opacity=50)");
	$("#uniworld_flash_full_screen_wrap").css("-moz-opacity","0.5");
	$("#uniworld_flash_full_screen_wrap").css("z-index","99");
	//$("#PopDiv01").css("display","");
	
//	$("#plus_description").css("filter","Alpha(opacity=80)");
//	$("#plus_description").css("-moz-opacity",".8");
	$("#uniworld_flash_full_screen_wrap").css("opacity","0.5");
	
	$("#uniworld_flash_full_screen").css("z-index","100");
	$("#uniworld_flash_full_screen").css("position","absolute");
	$("#uniworld_flash_full_screen").css("top",(parseInt(document.documentElement.scrollTop)+10)+"px");
	$("#uniworld_flash_full_screen").css("left","0px");
	$("#uniworld_flash_full_screen").css("width",width+"px");
	
	$("#uniworld_flash_full_screen").fadeIn();
	$("#uniworld_flash_full_screen_wrap").fadeIn();
	//$("#PopDiv02").css("height",Height_e+"px");
	//$("#PopDiv02").css("color","#fff");
	//$("#PopDiv02").css("display","");
	//html_string_inner='<div id="PopDiv02" style="position:absolute; left:; :; :'+width+'; z-index:100;">111</div>';
	
	
	
	$("#uniworld_flash_full_screen").html('<div style="width:960px; margin:0 auto; ">'+html+'</div>');
	$("img.original_picture").click(uniworld__confirm_close);
}


function uniworld_flash__confirm_close()
{
	//$("#PopDiv02").css("display","none");
	//$("#PopDiv01").css("display","none");
	$("#uniworld_flash_full_screen").fadeOut();
	$("#uniworld_flash_full_screen_wrap").fadeOut();
	$("#uniworld_flash_full_screen").html("");
}



function uniworld_flash__confirm(flash_string)
{
	//alert("ddd");
	var html="";
	var i;
	var ii=0;
	var total_price=0;
	var selecte_class="";
	//alert("debug");
	html+='<div class="image_pop">';
	
	html+='<div class="head">';	

	html+='<a href="javascript:uniworld_flash__confirm_close();" style="background-image:url(/template/upload/file/2010-1-27/Close_button.jpg);height:26px;width:26px;overflow:hidden;float:right;margin:10px; clear:both;"></a>';
	
	html+="</div>"

	html+='<div class="uniworld_flash">';
	html+=uniworld_flash__string("/template/flash/video.swf","/template/upload/flv/rockwell.f4v",600,450,0);
	//html+=uniworld_flash__string(flash_string,"/template/flash/video-full.swf",600,450,0);
	html+='</div>';

	
	html+='</div>';	
	//alert(html);
	//alert("debug");
	
	uniworld_flash__black_background('<div style="margin:0 auto; width:650px;">'+html+'</div>');
	
}

