function blockshow(blockname,blocknum,num){	
	var cn="close";
	var className;
	if(navigator.userAgent.indexOf("Firefox")>0){
		className="class";
	}
	else{
		className="className";
	}
	switch(blocknum){
		case "1":
			document.getElementById("focus").className = "close";
			document.getElementById("blog").className = "close";
			document.getElementById("photo").className = "close";
			document.getElementById("push").className = "close";
			document.getElementById("gift").className = "close";
			document.getElementById("media").className = "close";
			document.getElementById("hot").className = "close";
			document.getElementById(blockname).className="";
			for(i=1;i<=7;i++){
				document.getElementById("mainNav0"+i).className="";
			}
			document.getElementById("mainNav0"+num).className="current";
			break;
		case "2":
			blockcss=document.getElementById(blockname).className.replace(" close","");
			for(i=1;i<=7;i++){
				cssname=document.getElementById("block_channel0"+i).className.replace(" close","");
				document.getElementById("block_channel0"+i).className=cssname + " close";
			}
			document.getElementById(blockname).className=blockcss;
			for(i=1;i<=7;i++){
				document.getElementById("channel0"+i).className="";
			}
			document.getElementById("channel0"+num).className="current";
			break;
		case "3":			
			for(i=1;i<=5;i++){
				document.getElementById("block_channel_0"+i).className=document.getElementById("block_channel_0" +i).className.replace("close","");
			}
			for(i=1;i<=5;i++){
				if(i!=num){
					document.getElementById("block_channel_0"+i).className=document.getElementById("block_channel_0" +i).className+" close";
				}
			}
			for(i=1;i<=5;i++){
				document.getElementById("channel_0"+i).setAttribute(className, "");
			}
			document.getElementById("channel_0"+num).setAttribute(className, "current");
			break;
		case "4":			
			for(i=1;i<=4;i++){
				document.getElementById("block_channel2_0"+i).setAttribute(className, document.getElementById("block_channel2_0" +i).getAttribute(className).replace(cn,""));
			}
			for(i=1;i<=4;i++){
				if(i!=num){
					document.getElementById("block_channel2_0"+i).setAttribute(className, document.getElementById("block_channel2_0" +i).getAttribute(className)+" close");
				}
			}
			for(i=1;i<=4;i++){
				document.getElementById("channel_20"+i).setAttribute(className, "");
			}
			document.getElementById("channel_20"+num).setAttribute(className, "current");
			break;
	}
}
function randomblock(flag){
	var vNum;
	vNum = Math.random();
	if(flag==1){
		vNum = Math.round(vNum*6)+1;
		vNum=1;
		switch(vNum){
			case 1:
				blockshow('focus','1','1');		
				break;
			case 2:
				blockshow('blog','1','2');
				break;
			case 3:
				blockshow('photo','1','3');
				break;
			case 4:
				blockshow('media','1','4');MDBS_lio.DivScroll.setV('indexPlayerScrollDiv',3);
				break;
			case 5:
				blockshow('push','1','5');
				break;
			case 6:
				blockshow('gift','1','6');
				break;
			case 7:
				blockshow('hot','1','7');
				break;
			default:
				blockshow('media','1','4');MDBS_lio.DivScroll.setV('indexPlayerScrollDiv',3);
				break;
		}
	}
	if(flag==2){
		vNum = Math.round(vNum*7)+1;
		switch(vNum){
			case 1:
				blockshow('block_channel01','2','1');
				break;
			case 2:
				blockshow('block_channel02','2','2');
				break;
			case 3:
				blockshow('block_channel03','2','3');
				break;
			case 4:
				blockshow('block_channel04','2','4');
				break;
			case 5:
				blockshow('block_channel05','2','5');
				break;
			case 6:
				blockshow('block_channel06','2','6');
				break;
			case 7:
				blockshow('block_channel07','2','7');
				break;
				/*
			case 8:
				blockshow('block_channel08','2','7');
				break;
				*/
			default:
				blockshow('block_channel01','2','1');
				break;				
		}
	}
	if(flag==3){
		vNum = Math.round(vNum*4)+1;		
		switch(vNum){
			case 1:
				blockshow('block_channel_01','3','1');	
				break;
			case 2:
				blockshow('block_channel_02','3','2');
				break;
			case 3:
				blockshow('block_channel_03','3','3');
				break;
			case 4:
				blockshow('block_channel_04','3','4');
				break;
			case 5:
				blockshow('block_channel_05','3','5');
				break;
			default:
				blockshow('block_channel_01','3','1');	
				break;				
		}
	}
	if(flag==4){
		vNum = Math.round(vNum*2)+1;		
		switch(vNum){
			case 1:
				blockshow('block_channel2_01','4','1');
				break;
			case 2:
				blockshow('block_channel2_02','4','2');
				break;
			case 3:
				blockshow('block_channel2_03','4','3');
				break;
			default:
				blockshow('block_channel2_01','4','1');
				break;				
		}
	}	
	
}
function changemedia(eid){	
	meidastr="<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='480' height='370' align='middle'>" +
	    "<param name='movie' value='http://vs.miolife.com/moochi_miolife_player.swf?overlayplaybutton=true&eid="+eid+"&domainip=http://vs.miolife.com/' id='mediaplayer' />" +
	    "<param name='quality' value='high'/>" +
		"<param name='allowFullScreen' value='true' />" +
		"<param name='wmode' value='Opaque' />" + 
		"<embed src='http://vs.miolife.com/moochi_miolife_player.swf?overlayplaybutton=true&eid="+eid+"&domainip=http://vs.miolife.com/' quality='high' width='480' height='370' name='photo' align='middle' type='application/x-shockwave-flash' allowFullScreen='true'  wmode='Opaque' pluginspage='http://www.macromedia.com/go/getflashplayer'/>" +
		"</object> ";
	document.getElementById('mediaobject').innerHTML=meidastr;
	
	/*§ó·s¼v­µviewnum*/
	var jsFrame = document.createElement("iframe");
	jsFrame.id = "jsFrame";
	jsFrame.width = 0;
	jsFrame.height = 0;
	jsFrame.marginwidth = 0;
	jsFrame.frameborder = 0;
	jsFrame.src = siteUrl + '/media.viewnum.php?eid='+eid;
	getbyid("mediacount").appendChild(jsFrame);
}