// JavaScript Document

//SSL 관련 스크립트
document.domain="seromedu.com";


function OutputBackImg(input_name){
    input_name.style.backgroundColor = "#FFFFF7";
        input_name.style.backgroundImage = "";
}
function InputBackImg(input_name,img_name){
    if(input_name.value == ""){
        input_name.style.backgroundImage = "url(" + img_name + ")"; 
        }
}


function DisplayMe(index) {
        for (i=1; i<=3; i++)
        if (index == i) {
        thisMe = eval("me" + index + ".style");
        thisMe.display = "";
        } 
        else {
        otherMe = eval("me" + i + ".style"); 
        otherMe.display = "none"; 
        }
        }
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_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 DisplaySerom(index) {
	for (i=1; i<=2; i++){
        if (index == i) {
			thisMe = eval("serom" + index + ".style");
			thisMe.display = "";
        } 
        else {
			otherMe = eval("serom" + i + ".style"); 
			otherMe.display = "none"; 
        }
	}
}
		

function DisplayNotice(index) {
        for (i=1; i<=2; i++)
        if (index == i) {
        thisMe = eval("notice" + index + ".style");
        thisMe.display = "";
        } 
        else {
        otherMe = eval("notice" + i + ".style"); 
        otherMe.display = "none"; 
        }
        }
		
		

function DisplayKnow(index) {
        for (i=1; i<=3; i++)
        if (index == i) {
        thisMe = eval("know" + index + ".style");
        thisMe.display = "";
        } 
        else {
        otherMe = eval("know" + i + ".style"); 
        otherMe.display = "none"; 
        }
        }
		


function DisplayInfo(index) {
        for (i=1; i<=3; i++)
        if (index == i) {
        thisMe = eval("info" + index + ".style");
        thisMe.display = "";
        } 
        else {
        otherMe = eval("info" + i + ".style"); 
        otherMe.display = "none"; 
        }
        }
		
function DisplayDday(index) {
	for (i=1; i<=3; i++)
        if (index == i) {
        thisMe = eval("Dday" + index + ".style");
        thisMe.display = "";
        } 
        else {
        otherMe = eval("Dday" + i + ".style"); 
        otherMe.display = "none"; 
        }
}		
		
		
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_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];}
}




/***************************************************************************/
/*  Description : IE 6.0 PNG 핵
/*             css : .png24 { tmp:expression(setPng24(this)); } 와 같이 사용
/*             파이어폭스에서는 error남 why? tmp:expression때문에 -> 6.0에서만 실행되게 수정    
/***************************************************************************/
function setPng24(obj)
{
    if( navigator.appName.indexOf("Microsoft") > -1 ){              // 마이크로소프트 익스플로러인지 확인
        if( navigator.appVersion.indexOf("MSIE 6") > -1){
            obj.width = obj.height = 1;
            obj.className = obj.className.replace(/\bpng24\b/i,'');
            obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
            obj.src = '';
            return '';
        }
    }
}





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_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

//로그인 관련
function login(){
	var form = document.login_form;
	if(form.id.value == ""){
		alert('아이디를 입력해 주세요');
		form.id.focus();
		return;
	}
	if(form.pw.value==''){
		alert('비밀번호를 입력해 주세요');
		form.pw.focus();
		return;
	}
	form.submit();
}

function logout(){
	location.href="http://www.seromedu.com/common/logout_new.php?id=<?=$userId?>"
}
//엔터키로 서브밋
function check(form){
   if(true){
      form.submit();
   }else{
      return false;
   }
}

//용어사전 팝업
function dicView(){
    var nW = window.open('http://vod.seromedu.com/dicView.php','dicView','width=770,height=546,top=0,left=0,scrollbars=yes,resizable=yes'); 
    return;
}

//링크 외곽 점선 없애기
function autoBlur(){ 
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") 
		document.body.focus(); 
} 
document.onfocusin=autoBlur; 



