/**
 * popup
 * @param {url} arg1
 */
 function popup(arg1,arg2,arg3) {
	child = window.open(arg1,'popup_','width=440,height=591,status=no,toolbar=no,menubar=no,location=no,resizable=no');
    child.focus();
 }

// 로그인 입력부분 bg 처리
function login_check(obj, check){
    if (check == 'Y') {
        obj.style.background = "#FFFFFF";
    } else if(!obj.value && obj.name == 'user_id'){
        obj.style.background = "#FFFFFF url('/images/Main2/bg_id.gif') no-repeat top left";
    } else if(!obj.value && obj.name == 'user_passwd'){
        obj.style.background = "#FFFFFF url('/images/Main2/bg_password.gif') no-repeat top left";
    }
}

//한줄 광고 5초마다 변경
function change_ad(){
    var innerh = new Array(4);
    var innerid = new Array(4);

    for(i=ad_count,j=0; j < 4; i++) {
        if(i >= list_size){
            i = -1;
        }else if(ad_list[i][5].indexOf("main1") >= 0){
            innerh[j] =  "<a href=\"javascript:ad_pop('" + ad_list[i][0] + "','" + ad_list[i][2] + "','" + ad_list[i][3] + "','" + ad_list[i][4] + "');\">" + ad_list[i][1] + "</a>";
            j++;
        }
    }

    for(i=0, j=i+1; i < 4; i++, j++){
        innerid = document.getElementById('main_ad'+j);
        innerid.innerHTML = innerh[i];
    }

    ad_count += 4;

    if(ad_count > list_size) {
        ad_count = ad_count - list_size;
    }
}

//구인정보 팝업으로 보기
function pop_view(uid) {
    window.open("/main/job/recruit_view.html?uid="+uid,"pop","width=620,height=700,scrollbars=yes");
}
//구직정보 팝업으로 보기
function pop_resume_view(uid) {
    window.open("/main/job/resume_view.html?uid="+uid,"pop","width=620,height=700,scrollbars=yes");
}
//부동산 팝업으로 보기
function view(no) {
    window.open("/main/realty/realty_view.html?uid="+no,"view","width=520,height=690,scrollbars=auto");
}

//뉴스 더보기
function shownext(idx) {
    for(i=1;i<=8;i++) {
        doc = document.getElementById("main_media"+i);
        doc.style.display = "none";
    }
    doc = document.getElementById("main_media"+idx);
    doc.style.display = "block";
}

//핫이슈 롤링
function rotate_news() {
    if(newIdx>4) newIdx=1;
    document.getElementById('rotate_news1').style.display='none';
    document.getElementById('rotate_news2').style.display='none';
    document.getElementById('rotate_news3').style.display='none';
    document.getElementById('rotate_news4').style.display='none';
    document.getElementById('rotate_news'+newIdx).style.display='block';
    newIdx++;

    setTimeout("rotate_news()",5000);
}

//유학 tab 이동
function show_tab(arg1,arg2) {
    for(i=1;i<=4;i++) {
        document.getElementById(arg1+"_panel"+i).style.display="none";
        document.getElementById(arg1+"_tab"+i).style.fontWeight="normal";
        document.getElementById(arg1+"_tab"+i).style.background="url('/images/Main2/tab_off.gif')";
    }
    document.getElementById(arg1+"_panel"+arg2).style.display="block";
    document.getElementById(arg1+"_tab"+arg2).style.fontWeight="bold";
    document.getElementById(arg1+"_tab"+arg2).style.background="url('/images/Main2/tab_on.gif')";
}

//베너 롤링 시키기
// banner_roll("div태그 id", 배너1개높이, 딜레이, 1칸이동속도, 0,롤링체크 );
function banner_roll(div_id, banner_height, banner_delay, banner_speed, this_height,param_seq){
    var div_tag = document.getElementById(div_id);
    var tag_list;

    if(seq != param_seq){
        div_tag.style.top = 0;
        return false;
    }

    this_height++;

    if(this_height < banner_height) {
        div_tag.style.top = -this_height;
        setTimeout("banner_roll('" + div_id + "', " + banner_height + ", " + banner_delay + ", " + banner_speed + ", " + this_height + ", " + param_seq + ");", banner_speed);
    } else{
        tag_list = div_tag.getElementsByTagName("li");
        div_tag.appendChild(tag_list[0]);
        div_tag.style.top = 0;
        setTimeout("banner_roll('" + div_id + "', " + banner_height + ", " + banner_delay + ", " + banner_speed + ", 0, " + param_seq + ");", banner_delay);
    }
}

//상하이 114 tab 이동 (명함정보보기)
function showcompany() {
    var company_114      = document.getElementById('company_114');
    var company_namecard = document.getElementById('company_namecard');
    var main_114      = document.getElementById('main_114');
    var main_namecard = document.getElementById('main_namecard');

    company_114.style.background="url('/images/Main2/main_114_tab.gif') no-repeat left top";
    company_namecard.style.background="url('/images/Main2/main_114_tab_on2.gif') no-repeat left top";
    main_114.style.display='none';
    main_namecard.style.display='';
    company_114.style.fontWeight='normal';
    company_namecard.style.fontWeight='bold';
    document.bizform.keyword.value='';
}

//상하이 114 tab 이동 (114 보기)
function show114() {
    var company_114      = document.getElementById('company_114');
    var company_namecard = document.getElementById('company_namecard');
    var main_114      = document.getElementById('main_114');
    var main_namecard = document.getElementById('main_namecard');

    company_114.style.background="url('/images/Main2/main_114_tab_on.gif') no-repeat left top";
    company_namecard.style.background="url('/images/Main2/main_114_tab.gif') no-repeat left top";
    main_114.style.display='';
    main_namecard.style.display='none';
    company_namecard.style.fontWeight='normal';
    company_114.style.fontWeight='bold';
}

//매일중국어
function everydaycn_link(now) {
    location.href='/main/comu/community.html?code=everydaycn&now='+now+'&start=0';
}

//공지사항 보기
function notice(temp,temp2) {
    window.open("/main/board/notice.html"+temp,"notice","width=420,height=410,scrollbars=yes");
}
function noticelist(temp) {
    window.open("/main/board/notice.html","notice","width=420,height=410,scrollbars=yes");
}

//광고 팝업
function pop_114() {
    window.open("pop_114.html","pop","width=600,height=725");
}
function pop_biz(uid) {
   window.open("/main/114/pop_biz.html?uid="+uid,"pop","width=430,height=390");
}
function pop_namecard(uid) {
   window.open("/main/114/pop_namecard.html?uid="+uid,"pop","width=430,height=300");
}
/*
배너 롤링 효과
WindReset();
window.onresize = WindReset;
window.onscroll = WindScroll;
window.onresize = WindReset;

function WindScroll(){

    if(document.compatMode && document.compatMode != 'BackCompat') {
        scrollTop = document.documentElement.scrollTop;
    }else {
        scrollTop = document.body.scrollTop;
    }

    if(scrollTop <= <?=$banner_top?>) {
        right_banner.style.top = <?=$banner_top?> ;
    }else {
        right_banner.style.top = scrollTop + 10;
    }
//    right_banner.style.left = document.body.scrollWidth/2 + 470;
    right_banner.style.visibility = "visible";
}

function WindReset() {
    right_banner.style.top = <?=$banner_top?> ;
    right_banner.style.left = document.body.scrollWidth/2 + 470;
}
*/
