/* quick menu */

 function positionMessage(){   
	//dvSidebar menu id
	var elem=document.getElementById("top");   
	// ÃÊ±â top À§Ä¡ 
	elem.style.top=document.documentElement.scrollTop + 195 + "px"; 				
	setTimeout("moveElement()", 10); 
} 

function moveElement(){ 
	var elem = document.getElementById("top"); 
	start = parseInt (elem.style.top);  
	end = document.documentElement.scrollTop + 158; // limit Á¤ÇÏ±â
	 
	//start ¿Í end °°À¸¸é ¸ØÃá´Ù.
	if ( start != end ) {
		scale =   Math.ceil( Math.abs( end - start ) / 10 );		
		
		//½ºÅ©·ÑÀÌ »ó´ÜÀ¸·Î ÀÌµ¿ÀÌ½Ã ¸¶ÀÌ³Ê½º°ª...
		if ( end < start )	{
			scale = -scale; // alert("end = "+end+" start = "+start);
		}
			elem.style.top = parseInt (elem.style.top)+ scale + "px"; 
	}	
	setTimeout("moveElement()", 10);
}
 
function addLoadEvent(func){	
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {	 
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
 
}

/* rollover */
function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName("img");

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == "imgover") 	{
			var src = aImages[i].getAttribute("src");
			var ftype = src.substring(src.lastIndexOf("."), src.length);
			var hsrc = src.replace(ftype, "_ov"+ftype);
	
			aImages[i].setAttribute("hsrc", hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute("src");
				this.setAttribute("src", this.getAttribute("hsrc"));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute("src").replace("_ov"+ftype, ftype);
				this.setAttribute("src", sTempSrc);
			}
		}
	}
}


// Tab Content
function initTabMenu(tabContainerID) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.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.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		thismenu.onclick = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				if (currentmenu.imgEl) {
					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_ov.gif", ".gif");
				} else {
					currentmenu.className = currentmenu.className.replace(" ov", "");
				}
			}
			this.targetEl.style.display = "";
			if (this.imgEl) {
				this.imgEl.src = this.imgEl.src.replace(".gif", "_ov.gif");
			} else {
				this.className += " ov";
			}
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}


function viewFlash(source,id,width,height,wmode,otherParam)
{
	document.write( "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0\" width="+width+" height="+height+" id="+id+"><param name=allowScriptAccess value=sameDomain><param name=wmode value="+wmode+" /><param name=movie value="+source+" /><param name=quality value=high />"+otherParam+"<embed src="+source+" quality=high wmode="+wmode+" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" width="+width+" height="+height+" showmenu=false></embed></object>");
}
