//##### Å¸ÀÌÆ²
title="SAMSUNG FOUNDATION";
document.title=title

//##### ºñÁÖ¾ó½ºÅ©¸³Æ®

document.write("<form method=post name=bLaNk style='margin:0;display:none'></form>");

function Top(){
document.write("<div><div class='L' style='width:363;'>");
Flash('TopFla','/html/eng/inc/fla/login.swf','363','53','#FFFFFF','none');
document.write("</div>");
document.write("<div class='L' style='position:relative;left:9;top:10;'><a href=\"javascript:link('kor')\"><img src='/html/eng/img/global/mtop_kor.gif' style='filter:alpha(Opacity=40)'></a></div></div>");
}

function Bottom(){
document.write("\
	<div class='L' style='margin-top:23;'><img src='/html/eng/img/global/mcopy.gif' width=932 height=17 usemap='#Bottom'></div>\
	<map name='Bottom'>\
		<area shape='rect' coords='14,0,93,17' href=\"javascript:link('privacy')\" onFocus='blur();' >\
		<area shape='rect' coords='102,0,188,17' href=\"javascript:link('reject')\" onFocus='blur();' >\
	</map>\
	<div class='L' style='position:relative;top:-194px;width:60px;'>");
Flash('FamilySite','/html/eng/inc/fla/familysite.swf','60','234','#FFFFFF','transparent');
document.write("</div>");
}

function Mnav(cn){
var FlaUrl="/html/eng/inc/fla/mnav.swf?cn="+cn;
document.write("<div id='mnav'>");
Flash('MainFla',FlaUrl,'240','550','#FFFFFF','none');
document.write("</div>");
}

function Sub(cn){
var FlaUrl="/html/eng/inc/fla/view.swf?cn="+cn;
document.write("<div id='sub'>");
Flash('SubFla',FlaUrl,'320','262','#FFFFFF','none');
document.write("</div>");
}

function Snav(cn,hn,sn){
var FlaUrl="/html/eng/inc/fla/snav"+cn+".swf?cn="+cn+"&hn="+hn+"&sn="+sn;
document.write("<div id='snav'>");
Flash('SnavFla',FlaUrl,'120','438','#FFFFFF','none');
document.write("</div>");
}

//##### XML¸µÅ©
	var xmlDoc , lineMapStr = "", currentPath="", index = 0;
	var moz = (typeof document.implementation != 'undefined') && (typeof document.implementation.createDocument != 'undefined'); 
	var ie = (typeof window.ActiveXObject != 'undefined'); 

	importXML("/html/eng/inc/js/menu.xml");
	function importXML(file) { 
		if (moz) { 
			xmlDoc = document.implementation.createDocument("", "", null);
			xmlDoc.async = false;
		} else if (ie) { 
			xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); 
			xmlDoc.async = false;
		}
		xmlDoc.load(file);
	}

	function getLineMapNode(id){
		var menuXpath , node;
		menuXpath = "//menu[@id='" + id + "']";				
		if (moz) { 					
			node = xmlDoc.evaluate(menuXpath, xmlDoc, null, 9,null).singleNodeValue;
		} else if (ie) { 			
			node = xmlDoc.selectSingleNode(menuXpath);	
		}		
		return node;
	}

	function setString(node){
		var spStr = "" , last="";
		var name = node.getAttribute("name");
		var url  = node.getAttribute("url");
		var nodeId  = node.getAttribute("id");

		if(index++ != 0) spStr = "&nbsp;>&nbsp;";
		if(node != xmlDoc.documentElement) 	setString(node.parentNode);
//		lineMapStr += name + spStr;
		if(currentPath != nodeId)
			lineMapStr += "<a href='"+url+"'>"+ name+"</a>" + spStr;
		else
			lineMapStr += "<font class='dgray'>"+ name+"</font>" + spStr;
	}

function path(id){
	try{
		var node = getLineMapNode(id);
		lineMapStr = "";
		index = 0;
		currentPath=id;
		setString(node);
		document.write(lineMapStr);
	}catch(e){
		if(node == null){
			document.write("¾ÆÀÌµð°¡ Á¸Àç ÇÏÁö ¾Ê½À´Ï´Ù : " + id);
		}else{
			document.write("¿¹¿ÜÃ³¸® ¹ß»ý : " +  e);
		}
	}
}

function name(id){
	var node = getLineMapNode(id);
	var name  = node.getAttribute("name");
	document.write(name);
}

//SLink
function SLink(url,target)
{
	//alert(url);
	
	//alert(SecuiSS.getKEYIV());
	
	var f=document.bLaNk;
	if(!target) target="_self";
	f.innerHTML="";

	pos=url.indexOf("?");
	if(pos!=-1)
	{
		action_url=url.substring(0,pos);
		value=url.substring(pos+1,url.length);

		arr = value.split("&");
	
		for(i=0;i<arr.length;i++)
		{
			tmp = arr[i].split("=");
			f.innerHTML+="<input type=hidden name='"+tmp[0]+"' value='"+tmp[1]+"'>";
		}
		f.innerHTML+="<input type=hidden name='__default' value=''>";	
	}
	else
	{
		action_url=url;
	}
/*
	if(SecuiSS.getKEYIV().length > 0)
	{ 
			//alert("Å°ÀÖ´Ù");
		TargetSecuiSubmit(f, action_url, '2', target);
	}
	else
	{
		//alert("Å° ¾ø´Ù");
		TargetSecuiSubmit(f, action_url, '1', target);
	}
*/

		TargetSecuiSubmit(f, action_url, '1', target);
}

function link(){
	var id = "";
	var depth = arguments.length;
	try {
		if(depth==0) return;
		else if(depth==1) id = eval("'"+arguments[0]+"'");
		else if(depth==2) id = eval("'"+arguments[0]+arguments[1]+"'");
		else if(depth==3) id = eval("'"+arguments[0]+arguments[1]+arguments[2]+"'");
		else if(depth==4) id = eval("'"+arguments[0]+arguments[1]+arguments[2]+arguments[3]+"'");

		if(id=="") { alert("ÁØºñÁßÀÔ´Ï´Ù.1"); }
			
		else { 
		var node = getLineMapNode(id);
		var url  = node.getAttribute("url");
		//location.href=url;
		SLink( url );
		}

	}catch(e) { window.open("/html/read.asp",'','width=370,height=220,scrollbar=no,location=no,menubar=no'); }
}


//#####

/*ActiveX ÇÃ·¡½¬*/
// id: flash id
// url: source url
// w: source width
// h: source height
// t: wmode (none/transparent/opaque)
function Flash(id,url,w,h,bg,t){
document.write("\
<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width="+w+" height="+h+" id="+id+">\
<param name='movie' value="+url+" />\
<param name='wmode' value="+t+" />\
<param name='bgcolor' value="+bg+" />\
<param name='allowScriptAccess' value='sameDomain' />\
<param name='quality' value='high' />\
<param name='menu' value='false' />\
<embed src="+url+" width="+w+" height="+h+" name="+id+" bgcolor="+bg+" allowScriptAccess='sameDomain' quality='high' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\
</object>\
");
}

function ScrollTop(){
	parent.window.scroll(0,0);
}

//»ó´ÜÇÃ·¡½Ã°Ë»ö
function searchAll(keyword){
	SLink("/html/eng/common/search.asp?keyword="+keyword);
}

//´Ù¿î·ÎµåÆÄÀÏ
function down_load(flag,file_nm){
	//window.open("/common/pop_filedown.asp?file1="+file_nm,"","scrollbars=no,resizable=yes,status=no,width=300,height=230,left=100,top=50");
	if (flag =="A") {
		file_nm = "board\\"+file_nm
	}
	if (flag =="B") {
		file_nm = "event\\"+file_nm
	}
	if (flag =="C") {
		file_nm = "display\\"+file_nm
	}
	if (flag =="D") {
		file_nm = "prize\\"+file_nm
	}
	if (flag =="E") {
		file_nm = "kcmusic_prize\\"+file_nm
	}
	if (flag =="F") {
		file_nm = "welfare\\"+file_nm
	}
	if (flag =="F") {
		file_nm = "organ\\"+file_nm
	}
	window.open("/common/pop_filedown.asp?file1="+file_nm,"","scrollbars=no,resizable=no,status=no,width=500,height=500,left=100,top=50");
}

//¾àµµº¸±âÆË¾÷
function _contact(Tid){
	eval("pop('/html/eng/common/pop_contact.asp?Tid="+Tid+" ','map',600,660) ");
}

function pop(url,name,w,h){ window.open(url,name,'width='+w+',height='+h+',scrollbars=no') } //Popup(½ºÅ©·Ñ¹Ù¾øÀ½)
function pops(url,name,w,h){ window.open(url,name,'width='+w+',height='+h+',scrollbars=yes') } //Popup(½ºÅ©·Ñ¹ÙÀÖÀ½)
function newwin(url){ window.open(url,'new','location=1,directories=1,resizable=1,status=1,toolbar=1,menubar=1,scrollbars=1') } //NewPopup(½ºÅ©·Ñ¹Ù¾øÀ½)
function newwin1(url){ window.open(url,'new','width=471,height=480,scrollbars=1') } //NewPopup(½ºÅ©·Ñ¹Ù¾øÀ½)
function listover(obj){obj.className="listover";}
function listout(obj){obj.className="listout";}

function Img(n,tog){eval("document.m"+n+".src=m"+n+"_"+tog+".src"); } ///*ÀÌ¹ÌÁö ·Ñ¿À¹ö*/

function autoBlur(){
	try{
		if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
	}catch(e) {}
}
document.onfocusin=autoBlur;

/* ±Û º¸±â */
var old=''; 
function opinion(name) 
{ 
	submenu=eval("opinion_"+name+".style"); 
	if(old!=submenu) 
	{ 
		if(old!='') 
		{ 
			old.display='none'; 
		} 
		submenu.display='block'; 
		old=submenu;
	} 
	else 
	{ 
		submenu.display='none'; 
		old=''; 
	} 
}

function roundTable(objID) { ///*¶ó¿îµåÅ×ÀÌºí*/
	var obj = document.getElementById(objID);
	var Parent, objTmp, Table, TBody, TR, TD;
	var bdcolor, bgcolor, Space;
	var trIDX, tdIDX, MAX;
	var styleWidth, styleHeight;

	// get parent node
	Parent = obj.parentNode;
	objTmp = document.createElement('SPAN');
	Parent.insertBefore(objTmp, obj);
	Parent.removeChild(obj);

	// get attribute
	bdcolor = obj.getAttribute('rborder');
	bgcolor = obj.getAttribute('rbgcolor');
	radius = parseInt(obj.getAttribute('radius'));
	if (radius == null || radius < 1) radius = 1;
	else if (radius > 6) radius = 6;

	MAX = radius * 2 + 1;

	/*
	create table {{
	*/
	Table = document.createElement('TABLE');
	TBody = document.createElement('TBODY');

	Table.cellSpacing = 0;
	Table.cellPadding = 0;

	for (trIDX=0; trIDX < MAX; trIDX++) {
		TR = document.createElement('TR');
		Space = Math.abs(trIDX - parseInt(radius));
		for (tdIDX=0; tdIDX < MAX; tdIDX++) {
			TD = document.createElement('TD');

			styleWidth = '1px'; styleHeight = '1px';
			if (tdIDX == 0 || tdIDX == MAX - 1) styleHeight = null;
			else if (trIDX == 0 || trIDX == MAX - 1) styleWidth = null;
			else if (radius > 2) {
				if (Math.abs(tdIDX - radius) == 1) styleWidth = '2px';
				if (Math.abs(trIDX - radius) == 1) styleHeight = '2px';
			}

			if (styleWidth != null) TD.style.width = styleWidth;
			if (styleHeight != null) TD.style.height = styleHeight;

			if (Space == tdIDX || Space == MAX - tdIDX - 1) TD.style.backgroundColor = bdcolor;
			else if (tdIDX > Space && Space < MAX - tdIDX - 1)  TD.style.backgroundColor = bgcolor;

			if (Space == 0 && tdIDX == radius) TD.appendChild(obj);
			TR.appendChild(TD);
		}
		TBody.appendChild(TR);
	}

	/*
	}}
	*/

	Table.appendChild(TBody);

	// insert table and remove original table
	Parent.insertBefore(Table, objTmp);
}

//

//Æ¯Á¤¿µ¿ª ÀÎ¼âÇÏ±â
function printDiv () {
	if (document.all && window.print) {
		window.onbeforeprint = beforeDivs;
		window.onafterprint = afterDivs;
		document.body.style.backgroundImage='url()';
		window.print();
	}
}
function beforeDivs () {
	if (document.all) {
		Body.style.display = 'none';
		objSelection.innerHTML = document.all['print_contents'].innerHTML; // ÀÌ°÷¿¡¼­ ID¸¦ ÁöÁ¤
	}
}
function afterDivs () {
	if (document.all) {
		Body.style.display = 'block';
		objSelection.innerHTML = "";
	}
}


function _gotoPage(objForm,p,filename){
	//objForm.target = "main";
	//objForm.action = filename
	objForm.page.value=p;
	//objForm.submit();
	TargetSecuiSubmit(objForm , filename , '2', '_self');
}

function _gotoPage2(objForm,p,filename){
	//objForm.target = "_self";
	//objForm.action = filename
	objForm.page.value=p;
	//objForm.submit();
	//alert("test");
	TargetSecuiSubmit(objForm , filename , '2', '_self');
}

//¾ÆÀÌÇÁ·¹ÀÓ
function iframe_resize(){
	var objBody	    =	ifrm.document.body;
	var objFrame	=	document.all["ifrm"];
	objFrame.style.height = objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight)
	objFrame.style.width = '502'
/*
	var objBody	    =	document.all["ifrm"].document.body;
	var objFrame	=	document.all["ifrm"];
	objFrame.style.height = objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight);
	objBody.body.style.height = objBody.scrollHeight
	objFrame.style.width = '502'
	document.all.ifrm.style.height= 1600;
	window.scrollTo(0,0);
	tHeight=document.all.ifrm.document.body.style.height;
*/
}

var ifrContentsTimer; 
function resizeRetry() {
	if(document.body.readyState == "complete") { 
		clearInterval(ifrContentsTimer); 
	}else { 
		resizeFrame(); 
	} 
} 
function resizeFrame(){
	self.resizeTo(document.body.scrollWidth + (document.body.offsetWidth-document.body.clientWidth), parseInt(document.body.scrollHeight)+10); 
}