/*-- 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);
}
}
}
//-->   
/*--Bugreport--*/ 

function win_open_bug(){
window.open("http://pw.mmosite.com/report/bug2.shtml");
}


/*--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);
})();
}
}



/*--- Favorite--- */ 
function bookmark(){
var title=document.title
var url=document.location.href
if (window.sidebar) window.sidebar.addPanel(title, url,"");
else if( window.opera && window.print ){
var mbm = document.createElement('a');
mbm.setAttribute('rel','sidebar');
mbm.setAttribute('href',url);
mbm.setAttribute('title',title);
mbm.click();}
else if( document.all ) window.external.AddFavorite( url, title);
}


/* --------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";
}

function pkoHeader(){
   mmoHeader()
}
function pkoFooter(){
   mmoFooter()
}
