
//flash player add by riana 2009.10.19

function playFlash(iWmode,iWidth,iHeight){
	var pic_width=489; 
	var pic_height=266;
	if(iWidth!=null)
	pic_width=iWidth;
	if(iHeight!=null)
	pic_height=iHeight;
	var button_pos=4;
	var stop_time=6000;
	var show_text=1; 
	var txtcolor="000000";
	var bgcolor="000000";
	var imag=new Array();
	var _link=new Array();
	var flink=new Array();
	var text=new Array();
	
	var textTop=new Array();
	var content=new Array();
	var textNote=new Array();
	
	var flashUrl = 'http://images.bbgsite.com/www/images/flash_7.swf';

imag[1]="http://images.bbgsite.com/www/flash/bbg_promo_banner300x200.gif";
_link[1]="http://forum.bbgsite.com/topics/502/201003/01/148,1.html";
flink[1]="1111111111";
text[1]="Win Free UltimatePoints Now";
textTop[1]="Answer Easy Questions, Win Free UltimatePoints Now";
content[1]="To express our gratitude for your support of the PlaySpan™ Marketplace and BBGsite, we are teaming up to hold a contest where you can win UltimatePoints™ by answering a few simple questions. Just reply... ";
textNote[1]=" ";

imag[2]="http://images.bbgsite.com/www/flash/bto_forum_300x200.jpg";
_link[2]="http://forum.bbgsite.com/topics/531/201002/26/27,1.html";
flink[2]="1111111111";
text[2]="Post to Win BBGsite Business Tycoon Online Gold";
textTop[2]="Post to Win BBGsite Business Tycoon Online Gold";
content[2]="To celebrate the open beta of the world's No. 1 business game - Business Tycoon Online, we have joined hands with Dovogame to hold this Business Tycoon Online Forum Contest...";
textNote[2]=" ";

imag[3]="http://images.bbgsite.com/www/flash/coe_300x200.jpg";
_link[3]="http://contest.bbgsite.com/giveaway/city_of_eternals/";
flink[3]="1111111111";
text[3]="City of Eternals Is Still In Private Alpha. ";
textTop[3]="City of Eternals 100 Exclusive Invitations Giveaway Event";
content[3]="City of Eternals, the world's first massively multiplayer online game set in a world of modern Vampires is currently in Private Alpha and they would like to offer our BBGsiters 100 exclusive invites. Also, to give each...";
textNote[3]=" ";

imag[4]="http://images.bbgsite.com/www/flash/bto3_300x200.jpg";
_link[4]="http://contest.bbgsite.com/giveaway/business_tycoon_3/";
flink[4]="1111111111";
text[4]="Business Tycoon Online Rookie Package Activation Code Giveaway";
textTop[4]="Business Tycoon Online Rookie Package Activation Code Giveaway";
content[4]="Business Tycoon Online is the first massively business simulation web game in the world. It has already set a record of 600,000 players online at the same time...";
textNote[4]=" ";

imag[5]="http://images.bbgsite.com/www/flash/dc_300x250.jpg";
_link[5]="http://contest.bbgsite.com/giveaway/dragons_call_3/";
flink[5]="1111111111";
text[5]="Dragon’s Call is on Open Beta Test now!";
textTop[5]="Dragon's Call Starter Kit Giveaway Event";
content[5]="Dragon’s Call is on Open Beta Test now, more and more players are coming to the popular game! As a newbie, you can get the Starter Kit card code from our site. After that, you can claim the Starter Kit in...";
textNote[5]=" ";

imag[6]="http://images.bbgsite.com/www/flash/hog_300x250.jpg";
_link[6]="http://contest.bbgsite.com/giveaway/heroes_of_kungfu/";
flink[6]="1111111111";
text[6]="Event Will Conclude When All The Keys Are Distributed";
textTop[6]="Heroes of Kung Fu Newbie Gift Pack Giveaway Event";
content[6]="When you reach Lv.20 and Lv.25, some rewards will be sent to you respectively. Newbie gift pack giveaway event will conclude when all the keys are distributed.So never miss this precious opportunity!";
textNote[6]=" ";






	var swf_height=show_text==1?pic_height+0:pic_height;
	var pics="", _links="", texts="" , tops="", contents="", notes="",links="";
	//alert(imag.length);
	for(var i=1; i<imag.length; i++){
		pics=pics+("|"+imag[i]);
		_links=_links+("|"+_link[i]);
		links=links+("|"+flink[i]);
		texts=texts+("|"+text[i]);
		tops = tops+("|"+textTop[i]);
		contents = contents+("|"+content[i]);
		notes = notes+("|"+textNote[i]);
	}
	pics=pics.substring(1);
	_links=_links.substring(1);
	links=links.substring(1);
	texts=texts.substring(1);
	tops=tops.substring(1);
	contents=contents.substring(1);
	notes=notes.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 +'" />';
	flash = flash + '<param name="wmode" value="transparent">'; 
	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+'&tops='+tops+'&contents='+contents+'&notes='+notes+'&pic_width='+pic_width+'&pic_height='+pic_height+'&show_text='+show_text+'&txtcolor='+txtcolor+'&bgcolor='+bgcolor+'&button_pos='+button_pos+'&stop_time='+stop_time+'">';
	flash = flash + '<embed wmode="transparent" src="' + flashUrl + '" FlashVars="pics='+pics+'&links='+_links+'&texts='+texts+'&tops='+tops+'&contents='+contents+'&notes='+notes+'&pic_width='+pic_width+'&pic_height='+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" />';
    flash = flash + '</object>';
	document.writeln(flash); 
	
	//alert(flinks);
}

//add by riana 09.08.03
function myOver(obj){
		obj.getElementsByTagName('div')[0].style.display='block';
		obj.className='on';
	}
function myOut(obj){
		obj.getElementsByTagName('div')[0].style.display='none';
		obj.className='';
	}
	


//�����
function openLayer(objId,conId){
var arrayPageSize   = getPageSize();//����getPageSize()����
var arrayPageScroll = getPageScroll();//����getPageScroll()����
if (!document.getElementById("popupAddr")){
//�����������ݲ�
var popupDiv = document.createElement("div");
//�����Ԫ��������������ʽ
popupDiv.setAttribute("id","popupAddr")
popupDiv.style.position = "absolute";
popupDiv.style.zIndex = 9999;
//�����������
var bodyBack = document.createElement("div");
bodyBack.setAttribute("id","bodybg")
bodyBack.style.position = "absolute";
bodyBack.style.width = "100%";
bodyBack.style.height = (arrayPageSize[1] + 35 + 'px');
bodyBack.style.zIndex = 98;
bodyBack.style.top = 0;
bodyBack.style.left = 0;
bodyBack.style.filter = "alpha(opacity=70)";
bodyBack.style.opacity = 0.7;
bodyBack.style.background = "#000";
//ʵ�ֵ���(���뵽Ŀ��Ԫ��֮��)
var mybody = document.getElementById(objId);
insertAfter(popupDiv,mybody);//ִ�к���insertAfter()
insertAfter(bodyBack,mybody);//ִ�к���insertAfter()
}
//��ʾ������
document.getElementById("bodybg").style.display = "";
//��ʾ���ݲ�
var popObj=document.getElementById("popupAddr")
popObj.innerHTML = document.getElementById(conId).innerHTML;
popObj.style.display = "";

//�õ������ҳ���д�ֱ���Ҿ���(ͳһ)
// popObj.style.width  = "600px";
// popObj.style.height = "400px";
// popObj.style.top  = arrayPageScroll[1] + (arrayPageSize[3] - 35 - 400) / 2 + 'px';
// popObj.style.left = (arrayPageSize[0] - 20 - 600) / 2 + 'px';
//�õ������ҳ���д�ֱ���Ҿ���(����)
var arrayConSize=getConSize(conId)
popObj.style.top  = arrayPageScroll[1] + (arrayPageSize[3] - arrayConSize[1]) / 2-50 + 'px';
popObj.style.left = (arrayPageSize[0] - arrayConSize[0]) / 2 -30 + 'px';
}
//��ȡ���ݲ�����ԭʼ�ߴ�
function getConSize(conId){
var conObj=document.getElementById(conId)
conObj.style.position = "absolute";
conObj.style.left=-1000+"px";
conObj.style.display="";
var arrayConSize=[conObj.offsetWidth,conObj.offsetHeight]
conObj.style.display="none";
return arrayConSize;
}
function insertAfter(newElement,targetElement){//����
var parent = targetElement.parentNode;
if(parent.lastChild == targetElement){
parent.appendChild(newElement);
}
else{
parent.insertBefore(newElement,targetElement.nextSibling);
}
}
//��ȡ����ĸ߶�
function getPageScroll(){
var yScroll;
if (self.pageYOffset) {
yScroll = self.pageYOffset;
} else if (document.documentElement  &&  document.documentElement.scrollTop){
yScroll = document.documentElement.scrollTop;
} else if (document.body) {
yScroll = document.body.scrollTop;
}
arrayPageScroll = new Array('',yScroll)
return arrayPageScroll;
}
//��ȡҳ��ʵ�ʴ�С
function getPageSize(){
var xScroll,yScroll;
if (window.innerHeight  &&  window.scrollMaxY){
xScroll = document.body.scrollWidth;
yScroll = window.innerHeight + window.scrollMaxY;
} else if (document.body.scrollHeight > document.body.offsetHeight){
sScroll = document.body.scrollWidth;
yScroll = document.body.scrollHeight;
} else {
xScroll = document.body.offsetWidth;
yScroll = document.body.offsetHeight;
}
var windowWidth,windowHeight;
//var pageHeight,pageWidth;
if (self.innerHeight) {
windowWidth = self.innerWidth;
windowHeight = self.innerHeight;
} else if (document.documentElement  &&  document.documentElement.clientHeight) {
windowWidth = document.documentElement.clientWidth;
windowHeight = document.documentElement.clientHeight;
} else if (document.body) {
windowWidth = document.body.clientWidth;
windowHeight = document.body.clientHeight;
}
var pageWidth,pageHeight
if(yScroll < windowHeight){
pageHeight = windowHeight;
} else {
pageHeight = yScroll;
}
if(xScroll < windowWidth) {
pageWidth = windowWidth;
} else {
pageWidth = xScroll;
}
arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
return arrayPageSize;
}
//�رյ����
function closeLayer(){
document.getElementById("popupAddr").style.display = "none";
document.getElementById("bodybg").style.display = "none";
return false;
}


/*change link*/
function setTab(m,n){
var tli=document.getElementById("popupAddr").getElementsByTagName("li");
var mli=document.getElementById("popupAddr").getElementsByTagName("ol");
for(i=0;i<tli.length;i++){

   try { mli[i].style.display= i==n?"block":"none";} catch(err) { }

   tli[i].className= i==n?'on':'none';
   
  
}
}

/**
 *Filename:      ue_tab.js
 *Version:       1.0.0(2009-03-02)
 *Website:       http://
 *Author:        S.S.L
 *Modify:        2009-07-17
**/

function ue_tab( tab_menu,tab_main,cur_tab,mouse,time ){
	var pre_no;
	var timer,autoplay_timer;
	var tab;
	
	function $( id ){ return document.getElementById( id );}
	
	function run( no ){
		if( no != null ){
			if( timer != null )clearInterval( timer );
			timer = setInterval( function(){
				doChange(no);
			},200 );
		}
	}
	
	function addEvent(){
		for( var i = 0; i < tab.length; i++ ){
			tab[i].cur_no = i;
			if( mouse == null ){
				tab[i].onclick = function(){ 
					run( this.cur_no );
					return false;
				}
			} else {
				tab[i].onmouseover = tab[i].onmouseout= function(){
					run( this.cur_no );
					return false;
				}
			}
		}
	}
	
	function doChange( k ){
		if( tab[pre_no] != null && $(tab_main+(pre_no+1)) != null ){
			tab[pre_no].className = "off";
			$(tab_main+(pre_no+1)).style.display = "none";
		}
		
		if( tab[k] != null && $(tab_main+(k+1)) != null ){
			tab[k].className = "on";
			$(tab_main+(k+1)).style.display = "block";
		}
		
		pre_no = k;
		
		if( timer != null )clearInterval( timer );
	}
	
	function autoplay(){
		if( pre_no < tab.length ){
			doChange( pre_no+1 );
		} else {
			pre_no = tab.length-1;
			doChange( 0 );
		}
	}
	
	function init(){
		if( tab_menu == null || tab_main == null ) return;
		
		var tabs = tab_menu.split(" ");
		
		if( tabs[0] == null || tabs[1] == null || $( tabs[0] ) == null ) return;
		
		tab = $( tabs[0] ).getElementsByTagName( tabs[1] );

		pre_no = ( cur_tab == null ) ? 0:(cur_tab-1);
		
		doChange( pre_no );
		addEvent();
		
		if( time != null && time > 0 )
			autoplay_timer = setInterval( autoplay,time );
	}
	
	init();

}


