/**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='10,12,121,29' href='javascript:clicktech()'>\
<!--area shape=rect coords='133,13,196,29' href='javascript:brainsam()'-->\
<area shape=rect coords='206,12,271,29' >\
<area shape=rect coords='288,10,380,30' href='javascript:personal()'>\
<area shape=rect coords='389,11,453,31' 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 sNav(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 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";
u12="/eng/about/e_history.jsp";
u13="/eng/about/e_global.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=u211="/eng/research/intelligence/e_audiovisual.jsp";
u212="/eng/research/intelligence/e_colorimage.jsp";
u213="/eng/research/intelligence/e_compression.jsp";
u214="/eng/research/intelligence/e_modeling.jsp";
u215="/eng/research/intelligence/e_awareness.jsp";
u22=u221="/eng/research/communication/e_protocol.jsp";
u222="/eng/research/communication/e_modem.jsp";
u223="/eng/research/communication/e_rf.jsp";
u224="/eng/research/communication/e_system.jsp";
u23=u231="/eng/research/opto/e_flatpanel.jsp";
u232="/eng/research/opto/e_laser.jsp";
u233="/eng/research/opto/e_led.jsp";
u24=u241="/eng/research/nano/e_memory.jsp";
u242="/eng/research/nano/e_storage.jsp";
u243="/eng/research/nano/e_mems.jsp";
u25=u251="/eng/research/energy/e_fuelcell.jsp";
u252="/eng/research/energy/e_battery.jsp";
u253="/eng/research/energy/e_eco.jsp";
u254="/eng/research/energy/e_photo.jsp";
u26=u261="/eng/research/bio/e_biochip.jsp";
u262="/eng/research/bio/e_uhealth.jsp";
u27=u271="/eng/research/basic/e_chip.jsp";
u272="/eng/research/basic/e_materials.jsp";
u273="/eng/research/basic/e_nanofabric.jsp";
u274="/eng/research/basic/e_analytical.jsp";
u275="/eng/research/basic/e_simulation.jsp";
u276="/eng/research/basic/e_packaging.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 
		{
			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);
}
