var file;
var ffile;
var islogin;
var wokao;
var ml;
var width = 573;
var height = 528;
	width = 573;
	height = 435;
var tt = 0;
if(screen.width<1024){
	width = 573;
	height = 400;
}
var Type;
var loadingbar=false;
var fullplay = false;
var servers = new Array();
servers[0]=['', ''];
var currentserver;
var serverid = (currentserver!=null) ? currentserver:Math.floor(Math.random()*(servers.length-1));
var servername = servers[serverid][0];
var server     = "";
//////////////////////////////////////

//////////////////////////////////////
var lad = "<div id='load_flash' style='background:#000;width:"+width+"px;height:"+(height-10)+"px;padding-top:50px;font-size:14px;font-weight:bold;color:red;'><br />»¶Ó­À´µ½ÁùÒ»Flash...<br /><iframe marginwidth=0 marginheight=0 frameborder=0 bordercolor='#000000' scrolling=no src='/300.html' width='500' height='300'></iframe></div>";
function getType(){
	var pattern = /(.*)\.(.*)$/gi;
	var arr = pattern.exec(file);
	return RegExp.$2;
}
function fuck(){
	file = ""+wokao;
}


//var filewj = "http://flash.3576.com/20070315095224166.swf";

function makeFlashPlayer(src, id, width, height){
	document.write("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' id=" + id + " WIDTH=" + width + " HEIGHT=" + height + "><PARAM NAME=src VALUE='"+ src +"'><PARAM NAME=quality VALUE=\"high\"><EMBED src='" + src + "' id='" + id + "' loop=false menu=false WIDTH=" + width + " HEIGHT=" + height + " TYPE='application/x-shockwave-flash' PLUGINSPAGE='=http://www.macromedia.com/shockwave/download/index.cgi?P1_Pro d_Version=ShockwaveFlash'></EMBED></OBJECT>");
}

var file;

function loaded(){
	tt = tt+30;
	if(loadingbar){
		loadingbar.style.display='';
		bg = document.getElementById('bar');
		bb = document.getElementById('percent');
	}
	if(document.getElementById('flash').PercentLoaded()<0) {
		hid();
	} else {
		if(loadingbar){
			bg.style.width=5 * document.getElementById('flash').PercentLoaded();
			bb.innerHTML=document.getElementById('flash').PercentLoaded() + '%';
		}
	}
	if(document.getElementById('flash').PercentLoaded()<100) {
		if(tt>10000) hid();
		var timeout = window.setTimeout(loaded,30);
	} else {
		if(loadingbar) loadingbar.style.display='none';
		if(tt<2500){
			var timeout = window.setTimeout(loaded,30);
		} else {
			tt = 0;
			clearTimeout(timeout);
			hid();
		}
	}
}
function hid(){
	//if(document.all && document.getElementById('flash').PercentLoaded()==100) document.location.href="#best";
	if(document.getElementById('load_flash')!=null) document.getElementById('load_flash').style.display='none';
	document.getElementById('flash').style.display='';
}
function play(){
	fuck();
		if(document.getElementById('percentdiv')!=null) loadingbar = document.getElementById('percentdiv');
	Type = getType();

		if(!fullplay){
			var s_html="";
			for (var i=0; i<servers.length; i++){
				if(serverid==i){
					s_html+="<a id='s"+i+"' class='current' href='javascript:changeserver("+i+");'>"+servers[i][0]+"</a>";
				} else {
					s_html+="<a id='s"+i+"' href='javascript:changeserver("+i+");'>"+servers[i][0]+"</a>";
				}
			}
			if(document.getElementById('servers')!=null)
			document.getElementById('servers').innerHTML="<div class=\"center\">"+s_html+"</div>";
		}
	if(loadingbar) loadingbar.style.display='none';
	switch(Type){
	default: 

		if(document.all && ml!=false){
			if(loadingbar) loadingbar.style.display='';
			document.write(lad);
       			makeFlashPlayer(file, "flash", width, height);
			document.getElementById('flash').style.display='none';
			loaded();
		} else {
       		makeFlashPlayer(file, "flash", width, height);
			document.getElementById('flash').style.display='none';
		}
		break;
	}
}

