﻿// JScript 파일

function Right(str, num)
{
    if ( num <= 0 )
        return "";
    else if ( num > String(str).length )
        return str;
    else 
    {
        var iLen = String(str).length;
        return String(str).substring(iLen, iLen - num);
    }
}

/* Flash load Trans(url, width, height) */
function getFlash(swfName, widLength, heiLength, id, vars){

	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+widLength+'" height="'+heiLength+'" id="'+id+'">');
	document.write('<param name="movie" value="'+swfName+'" id="movie'+id+'">');
	document.write('<param name="FlashVars" value="'+vars+'">');
	document.write('<param name="wmode" value="transparent">');
	document.write('<param name="quality" value="high">');
//	document.write('<param name="allowScriptAccess" value="always">');
	document.write('<embed src="'+swfName+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+widLength+'" height="'+heiLength+'" wmode="transparent" allowScriptAccess="always" id="'+id+'"></embed></object>');
}

function getFlash(swfName, widLength, heiLength, id){

	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+widLength+'" height="'+heiLength+'" id="'+id+'">');
	document.write('<param name="movie" value="'+swfName+'" id="movie'+id+'">');
	document.write('<param name="wmode" value="transparent">');
	document.write('<param name="quality" value="high">');
//	document.write('<param name="allowScriptAccess" value="always">');
	document.write('<embed src="'+swfName+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+widLength+'" height="'+heiLength+'" wmode="transparent" allowScriptAccess="always" id="'+id+'"></embed></object>');
}

function getFlashBrowser(swfName, imgName, widLength, heiLength, id){

    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+widLength+'" height="'+heiLength+'"> ');
	document.write('    <param name="movie" value="'+ swfName +'" />');
	document.write('    <param name="wmode" value="transparent" />');
	document.write('    <!--[if !IE]> <--> ');
	document.write('    <object type="application/x-shockwave-flash" data="'+ swfName +'" width="' + widLength + '" height="' + heiLength + '">');
	document.write('        <param name="wmode" value="transparent" />');
	document.write('        <p><img src="'+ imgName +'" alt="" /></p>');
	document.write('    </object> ');
	document.write('    <!--> <![endif]--> ');
	document.write('</object>');
}

function getFile_(path, file) {

	var theForm = document.forms['aspnetForm'];

	theForm.Folder.value   = path;
	theForm.FileName.value = file;
	theForm.action   = "/download_.aspx";
	theForm.method   = "post";
	theForm.submit();
	theForm.action   = "";
}

function showMedia(mediaName, widLength, heiLength, id){

    if (mediaName.length < 4 || mediaName.indexOf(".") == -1)  return;
    
    var ext3 = Right(mediaName, 3);
    var type = "";

    if (ext3 == 'wmv')
        type = "application/x-mplayer2"; //"video/x-ms-wmv";
    else if (ext3 == 'asf')
        type = "video/x-ms-asf";
    else if (ext3 == 'avi')
        type = "video/avi";
    else 
        type = "application/x-shockwave-flash";

    //else
    //    type = "application/x-mplayer2";

//	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+widLength+'" height="'+heiLength+'" id="'+id+'">');
//	document.write('<param name="movie" value="'+mediaName+'" id="movie'+id+'">');
//	document.write('<param name="wmode" value="transparent">');
//	document.write('<param name="quality" value="high">');
	document.write('<embed src="'+mediaName+'" quality="high" type="' + type + '" width="'+widLength+'" height="'+heiLength+'" wmode="transparent" allowScriptAccess="always" id="'+id+'"></embed></object>');
}

function getFlashNoScale(swfName, imgName, widLength, heiLength, id1, id2){
	document.write('<object id="'+ id1 +'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + widLength + '" height="' + heiLength + '"> ');
    document.write('    <param name="movie" value="' + swfName + '" />');
    document.write('    <param name="wmode" value="transparent" />');
    document.write('    <param name="scale" value="noscale" />');
    document.write('    <param name="salign" value="bl" />');
    document.write('    <!--[if !IE]> <--> ');
    document.write('    <object id="'+ id2 +'" type="application/x-shockwave-flash" data="' + swfName + '" width="' + widLength + '" height="' + heiLength + '">');
	document.write('        <param name="wmode" value="transparent" />');
	document.write('        <param name="scale" value="noscale" />');
	document.write('        <param name="salign" value="bl" />');
	document.write('        <p><img src="' + imgName + '" alt="" /></p>');
    document.write('    </object> ');
    document.write('    <!--> <![endif]--> ');
    document.write('</object>');
}

function showFamily(){
    if (document.getElementById('util'))
	    document.getElementById('util').style.display = "none";
	
	if (document.getElementById('search'))
	    document.getElementById('search').style.display = "none";
}

function hideFamily(){
    if (document.getElementById('util'))
	    document.getElementById('util').style.display = "block";
	    
	if (document.getElementById('search'))
	    document.getElementById('search').style.display = "block";
}