/**search function*/

var sait_domain = "http://" + document.domain;
var full_path = location.href;
var url_protocol = "";
if(full_path.indexOf("https") == -1)
{
	url_protocol = "http://";
}
else
{
	url_protocol = "https://";
}
function searchAll_eng(txt_s){
	location.href= sait_domain + "/eng/etc/e_search.jsp?query="+txt_s;
}

function mNav(ch){
document.write ("\
<table width=800 height cellpadding=0 cellspacing=0 border=0 align=center>\
<tr><td valign=top>\
<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase=url_protocol + 'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width=801 height=124>\
<param name='movie' value='/eng/inc/fla/sub_navi.swf?ch="+ch+"'>\
<param name='quality' value='high'>\
<param name='wmode' Value='Transparent'>\
<embed src='/eng/inc/fla/sub_navi.swf?ch="+ch+"' quality='high' pluginspage=url_protocol + 'www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width=801 height=124></embed></object>\
</td></tr>\
</table>\
");
}

function mCopy(){
document.write ("\
<table width=100% height=85 cellpadding=0 cellspacing=0 border=0>\
<tr><td height=85 align=center><img src='/eng/img/mcopy.gif' width=803 height=65 usemap=#mcopy></td></tr>\
</table>\
<map name=mcopy>\
<area shape=rect coords='206,12,271,29' >\
<area shape=rect coords='2,9,101,31' href='javascript:personal()'>\
<area shape=rect coords='102,7,176,30' href='javascript:email()'>\
<area shape=rect coords='134,43,265,57' href='javascript:mail()'>\
</map>\
");
}

function sTop(cn,hn,sn){
document.write ("\
<table width=100% cellpadding=0 cellspacing=0 border=0>\
<tr><td align=center>\
<table width=801 cellpadding=0 cellspacing=0 border=0>\
<tr><td align=right valign=bottom height=35>\
<img src='/eng/img/top_top_"+cn+"_"+hn+"_"+sn+".gif'></td></tr>\
</td></tr>\
</table>\
</table>\
");
}
 
function sTop_jpg(cn,hn,sn){
document.write ("\
<table width=100% cellpadding=0 cellspacing=0 border=0>\
<tr><td align=center>\
<table width=801 cellpadding=0 cellspacing=0 border=0>\
<tr><td align=right valign=bottom height=35>\
<img src='/eng/img/top_top_"+cn+"_"+hn+"_"+sn+".jpg'></td></tr>\
</td></tr>\
</table>\
</table>\
");
}


function personal1(){window.open('/etc/pop_personal_etc.jsp','new3','width=492,height=680,location=0,directories=0,resizable=0,status=0,toolbar=0,menubar=0,scrollbars=0');}
function personal2(){window.open('http://75.1.80.110:12402/visit/agreeView.do','new18','width=1024,height=768,location=1,directories=1,resizable=1,status=1,toolbar=1,menubar=1,scrollbars=1');}

function sNav(cn,hn,sn){
//	alert(cn + ', ' + hn + ', ' + sn);
document.write ("\
<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase=url_protocol +  'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width=209 height=400>\
<param name='movie' value='/eng/inc/fla/snav0"+cn+".swf?hn="+hn+"&sn="+sn+"'>\
<param name='quality' value='high'>\
<param name='wmode' Value='Transparent'>\
<embed src='/eng/inc/fla/snav0"+cn+".swf?hn="+hn+"&sn="+sn+"' quality='high' pluginspage=url_protocol + 'www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width=209 height=400></embed></object>\
");
}

function Img(n,tog){eval("document.m"+n+".src=m"+n+"_"+tog+".src"); } //ÀÌ¹ÌÁö ·Ñ¿À¹ö
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 home(){location.href=sait_domain + "/main.jsp";} //
function korean(){location.href="/main.jsp"} //
function join(){location.href=sait_domain + "/join/agree.jsp";}	//È¸¿ø°¡ÀÔ
function login(){location.href=sait_domain + "/join/login.jsp";}	//·Î±×ÀÎ
function sitemap(){location.href=sait_domain + "/eng/etc/e_sitemap.jsp";}
function contactus(){location.href=sait_domain + "/eng/etc/e_contactus.jsp";}
function search(){location.href=sait_domain + "/eng/etc/e_search.jsp";}
function mail(){location.href="mailto:webmaster.sait@samsung.com";}
//function brainsam(){window.open('http://brainsam.net','new1','width=1024,height=768,location=1,directories=1,resizable=1,status=1,toolbar=1,menubar=1,scrollbars=1');}
function buynet(){window.open('http://www.saitbuynet.com','new2','width=1024,height=768,location=1,directories=1,resizable=1,status=1,toolbar=1,menubar=1,scrollbars=1');}
function personal(){window.open('/eng/etc/e_pop_personal.jsp','new3','width=492,height=640,location=0,directories=0,resizable=0,status=0,toolbar=0,menubar=0,scrollbars=0');}
function personal1(){window.open('/etc/pop_personal_etc.jsp','new3','width=492,height=680,location=0,directories=0,resizable=0,status=0,toolbar=0,menubar=0,scrollbars=0');}

function email(){window.open('/eng/etc/e_pop_email.jsp','new4','width=492,height=295,location=0,directories=0,resizable=0,status=0,toolbar=0,menubar=0,scrollbars=0');}
function clicktech(){window.open('http://www.clicktechnology.co.kr','new5','width=1024,height=768,location=1,directories=1,resizable=1,status=1,toolbar=1,menubar=1,scrollbars=1');}


u0="/eng/main.jsp";

u1="/eng/about/e_index.jsp";
u11="/eng/about/e_open.jsp";
u111="/eng/about/e_gro.jsp";


u17="/eng/about/e_greetings.jsp";
u12="/eng/about/e_history.jsp";
u18="/eng/about/e_achievements.jsp";
u13="/eng/about/e_global.jsp";
u19="/eng/about/e_gro.jsp";
u112="/eng/about/e_core.jsp";
u14=u141="/eng/about/share/e_science.jsp";
u142="/eng/about/share/e_community.jsp";
u143="/eng/about/share/e_sf.jsp";
u15="/eng/about/e_ci.jsp";
u16=u161="/eng/about/news/e_antenna.jsp";
u162="/eng/about/news/e_pressroom.jsp";







u2="/eng/research/e_index.jsp";
u21="/eng/research/e_index.jsp";
u211="/eng/research/futureit/e_real.jsp";
u212="/eng/research/futureit/e_communication.jsp";
u213="/eng/research/futureit/e_multicore.jsp";
u214="/eng/research/futureit/e_data.jsp";
u215="/eng/research/futureit/e_medical.jsp";
u216="/eng/research/futureit/e_vitalsign.jsp";
u22="/eng/research/e_materials.jsp";
u221="/eng/research/materials/e_flexible.jsp";
u222="/eng/research/materials/e_solid.jsp";
u223="/eng/research/materials/e_film.jsp";
u224="/eng/research/materials/e_micro.jsp";
u225="/eng/research/materials/e_oxide.jsp";
u226="/eng/research/materials/e_spintronics.jsp";
u227="/eng/research/materials/e_nano.jsp";
u23="/eng/research/e_energy.jsp";
u231="/eng/research/energy/e_storage.jsp";
u232="/eng/research/energy/e_conversion.jsp";
u233="/eng/research/energy/e_environment.jsp";
u24="/eng/research/e_bio.jsp";
u241="/eng/research/bio/e_gene.jsp ";
u242="/eng/research/bio/e_point.jsp";
u243="/eng/research/bio/e_therapeutic.jsp";

u281="/eng/research/e_research_article.jsp";
u282="/eng/research/e_innovation.jsp";

u3="/eng/career/e_index.jsp";
u31=u311="/eng/career/recruit/e_guide.jsp";
u312="/eng/career/recruit/e_notice.jsp";
u313="/eng/career/recruit/e_faqs.jsp";
u32=u321="/eng/career/working/e_person.jsp";
u322="/eng/career/working/e_support.jsp";
u323="/eng/career/working/e_diversity.jsp";
u324="/eng/career/working/e_people.jsp";
u33=u331="/eng/career/benefit/e_compensation.jsp";
u332="/eng/career/benefit/e_fringe.jsp";
u333="/eng/career/benefit/e_community.jsp";
u34=u341="/eng/career/internship/e_internship.jsp";


function link(){
	
	
	
			var url = "";
			var depth = arguments.length;
			try {
				if(depth==0) return;
		
				/*ÆË¾÷ÀÏ°æ¿ì*//*
				if (arguments[0]=="6" && arguments[1] =="3" && arguments[2] =="3") {
					window.open('/culture/moral/principle/index.htm','Principle','width=1002,height=580,scrollbars=no');
					return;
				}*/
				
				else if(depth==1) url = eval("u"+arguments[0]);
				else if(depth==2) url = eval("u"+arguments[0]+arguments[1]);
				else if(depth==3) url = eval("u"+arguments[0]+arguments[1]+arguments[2]);
				else if(depth==4) url = eval("u"+arguments[0]+arguments[1]+arguments[2]+arguments[3]);
		
				if(url=="") alert("ÁØºñÁßÀÔ´Ï´Ù.");
				else 
				{
					//alert(url);
					location.href = sait_domain + url;
				}
		
			}catch(e) { alert("ÁØºñÁßÀÔ´Ï´Ù."); }
		
		
}


//ÀüÃ¼ ¸µÅ© Blur
function bluring(){
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocusin=bluring;


//Select Box
function setSelectBox(selName){
	sel = eval("document.all."+selName);

	borderColor = sel.bordercolor;
	selWidth = parseInt(sel.width);
	bgColor = sel.bgcolor;
	rectLeft = selWidth-2;
	spanWidth = selWidth;

	//span tag
	header  = "<span style='position:relative;margin-right:0px;";
	header += "width:"+spanWidth+";height:18px;border:1px solid "+borderColor+";background-color:"+bgColor+";'>\n";
	header += "<span style='position: absolute;left:0px;top:-2px;";
	header += "width:"+selWidth+";height:17px;clip:rect(2,"+rectLeft+",18,2);'>\n";
	footer = "</span></span>";

	sel.style.backgroundColor = bgColor;
	sel.style.width = selWidth;

	sel.outerHTML = header+sel.outerHTML+footer;
}


/*¶ó¿îµåÅ×ÀÌºí*/
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);
}

