
// png 이미지
function setPng24(obj) { 
    obj.width=obj.height=1; 
	obj.style.width = obj.width + "px"; 
    obj.style.height = obj.height + "px"; 
    obj.className=obj.className.replace(/\bpng24\b/i,''); 
    obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');" 
    obj.src='/images/blank.gif';  
    return ''; 
} 



function getDocHeight() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
    )-4;
}

//팝업띄우기 스크롤 없는 거
function popsn(url,trgt,w,h,l,t) { 
    window.open(url,trgt,'width='+w+',height='+h+',left='+l+',top='+t+',scrollbars=no,resizable=no,copyhistory=no,toolbar=no,status=no'); 
}
//팝업띄우기 스크롤 있는 거
function popsy(url,trgt,w,h) { 
    window.open(url,trgt,'width='+w+',height='+h+',scrollbars=yes,resizable=no,copyhistory=no,toolbar=no,status=no,left=0,top=0'); 
}

// addLoadEvent
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

//인자 값
function isAgm(agm, len, val){
	var agmL = agm.length - 1;
	return agmL < len ? val : agm[len];
};

//브라우져 별 아이디 객체 스타일
function getStyleObject(objectId) {
	if(document.getElementById && document.getElementById(objectId)){
		return document.getElementById(objectId).style;
	}else if (document.all && document.all(objectId)){
		return document.all(objectId).style;
	}else if (document.layers && document.layers[objectId]){
		return document.layers[objectId];
	}else{
		return false;
	}
};

//브라우져 별 아이디 객체
function getObject(objectId) {
	if(document.getElementById && document.getElementById(objectId)){
		return document.getElementById(objectId);
	}else if (document.all && document.all(objectId)){
		return document.all(objectId);
	}else if (document.layers && document.layers[objectId]){
		return document.layers[objectId];
	}else{
		return false;
	}
};
// 플래시 써주기
function writeEmbed(url,wd,ht){
	var id		= isAgm(writeEmbed.arguments, 3, null);
	var n			= 0;
	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=\"" + wd + "\" height=\"" + ht + "\" id=\"externalInterfaceExample\"" + n + ">");
	document.write("	<param name=\"movie\" value=\"" + url + "\">");
	document.write("	<param name=\"menu\" value=\"false\">");
	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=\"" + url + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + wd + "\" height=\"" + ht + "\" wmode=\"transparent\" allowScriptAccess=\"always\" name=\"ExtInterface\" FlashVars=\"" + id + "\"></embed>");
	document.write("	</object>");
};

//popup(center)
function pop_center(fname,wth,hgt){
	var W = wth;
	var H = hgt;
	var X = screen.availWidth/2 - W/2;
	var Y = screen.availHeight/2 - H/2;
	var wname = fname.split(".")[0];
	while(wname.indexOf("/")!=-1){
		wname = wname.replace("/","_");
	}
	newWin = window.open(fname,wname,"width="+W+",height="+H+",left="+X+",top="+Y);
	newWin.focus();
}


// 기본 플래시				
function flashObj(URL,SizeX,SizeY,LnkId,param) // quick
{
    document.write('            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ');
    document.write('                    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ');
    document.write('                    width="'+SizeX+'" height="'+SizeY+'"  id="'+LnkId+'" align="middle">');
    document.write('            <param name="movie"     value="'+URL+'" />');
    document.write('            <param name="quality"   value="high" />');
    document.write('        <param name="wmode"     value="transparent"/>');
	document.write('   <param name="allowScriptAccess" value="always"/> ');
	document.write('   <param name="base" value="." />');
	document.write('<param name="flashvars" value="' + param + '"/>');
	document.write('            <embed base="." src="'+URL+'" quality="high" width="'+SizeX+'" height="'+SizeY+'"  align="middle" ');
	document.write('         wmode="transparent" ');
	document.write('             type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always" swLiveConnect=true name="'+LnkId+'"  />');
	document.write('            </embed></object>');
}
function printSWF(id, flashUri, vWidth, vHeight, winMode, bgColor, param) {
	var _obj_ = "";
	_obj_ = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0" width="' + vWidth + '" height="' + vHeight + '" id="' + id + '" align="middle">';
	_obj_ += '<param name="allowScriptAccess" value="always" />';
	_obj_ += '<param name="allowFullScreen" value="true" />';
	_obj_ += '<param name="movie" value="' + flashUri + '" />';
	_obj_ += '<param name="quality" value="high" />';
	_obj_ += '<param name="wmode" value="' + winMode + '" />';
	_obj_ += '<param name="bgcolor" value="' + bgColor + '" />';
	_obj_ += '<param name="flashvars" value="' + param + '"/>';
	_obj_ += '<embed src="' + flashUri + '" quality="high" wmode="' + winMode + '" bgcolor="' + bgColor + '" width="' + vWidth +'" height="' + vHeight + '" id="' + id + '" align="middle" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed>    ';
	_obj_ += '</object>';
	document.writeln( _obj_ );

	eval("window." + id + " = document.getElementById('" + id + "');");
}



