/************************************************************************************************
	FlashObject
************************************************************************************************/
function setEmbed()
{
  var obj = new String;
  var parameter = new String;
  var embed = new String;
  var html = new String;
  var allParameter = new String;
  var clsid = new String;
  var codebase = new String;
  var pluginspace = new String;
  var embedType = new String;
  var src = new String;
  var width = new String;
  var height = new String;

  this.init = function( getType , s ,w , h, oId ) {
      if ( getType == "flash")
      {
        clsid = "D27CDB6E-AE6D-11cf-96B8-444553540000";       
        codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0";
        pluginspage = "http://www.macromedia.com/go/getflashplayer";
        embedType = "application/x-shockwave-flash";
      }
      else if (getType == "movie" )
      {
        clsid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" ;
        codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" ;
        embedType="application/x-oleobject" ;
        //embedType="application/x-mplayer2";
        pluginspage="http://www.microsoft.com/windows/mediaplayer/download/default.asp"
      }
      /* type Ãß°¡
      else if ( )
      {
      }
      */
           
      parameter += "<param name='movie' value='"+ s + "'>\n"; 
      parameter += "<param name='quality' value='high'>\n";   
     
      src = s;
      width = w;
      height = h;
      objId= oId;
  }

  this.parameter = function( parm , value ) {     
      parameter += "<param name='"+parm +"' value='"+ value + "'>\n";       
      allParameter += " "+parm + "='"+ value+"'";
  } 

  this.show = function() {
      if ( clsid )
      {
        obj = "<object id=" + objId + " classid=\"clsid:"+ clsid +"\" codebase=\""+ codebase +"\" width='"+ width +"' height='"+ height +"' value='" + objId + "'>\n";
      }
       embed = "<embed src='" + src + "' pluginspage='"+ pluginspage + "' type='"+ embedType + "' width='"+ width + "' height='"+ height +"'"+ allParameter +" ></embed>\n";

      if ( obj )
      {
        embed += "</object>\n";
      }
      html = obj + parameter + embed;
      document.write( html ); 

 if ( objId)
       { 
         var Objv = document.getElementById(objId);
         if (Objv.value==objId) {
          eval("document." + objId + ".focus();");
         }
     }
  }
}




/************************************************************************************************
	Main Board
************************************************************************************************/
/* Åä±ÛÅ×ÀÌºí */
	function newsInitTabMenu(menuContainerID) {

		var tabAnchor = document.getElementById(menuContainerID).getElementsByTagName("a");
		var i = 0;

		for(i=0; i<tabAnchor.length; i++) {
			if (tabAnchor.item(i).className == "tab")
				thismenu = tabAnchor.item(i);
			else
				continue;
			thismenu.menuContainer = document.getElementById(menuContainerID);
			thismenu.targetEl = document.getElementById(thismenu.href.split("#")[1]);
			thismenu.targetEl.style.display = "none";
			if (thismenu.getElementsByTagName("img").item(0)) {
				thismenu.getElementsByTagName("img").item(0).onclick = function () {
					this.src = this.src.replace(".gif", "_r.gif");
				}
			}

			thismenu.onclick =  newsTabMenuClick;

			if (!thismenu.menuContainer.first) {
				thismenu.menuContainer.first = thismenu;
			}
		}
		document.getElementById(menuContainerID).first.onclick();
	}
	function newsTabMenuClick() {
		currentmenu = this.menuContainer.current;

		if (currentmenu != this) {
			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				if (currentmenu.getElementsByTagName("img").item(0)) {
					currentmenu.getElementsByTagName("img").item(0).src = currentmenu.getElementsByTagName("img").item(0).src.replace("_r.gif", ".gif");
					currentmenu.getElementsByTagName("img").item(0).onclick = function () {
						this.src = this.src.replace(".gif", "_r.gif");
					}
				}
				currentmenu.className = currentmenu.className.replace(" on", "");
			}

			this.targetEl.style.display = "block";
			if (this.getElementsByTagName("img").item(0)) {
				this.getElementsByTagName("img").item(0).src = this.getElementsByTagName("img").item(0).src.replace("_r.gif", ".gif");
				this.getElementsByTagName("img").item(0).onclick();
				this.getElementsByTagName("img").item(0).onclick = null;
			}
			if (this) {
				this.className += " on";
			}
			this.menuContainer.current = this;
		}
		return false;
	}
