function flash(url, width, height, allowDomain) {
 if (allowDomain = "") {allowDomain = false;}
 try {document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + width + '" height="' + height + '">');
  document.write('<param name="movie" value="' + url + '">');
 if (allowDomain = true) {
  document.write('<param name="allowScriptAccess" value="sameDomain"/>');}
  document.write('<param name="quality" value="high"><param name="wmode" value="transparent"><PARAM NAME="menu" VALUE="false">');
  document.write('<embed src="' + url + '" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '" menu="false"></embed>');
  document.write('</object>');} catch(E){}
}
function HANA(id)
{document.write(id.innerHTML); id.id="";}
// flash

// menu
var TimeOut         = 300;
var currentLayer    = null;
var currentitem     = null;

var currentLayerNum = 0;
var noClose         = 0;
var closeTimer      = null;

// Open Hidden Layer
function mopen(n)
{
    var l  = document.getElementById("dep2_"+n);
    var mm = document.getElementById("dep1_"+n);
    
    if(l)
    {
        mcancelclosetime();
        l.style.visibility='visible';

        if(currentLayer && (currentLayerNum != n))
            currentLayer.style.visibility='hidden';

        currentLayer = l;
        currentitem = mm;
        currentLayerNum = n;            
    }
    else if(currentLayer)
    {
        currentLayer.style.visibility='hidden';
        currentLayerNum = 0;
        currentitem = null;
        currentLayer = null;
    }
}

// Turn On Close Timer
function mclosetime()
{
    closeTimer = window.setTimeout(mclose, TimeOut);
}

// Cancel Close Timer
function mcancelclosetime()
{
    if(closeTimer)
    {
        window.clearTimeout(closeTimer);
        closeTimer = null;
    }
}

// Close Showed Layer
function mclose()
{
    if(currentLayer && noClose!=1)
    {
        currentLayer.style.visibility='hidden';
        currentLayerNum = 0;
        currentLayer = null;
        currentitem = null;
    }
    else
    {
        noClose = 0;
    }

    currentLayer = null;
    currentitem = null;
}

// Close Layer Then Click-out
document.onclick = mclose; 



function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
 
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// combobox
function goTo(){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}


// QUICK

function GoTop() {
 window.scrollTo(0,0);
}

function initMoving(target, position, topLimit, btmLimit) {
if (!target)
return false;

var obj = target;
obj.initTop = position;
obj.topLimit = topLimit;
obj.bottomLimit = document.documentElement.scrollHeight - btmLimit;

obj.style.position = "absolute";
obj.top = obj.initTop;
obj.left = obj.initLeft;

if (typeof(window.pageYOffset) == "number") {
obj.getTop = function() {
return window.pageYOffset;
}
} else if (typeof(document.documentElement.scrollTop) == "number") {
obj.getTop = function() {
return document.documentElement.scrollTop;
}
} else {
obj.getTop = function() {
return 0;
}
}

if (self.innerHeight) {
obj.getHeight = function() {
return self.innerHeight;
}
} else if(document.documentElement.clientHeight) {
obj.getHeight = function() {
return document.documentElement.clientHeight;
}
} else {
obj.getHeight = function() {
return 500;
}
}

obj.move = setInterval(function() {
if (obj.initTop > 0) {
pos = obj.getTop() + obj.initTop;
} else {
pos = obj.getTop() + obj.getHeight() + obj.initTop;
//pos = obj.getTop() + obj.getHeight() / 2 - 15;
}

if (pos > obj.bottomLimit)
pos = obj.bottomLimit;
if (pos < obj.topLimit)
pos = obj.topLimit;

interval = obj.top - pos;
obj.top = obj.top - interval / 3;
obj.style.top = obj.top + "px";
}, 30)
}


// Flash Insert
function inputSWF (u, w, h, id, md, lc, fv, sc)
{
	if (!id) id = "swf_main";
	if (!md) md = "window"; // window | opaque | transparent
	if (!sc) sc = "samedomain"; // always | never | samedomain

	//Flash
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="' + id + '" width="' + w + '" height="' + h + '">\n');
	document.write('	<param name=movie value="' + u + '" />\n');
	document.write('	<param name=quality value="high" />\n');
	document.write('	<param name=wmode value="' + md + '" />\n');
	document.write('	<param name=flashVars value="' + fv + '" />\n');
	document.write('	<param name=allowScriptAccess value="' + sc + '" />\n');
	document.write('	<embed name="' + id + '" src="' + u + '" width="' + w + '" height="' + h + '" wmode="' + md + '" flashVars="' + fv + '" allowScriptAccess="' + sc + '" swLiveConnect="' + fv + '" type="application/x-shockwave-flash" quality=high pluginspage="http://www.macromedia.com/go/getflashplayer" />\n');
	document.write('</object>\n');

	if (lc)
	{
		//FSCommand
		document.write('<script language="JavaScript">\n');
		document.write('function ' + id + '_DoFSCommand (command, args)\n');
		document.write('{\n');
		document.write('	if (command == "javascript") eval(args);\n');
		document.write('}\n');
		document.write('</script>\n');

		//VBScript
		if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
			document.write('<script language="VBScript">\n');
			document.write('On Error Resume Next\n');
			document.write('Sub ' + id + '_FSCommand(ByVal command, ByVal args)\n');
			document.write('	Call ' + id + '_DoFSCommand(command, args)\n');
			document.write('End Sub\n');
			document.write('</script>\n');
		}
	}
}

