/**
 *Filename:      o_menu.js
 *Version:       1.0.0(2009-03-02)
 *Website:       http://
 *Author:        S.S.L
**/

function o_menu(){
	var tab_menu,tab_main,title;
	var on,off;
	var pre_no;
	
	function $( id ){ return document.getElementById( id );}
	
	function setListener(){
		for( var i = 0; i < tab_menu.length; i++ ){
			if( tab_menu[i].title != title ) continue;
			tab_menu[i].cur_no = i;
			tab_menu[i].onclick = setOnAndOff;
		}
	}
	
	function setOnAndOff(){		
		if( pre_no == (this.cur_no+1) ){
			$(tab_main+pre_no).style.display = $(tab_main+pre_no).style.display == "block"? "none":"block";
			tab_menu[this.cur_no].className = tab_menu[this.cur_no].className == on ? off:on;
		} else {
			for( var i=0; i<tab_menu.length; i++ ){
				$(tab_main+(i+1)).style.display = ( i==this.cur_no )?"block":"none";
				tab_menu[i].className = ( i==this.cur_no )?on:off;
			}
		}
		pre_no = this.cur_no+1;
		return false;
	}
	
	this.init = function( id,t1,cnt,on1,off1,no1 ){
		tab_menu = $( id ).getElementsByTagName( "h3" );
		title = t1;
		tab_main = cnt;
		on = on1;
		off = off1;
		pre_no = no1;
		
		tab_menu[no1-1].className = on;
		$(tab_main+(no1)).style.display = "block";
		setListener();
	}

}
function flvPlayer( src, width, height)
{
var swf_width = width;
var swf_height = height;
var texts = 'video'
var files = src;

document.write('<div align="center"');
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ swf_width +'" height="'+ swf_height +'">');
document.write('<param name="movie" value="http://file.download.91.com/zo/flash/vcastr2.swf?IsShowTime=0&IsAutoPlay=0"><param name="quality" value="high">');
document.write('<param name="menu" value="false"><param name="allowFullScreen" value="true" />');
document.write('<param name="FlashVars" value="vcastr_file='+files+'&vcastr_title='+texts+'">');
document.write('<embed src="http://file.download.91.com/zo/flash/vcastr2.swf?IsShowTime=0&IsAutoPlay=0" allowFullScreen="true" FlashVars="vcastr_file='+files+'&vcastr_title='+texts+'" menu="false" quality="high" width="'+ swf_width +'" height="'+ swf_height +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'); document.write('</object></div>');
}

function flashObject(file_name,width,height){
  document.write('<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="' + width + '" height="' + height + '">');
  document.write('<param name="movie" value="' + file_name + '">');
  document.write('<param name="quality" value="high">');
  document.write('<param name="menu" value="false">');
  document.write('<param name="wmode" value="transparent">');
  document.write('<param name="allowScriptAccess" value="always">');  
  document.write('<embed src="' + file_name + '" width="' + width + '" height="' + height + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always"></embed>');
  document.write('</object>');
}

