
//******************* ÄíÅ°°ü·Ã ÇÔ¼ö ½ÃÀÛ *******************
function setCookie(sName,sVal,Expiretime) {
    var str=sName + "=" + escape(sVal) ;
    if(Expiretime!=null)
        str+="; expires="+ Expiretime;

    document.cookie=str;
}

function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}


function getCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;

  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);

    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0)
      break;
  }
  return null;
}
/*
//°øÅëÀÌ ¾Æ´Ñ µí ½Í¾î ÀÏ½Ã ÁÖ¼® Ã³¸®(070306) -- ÀÓÀº¼÷
function showLayer() {
 var exp=new Date();
 var ExpireDate=exp.getTime()+(24*3600*1000);
 exp.setTime(ExpireDate);
 setCookie('skop','0',exp.toGMTString());
document.all.divMenu2.style.visibility = "visible";
}

function hideLayer() {
   document.all.divMenu2.style.visibility = "hidden";
}
*/
//******************* ÄíÅ°°ü·Ã ÇÔ¼ö ³¡ *******************/


//******************* ·¹ÀÌ¾î Ã³¸® ÇÔ¼ö ½ÃÀÛ *******************

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){
		return document.layers[objectId];}
	else
		return false;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function showHideLayers() { //v3.0
  var i,p,v,obj,args=showHideLayers.arguments;
  for (i=0; i<(args.length-1); i+=2) if ((obj=getObject(args[i]))!=null) { v=args[i+1];
    if (obj.style) { obj=obj.style; v=(v=='show')?'block':(v=='hide')?'none':v; }
    obj.display=v; }
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//******************* ·¹ÀÌ¾î Ã³¸® ÇÔ¼ö ³¡ *******************/


//******************* ÆäÀÌÁö ¿ÀÇÂ °ü·Ã ÇÔ¼ö ½ÃÀÛ *******************

// Ä·ÆÛ½º¸Ê ÆäÀÌÁö ¿ÀÇÂ
function c_map(){
	win=window.open("/e-home-s/campusmap/swf/main.jsp",'Ä·ÆÛ½º¸Ê','width=1012 height=750 top=0 left=0 scrollbars=yes');
}

function study(){
	win=window.open("http://vod.skku.ac.kr/pages/z_etc/building/seoul/index_seoul.html",'Ä·ÆÛ½º¸Ê','top=0 left=0 scrollbars=yes');
}

// ÀÌ¹ÌÁö ´º½º URL ¿ÀÇÂ
function open_news(url)
{
  window.open(url,"notics", 'scrollbars=yes,resizable=no,copyhistory=no,width=600,height=430');
}

// °øÁö ÆË¾÷ ¿ÀÇÂ
function open_news_main(num)
{
  //window.open("/new_home/popup/popup_notice.jsp?mode=read&physical_num="+num,"notics", 'scrollbars=yes,resizable=no,copyhistory=no,width=600,height=430');
	window.open("/new_home/popup/popup_notice.jsp?mode=read&physical_num="+num,"notics", 'scrollbars=yes,resizable=no,copyhistory=no,width=750,height=430');
}

// ´º½º ÆË¾÷ ¿ÀÇÂ
function open_news_main2(num)
{
  //window.open("/new_home/popup/popup_notice.jsp?mode=read&physical_num="+num,"notics", 'scrollbars=yes,resizable=no,copyhistory=no,width=600,height=430');
	window.open("/new_home/popup/popup_notice2.jsp?mode=read&physical_num="+num,"notics", 'scrollbars=yes,resizable=no,copyhistory=no,width=750,height=430');
}

// ´º½º & °øÁö ¿ÀÇÂ
function open_news_url(num)
{
  window.open("/e-home-s/New_Page/news/link.jsp?physical_num="+num, "", '');
}

// °øÁö»çÇ× ÆäÀÌÁö·Î ÀÌµ¿
function go_notice_main()
{
	num = document.frm.notic_code.value;
	if(num==null || num=="")
		num = 0;

	document.location.href("/e-home-s/news/notice/list.jsp?b_code="+num);
}

// Çà»ç¾È³» ¿ÀÇÂ
function open_ievent(url)
{
  window.open(url,"ievent", 'scrollbars=yes,resizable=no,copyhistory=no,width=600,height=380');
}

// ¹è³Ê ÆäÀÌÁö ¿ÀÇÂ
function win_banner(url)
{
  window.open(url,"notics", 'scrollbars=no,resizable=no,copyhistory=no,width=534,height=519');
}

//±³Á÷¿ø Áõ¸í¼­ ¹ß±Þ ÆäÀÌÁö ¿ÀÇÂ
function autoLogin(contentId, giwan_no)
{
    window.open('http://uni.webminwon.com/web_kiosk_3/kiosk_link_asp/kiosk_link_auto.asp?contentId=' + contentId + '&giwan_no=' + giwan_no,'web_kiosk','width=620,height=450,top='+(screen.height-450)/2+',left='+(screen.width-620)/2);
}

/* formÀÌ Á¸ÀçÇÏÁö ¾Ê±â¶§¹®¿¡ ÀÏ½Ã ÁÖ¼®Ã³¸® -- ÀÓÀº¼÷ (¿ÀÇÂ ÈÄ ¹«¸® ¾øÀ¸¸é Á¦°Å)
// KDH È¨ÆäÀÌÁö ¿ÀÇÂ
function open_KDH()
{
  document.kdh_login.submit();
}
*/
// Á¤½Ã °æÀï·ü ¹ßÇ¥
function open_ipsi(){
	window.open('http://home.skku.edu/~website/IPSI/index/read.php', '', 'width=715,height=700,scrollbars=yes,resizable=yes');
}

// ÆíÀÔÇÐ °æÀï·ü ¹ßÇ¥

function open_ipsi_pi(){
	window.open('http://home.skku.edu/~website/IPSI/index/read_pi.php', '', 'width=950,height=700,scrollbars=yes,resizable=yes');
}


// ¼ö½Ã2ÇÐ±â °æÀï·ü ¹ßÇ¥

function open_ipsi_si(){
	window.open('http://home.skku.edu/~website/IPSI/2007_2/read2.php', '', 'width=945,height=870,scrollbars=yes,resizable=yes');
}

// ½Å±Ô Á÷¿ø ¸ðÁý
function open_mozip()
{
	window.open('http://www.skku.edu/e-skku-s/hjis18101', 'mozip', 'menubar=1,toolbar=1,scrollbars=1,resizable=1,status=1,screenX=1,screenY=1,left=1,top=1,width=1024,height=768');
}

//ÇÕ°ÝÀÚ ¹ßÇ¥ ½ºÅ©¸³Æ®
function DoSubmit(year, fg1, fg2 ) {
  document.hsih100_connect.iphak_year.value = year;
  document.hsih100_connect.mojip_gb.value = fg1;
  document.hsih100_connect.use_gb.value = fg2;
  document.hsih100_connect.submit();
}

// µ¿¿µ»ó °­ÀÇ(DNA) ÆäÀÌÁö ¿ÀÇÂ
function vod_dna()
{
   window.open('/etc/dna_view.html', 'itlec', 'resizable=no,copyhistory=no,scrollbars=0,width=994,height=542,left=0,top=100');
}

// ÇÐºÎ´ëÇÐ mbook ¸µÅ©
function mbooks(args) {

	if(!args) args = '';
	window.open('http://115.145.129.31/Source/MBook/?Host=115.145.129.31&Domain=mb&'+args,'','top=0, left=10000, width=0, height=0, channelmode=no, directories=no, fullscreen=no, location=no, menubar=no, resizable=no, scrollbars=no, status=no, titlebar=no,toolbar=no');
}

// ¼ÅÆ²¹ö½º ¾È³» ÆäÀÌÁö ¿ÀÇÂ
function open_bus() {
	window.open('/etc/bus_time.html','','scrollbars=yes,resizable=no,copyhistory=no,width=720,height=500');
}

// Åë±Ù¹ö½º ¾È³» ÆäÀÌÁö ¿ÀÇÂ
function open_bus2(cam_code) {
	window.open('/New_Page/about/ab_location/bus_' + cam_code + '.html','','scrollbars=yes,resizable=no,copyhistory=no,width=650,height=400');
}

// ÁÖÂ÷¾È³» ÆäÀÌÁö ¿ÀÇÂ
function open_parking(cam_code) {
	window.open('/popup/popup_' + cam_code + '_car.htm','','scrollbars=yes,resizable=no,copyhistory=no,width=650,height=500');
}

// ÀüÈ­¿ä±Ý°íÁö¼­ Ãâ·Â
function telprint(){
  window.open('http://www.skku.edu/e-skku-s/gwtl02010','','scrollbars=yes,width=800,height=600,left=300,top=250');
}

function ElecDirectory(){
  window.open('http://www.skku.edu/e-skku-s/gwal10300?p1=home','','scrollbars=yes,width=1000,height=600,left=300,top=250');
}

// ±¹Á¦±³·ù ÀÔÇÐ¼³¸íÈ¸ µ¿¿µ»ó
function open_inter()
{
   window.open('/etc/inter_ppt/index.html', 'inter_ppt', 'resizable=no,copyhistory=no,scrollbars=0,width=994,height=582,left=0,top=100');
}

//******************* ÆäÀÌÁö ¿ÀÇÂ °ü·Ã ÇÔ¼ö ³¡ *******************/


//******************* ±âÅ¸ ÇÔ¼ö ½ÃÀÛ *******************

// ÀÌ¸ÞÀÏ ÃßÃâ ¹æÁö °ü·Ã ÇÔ¼ö
function AntiSpam(id) {
	window.open('/e-home-s/include/antispamin.jsp?UniqId='+id,'AntiSpam','width=180,height=263,left=1,top=1');
}

// È¨ÆäÀÌÁö °Ë»ö ½ºÅ©¸³Æ®
function search_form()
{
     var s = document.search_form;
     var query = s.query.value;
     if(s.query.value == "") {
        alert("°Ë»ö ´Ü¾î¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿À.");
        s.query.focus();
        return;
     }
     s.submit();
 }

// Äü ¿¢¼¼½º Ã³¸® ÇÔ¼ö
function goUrl(sel, targetstr)
{
  var index = sel.selectedIndex;
  if (sel.options[index].value != '') {
     if (targetstr == 'blank') {
       window.open(sel.options[index].value, 'win1');
     } else {
       var frameobj;
       if ((frameobj = eval(targetstr)) != null)
       frameobj.location = sel.options[index].value;
     }
  }
}

// Äü ¿¢¼¼½º Ã³¸® ÇÔ¼ö
function go_service(val)
{
	if(val)
	{
		if(val == "c_map")
			c_map();
		else if(val == "autoLogin")
			autoLogin('10001', '021129');
		else if(val == "open_bus")
			open_bus();
		else if(val == "open_parking_in")
			open_parking('in');
		else if(val == "open_parking_ja")
			open_parking('ja');
		else if(val == "mbooks")
			mbooks();
		else if(val == "telprint")
			telprint();
		else if(val == "study")
			study();
		else if(val.indexOf("n_") == 0)
			window.open(val.substring(2), '', '');
		else
			location.href(val);
     }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
/*
function message(msg){
  alert(msg);
}

*/

function ckServer()
{
	alert("½Ã½ºÅÛ ÀÛ¾÷Áß ÀÔ´Ï´Ù.\nÁßÁöÀÏ½Ã : 1.17,Åä 09~10½Ã(1½Ã°£)");
}

function inter_app()
{
	alert("ÀÀ½Ã¿ø¼­ Á¢¼ö°¡ ¸¶°¨ µÇ¾ú½À´Ï´Ù.\n\nÁÁÀº °á°ú ÀÖ±æ ¹Ù¶ø´Ï´Ù...^^");
}

// Æ¯¼ö¹®ÀÚ ¸·±â(XSSÃ³¸®)
function strSChk(value)
{
    var rv = 0

    for (var i = 0; i < value.length; i++) { 
        if (value.charAt(i) == '<' || value.charAt(i) == '>' || value.charAt(i) == '(' || value.charAt(i) == ')' || value.charAt(i) == '#' || value.charAt(i) == '&' || value.charAt(i) == '=' || value.charAt(i) == '\'' || value.charAt(i) == ';' || value.charAt(i) == '-' || value.charAt(i) == '+' || value.charAt(i) == '"') {
            rv = rv + 1;
        }
    }

    if (rv == 0){
        return true;
    }else{
        return false;
    }
}


//******************* ±âÅ¸ ÇÔ¼ö ³¡ *******************/
