
function getDragonFlashHtml(id,width,height,src,FlashVars)
{var html='<object id="'+id+'" name="'+id+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'" align="middle">\
  <param name="allowScriptAccess" value="always" />\
  <param name="movie" value="'+src+'" />\
  <param name="loop" value="false" />\
  <param name="quality" value="high" />\
  <param name="wmode" value="transparent" />\
  <param name="bgcolor" value="#ffffff" />\
  <param name="FlashVars" value="'+FlashVars+'" />\
  <embed name="dragonPanelFlash" src="'+src+'" loop="false" quality="high" wmode="transparent" bgcolor="#ffffff" width="'+width+'" height="'+height+'" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" FlashVars="'+FlashVars+'"/>\
 </object>';return html;}
function showDragonFlash(box,url,vars,idx,w,h)
{var boxObj=document.createElement('div');box.appendChild(boxObj);boxObj.id="dragonFlashBox"+idx;boxObj.innerHTML=getDragonFlashHtml("dragonFlash"+idx,w,h,url,vars);boxObj.style.position="relative";boxObj.style.width=w+"px";boxObj.style.height=h+"px";boxObj.style.display="block";boxObj.style.zIndex=65510;boxObj.style.marginRight="auto";boxObj.style.marginLeft="auto";}
function updateDragonFlash(box,url,vars,idx,w,h)
{box.innerHTML=getDragonFlashHtml("dragonFlash"+idx,w,h,url,vars);}
function showDragonBox(url,idx,total,tname,tips)
{var divname="dragonBox"+idx;var w=1024;var h=207;if($(divname))
{var boxObj=$(divname);updateDragonFlash(boxObj,url,"tname="+encodeURIComponent(tname)+"&tips="+encodeURIComponent(tips),idx,w,h);}
else
{var clientHeight=parseInt(document.documentElement.clientHeight,10);var scrollTop=parseInt(document.documentElement.scrollTop,10);var boxObj=document.createElement('div');document.body.appendChild(boxObj);boxObj.id=divname;boxObj.style.position="absolute";boxObj.style.left="0px";boxObj.style.top=scrollTop+clientHeight-486.5+1+(idx-1)*200+"px";boxObj.style.width="100%";boxObj.style.height=clientHeight+"px";boxObj.style.display="block";boxObj.style.textAlign="center";boxObj.style.zIndex=65510;window.onscroll=function()
{if($(divname))
{var clientHeight=parseInt(document.documentElement.clientHeight,10);var scrollTop=parseInt(document.documentElement.scrollTop,10);}}
showDragonFlash(boxObj,url,"tname="+encodeURIComponent(tname)+"&tips="+encodeURIComponent(tips),idx,w,h);}}
function playShakeStart(url,shakestr,tips)
{var divname="shakeStartBox";var w=1024;var h=800;hideDragonBox(1);if($(divname))
{var boxObj=$(divname);updateDragonFlash(boxObj,url,"dragon_shake="+encodeURIComponent(shakestr)+"&tips="+encodeURIComponent(tips),99,w,h);}
else
{var boxObj=document.createElement('div');document.body.appendChild(boxObj);boxObj.id=divname;boxObj.style.position="absolute";boxObj.style.left="0px";boxObj.style.top="0px";boxObj.style.width="100%";boxObj.style.height=h+"px";boxObj.style.display="block";boxObj.style.textAlign="center";boxObj.style.zIndex=65510;showDragonFlash(boxObj,url,"dragon_shake="+encodeURIComponent(shakestr)+"&tips="+encodeURIComponent(tips),99,w,h);}}
function playShakeOver(url,tips)
{var divname="shakeOverBox";var w=1024;var h=800;hideShakeStart();if($(divname))
{var boxObj=$(divname);updateDragonFlash(boxObj,url,"kicktips="+encodeURIComponent(tips),98,w,h);}
else
{var boxObj=document.createElement('div');document.body.appendChild(boxObj);boxObj.id=divname;boxObj.style.position="absolute";boxObj.style.left="0px";boxObj.style.top="0px";boxObj.style.width="100%";boxObj.style.height=h+"px";boxObj.style.display="block";boxObj.style.textAlign="center";boxObj.style.zIndex=65510;showDragonFlash(boxObj,url,"kicktips="+encodeURIComponent(tips),98,w,h);}}
function hideAddedBox(divname)
{if(divname!=""&&$(divname))
{$(divname).innerHTML="";document.body.removeChild($(divname));}}
function hideDragonBox(idx)
{hideAddedBox("dragonBox"+idx);}
function hideShakeStart()
{hideAddedBox("shakeStartBox");}
function hideShakeOver()
{hideAddedBox("shakeOverBox");}
function clearAllDragonBox()
{hideShakeStart();hideShakeOver();for(var i=1;i<=20;i++)
{hideDragonBox(i);}}