//ÇÃ·¡½¬ »ðÀÔ ½ºÅ©¸³Æ®
function SWFLoader() {
	var obj = new String;
	var parameter = new String;
	var embed = new String;
	
	var classId = new String;
    var codeBase = new String;
	var pluginSpage = new String;
	var embedType = new String;	
	var allParameter = new String;	
	
	var src = new String;
	var width = new String;
	var height = new String;
	var id = new String;
	var title = new String;
	var layer = new String;
	var arg = new String;
	var altText = new String;
	var wmode = new String;

	this.init = function ( w, h, s, a ) {
		width = w; 
		height = h; 
		src = s; 
		arg = a; 
		wmode = 'transparent'; 

		classId = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
		codeBase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0';
		pluginSpage = 'http://www.macromedia.com/go/getflashplayer';
		embedType = 'application/x-shockwave-flash';

		parameter += "<param name='allowScriptAccess' value='always'>\n";
		parameter += "<param name='allowFullScreen' value='false'\n>";
		parameter += "<param name='movie' value='"+ s + "'>\n";
		parameter += "<param name='quality' value='best'/>\n";
		parameter += "<param name='base' value='.'>\n";
		parameter += "<param name='scale' value='noscale'/>\n";
		parameter += "<param name='expressinstall' value='Scripts/expressInstall.swf' />\n";
	}
	
	this.parameter = function ( param, value ) {
		 parameter += "<param name='"+param +"' value='"+ value + "'>\n";
	}

	this.wmode = function ( value ) {
		wmode = value;
	}

	this.id = function ( value ) {
		id = value;
	}
	this.title = function ( value ) {
		title = value;
	}

	this.shocknone = function ( value ) {
		altText = value;
	}

	this.layer = function ( value ) {
		if(value == undefined) {
			layer = "";
		} else {
			layer = value;
		}
	}

	this.show = function () {
		obj = '<object id="'+id+'" width="'+width+'" height="'+height+'" title="'+title+'" classid="'+classId+'" codebase="'+codeBase+'">\n'+
			parameter +
			'<param name="wmode" value="'+wmode+'">\n'+
			'<!--[if !IE]>-->\n' +
			'<object type="application/x-shockwave-flash" data="' + src + '" width="' + width + '" height="' + height + '" name="' + id + '">\n' +
				parameter +
				'<param name="wmode" value="'+wmode+'">\n'+
			'<!--<![endif]-->\n' +
				'<div class="alt-content alt-' + id + '2">' + altText + '</div>\n' +
			'<!--[if !IE]>-->\n' +
			'</object>\n' +
			'<!--<![endif]-->\n' +
		'</object>';

		if(layer == "") {
			document.write(obj);

		}else{
			var div = document.getElementById( layer);
			div.style.display = "";
			div.innerHTML = obj;
		}
	}
}

//GNB ¼­ºê¿µ¿ªÀÌ ¿­¸±¶§
function layerOver(hi){
	//alert("layerOver"+hi);
	document.getElementById("top_flash").style.height=hi+"px";
	document.getElementById("gnb").style.height=hi+"px";
	document.getElementById("layerHeight").style.height=hi+"px";
}

//GNB¿µ¿ªÀÌ ´ÝÈú¶§
function layerOut(hi){
	//alert("layerOut"+hi);
	document.getElementById("top_flash").style.height=hi+"px";
	document.getElementById("gnb").style.height=hi+"px";
}

function flashResize(hi){
	//alert("snb"+hi);
	document.getElementById("snbswf").style.height=hi+"px";
	document.getElementById("snb_box").style.height=hi+"px";
}

function callExternalInterface1(){
	//alert("±Ý»ö");
	thisMovie("snbswf").addCallBack1();

}
function callExternalInterface2(){
	//alert("±Ý»ö");
	thisMovie("snbswf").addCallBack2();
}

function thisMovie(movieName) {

	if (navigator.appName.indexOf("Microsoft") != -1) {
		//alert(window[movieName])
		return window[movieName]
	}
	else {
		return document[movieName]
			alert(document[movieName]);
	}
}



/* input */
	function inFocus1(i) {
		(i).style.border='1px solid #c7a345';
	}
	function outFocus1(i) {
		(i).style.border='1px solid #e6e3e0';
	}
	function inFocus_search(i) {
			(i).style.background='none';
		}

/* png »ç¿ë ÀÚ¹Ù½ºÅ©¸³Æ® */
	function setPng24(obj) { 
	  obj.width=obj.height=1; 
	  obj.className=obj.className.replace(/\bpng24\b/i,''); 
	  obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');" 
	  obj.src='';  
	  return ''; 
	}

/* Áß¾Ó ÆË¾÷ */
	function OpenPopup(url, w, h){
		var winl = (screen.width - w) / 2; 
		var wint = (screen.height - h) / 3; 
		var winform = window.open(url,'_blank', 'top='+wint+',left='+winl+'toolbar=0, status=0, scrollbars=1, location=0, menubar=0, resizable=no, width='+w+', height='+h); 
	}
	function OpenPopup2(url, w, h){
		var winl = (screen.width - w) / 2; 
		var wint = (screen.height - h) / 3; 
		var winform = window.open(url,'_blank', 'top='+wint+',left='+winl+'toolbar=0, status=0, scrollbars=0, location=0, menubar=0, resizable=no, width='+w+', height='+h); 
	}


// added download Function by Kim Jong Cheol, 2010-02-03
function downLoadFile(loc, fName) {
	var params = "?";
	params += "filePath=" + escape(encodeURIComponent(loc));
	params += "&fileName=" + escape(encodeURIComponent(fName));
	location.href = "/download" + params;
}

//min-height
function min_height(obj,h){
    if(obj.readyState != "complete") return "auto";
    if(obj.offsetHeight<h){
        obj.style.height="0";
        obj.style.height=h+"px";
    }
}

/* footer select */
function show_sub(obj,num,total){
	for(var i=1; i<=total; i++){
		if(i == num){
			document.getElementById(obj+i).style.visibility = 'visible';
		}else{
			document.getElementById(obj+i).style.visibility = 'hidden';
		}
	}
}
