
/*-- Homepage  --*/ 
<!--   
function SetHome(obj,vrl){
try{
obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);   
}
catch(e){
if(window.netscape) {
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");   
}
catch (e)  {   
alert("Your net browser does not support this operation! Please input 'about:config' in your address bar and press the Enter key, then set [signed.applets.codebase_principal_support] to 'true'");   
}   
var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);   
prefs.setCharPref('browser.startup.homepage',vrl);
}
}
}
//-->   


/*--Max.Chen By Tm Inc 2006-10-11 --*/ 


function showFlash(iUrl,iWidth,iHeight,iWmode)
{
flash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+ iWidth +'" height="' + iHeight +'" />';
flash = flash + '<param name="movie" value="'+ iUrl +'" />';
flash = flash + '<param name="quality" value="high" />';
flash = flash + '<param name="menu" value="false" />';
if (iWmode == 1) {
flash = flash + '<param name="wmode" value="transparent" />';		
}
flash = flash + '<embed src="' + iUrl + '" width="'+ iWidth +'" height="'+ iHeight +'" menu="false" quality="high" ';
if (iWmode == 1) {
flash = flash + 'wmode="transparent" ';		
}
flash = flash + ' pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" mwode="transparent"></embed>';
flash = flash + '</object>';

document.writeln(flash); 
//alert(flash);

}

/*--mmosite flashmenu  2007-12-17-- */ 

window.onload=function(){
var ele=document.getElementById("scroller");
var toleft=document.getElementById("toleft");
var toright=document.getElementById("toright");
var w=ele.clientWidth;


var n=20,t=20;//n:dtime
var timers=new Array(n);
var c=document.getElementById("beni").getElementsByTagName("li");
for(var i=0;i<c.length;i++){
c[i].index=i;
c[i].onmouseover=function(){doSlide(this);setstyle(this,"on");}
document.getElementById("s" + i).className="dian";
if(c[i].className=="tagon"){
document.getElementById("s" + i).className="dian2";
}
}
//right onclick
toright.onclick=function(){
var c=document.getElementById("beni").getElementsByTagName("li");
for(var i=0;i<c.length;i++){
if(c[i].className=="tagon"){
tagindex=i;
}  
}
if(tagindex < 4){
doSlide(c[tagindex+1]);
setstyle(c[tagindex+1],"on");
}
}
//left onclick
toleft.onclick=function(){
var c=document.getElementById("beni").getElementsByTagName("li");
for(var i=0;i<c.length;i++){
if(c[i].className=="tagon"){
tagindex=i;
}  
}
if(tagindex > 0){
doSlide(c[tagindex-1]);
setstyle(c[tagindex-1],"on");
}
}


function setstyle(ci){
var c=document.getElementById("beni").getElementsByTagName("li");
for(var i=0;i<c.length;i++){
c[i].className="";
}
ci.className="tagon";

for(var i=0;i<c.length;i++){
document.getElementById("s" + i).className="dian";
if(c[i].className=="tagon"){
document.getElementById("s" + i ).className="dian2";
}
}
}

c=null;
function doSlide(ir){
var x=ele.scrollLeft;
var d=ir.index*w-x;

if(!d) return;
for(var i=0;i<n;i++)(function(){
if(timers[i])
clearTimeout(timers[i]);
var j=i;
timers[i]=setTimeout(function(){
ele.scrollLeft=x+Math.round(d*Math.sin(Math.PI*(j+1)/(2*n)));
},(i+1)*t);
})();
}
}

/* --------flashtags----------- */ 

var $ = function(i){return document.getElementById(i);}
var ua = navigator.userAgent.toLowerCase();
var isIE = (ua.indexOf("msie") > -1),isIE7 = (ua.indexOf("msie 7") > -1),isOpera = (ua.indexOf("opera") > -1),isSafari = (ua.indexOf("webkit") != -1 || ua.indexOf("khtml") != -1),isGecko = (!isSafari && ua.indexOf("gecko") > -1);


var switchpage = function(o, n, p){
   var ol = $(o+p);
   var cl = $(o+n);
   ol.style.display="none";
   cl.style.display="";
}

var p1 = 1;
function page1(num){
//alert(num);	
var t=document.getElementById("ttags").getElementsByTagName("a");
   switchpage("p1_", num, p1);
   p1 = num;
   t[0].style.color="#FFE400";
   t[1].style.color="#FFE400";
   t[2].style.color="#FFE400";
   t[3].style.color="#FFE400";
   t[p1-1].style.color="#fff";
}

/*--------header and footer---------*/

function pwHeader(){
   mmoHeader()
}
function pwFooter(){
   mmoFooter()
}

/*playflash*/

function playFlash(flashid){
var fpic =document.getElementById(flashid).getElementsByTagName("img");
var flink =document.getElementById(flashid).getElementsByTagName("a");
var texts =document.getElementById(flashid).getElementsByTagName("a");
var pic_width="280"; 
var pic_height="210"; 
var button_pos=fpic.length;
var stop_time=6000; 
var show_text=1; 
var txtcolor="dddddd";
var bgcolor="000000";
var imag=new Array();
var link=new Array();
var text=new Array();

var flashUrl = 'http://images.mmosite.com/9dragons/flash/viewer.swf';


for(var i=0;i<fpic.length;i++){
imag[i]=fpic[i].src;
}  

var swf_height=pic_height;
var pics="", links="", texts="";
for(var i=0; i<imag.length; i++){
pics=pics+("|"+imag[i]);
links=links+("|"+flink[i]);


links = links.replace(/(&)/g,"+");
texts=texts+("|"+text[i]);
}

pics=pics.substring(1);
links=links.substring(1);
texts=texts.substring(1);


var flash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+ pic_width +'" height="' + pic_height +'" /><param name="allowScriptAccess" value="always" />';
flash = flash + '<param name="movie" value="'+ flashUrl +'" />';
flash = flash + '<param name="quality" value="high" />';
flash = flash + '<param name="menu" value="false" />';
flash = flash + '<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&picwidth='+pic_width+'&picheight='+pic_height+'&show_text='+show_text+'&txtcolor='+txtcolor+'&bgcolor='+bgcolor+'&button_pos='+button_pos+'&stop_time='+stop_time+'">';
flash = flash + '<param name="wmode" value="transparent" />';
flash = flash + '<embed wmode="transparent" src="' + flashUrl + '" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&picwidth='+pic_width+'&picheight='+pic_height+'&show_text='+show_text+'&txtcolor='+txtcolor+'&bgcolor='+bgcolor+'&button_pos='+button_pos+'&stop_time='+stop_time+'" quality="high" width="'+ pic_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"allowScriptAccess="always"  />';
flash = flash + '</object>';
document.writeln(flash); 
//document.writeln(links+"<br />"); 
}
