if (typeof(COMMON_JS) == 'undefined') { // 한번만 실행
    var COMMON_JS = true;

    // 전역 변수
    var errmsg = "";
    var errfld;

    // 필드 검사
    function check_field(fld, msg) 
    {
        if ((fld.value = trim(fld.value)) == "") 			   
            error_field(fld, msg);
        else
            clear_field(fld);
        return;
    }

    // 필드 오류 표시
    function error_field(fld, msg) 
    {
        if (msg != "")
            errmsg += msg + "\n";
        if (!errfld) errfld = fld;
        fld.style.background = "#BDDEF7";
    }

    // 필드를 깨끗하게
    function clear_field(fld) 
    {
        fld.style.background = "#FFFFFF";
    }

    function trim(s)
    {
        var t = "";
        var from_pos = to_pos = 0;

        for (i=0; i<s.length; i++)
        {
            if (s.charAt(i) == ' ')
                continue;
            else 
            {
                from_pos = i;
                break;
            }
        }

        for (i=s.length; i>=0; i--)
        {
            if (s.charAt(i-1) == ' ')
                continue;
            else 
            {
                to_pos = i;
                break;
            }
        }	

        t = s.substring(from_pos, to_pos);
        //				alert(from_pos + ',' + to_pos + ',' + t+'.');
        return t;
    }

    // 자바스크립트로 PHP의 number_format 흉내를 냄
    // 숫자에 , 를 출력
    function number_format(data) 
    {
        
        var tmp = '';
        var number = '';
        var cutlen = 3;
        var comma = ',';
        var i;
       
        len = data.length;
        mod = (len % cutlen);
        k = cutlen - mod;
        for (i=0; i<data.length; i++) 
        {
            number = number + data.charAt(i);
            
            if (i < data.length - 1) 
            {
                k++;
                if ((k % cutlen) == 0) 
                {
                    number = number + comma;
                    k = 0;
                }
            }
        }

        return number;
    }

    // 새 창
    function popup_window(url, winname, opt)
    {
        window.open(url, winname, opt);
    }


    // 폼메일 창
    function popup_formmail(url)
    {
        opt = 'scrollbars=yes,width=417,height=385,top=10,left=20';
        popup_window(url, "wformmail", opt);
    }

    // , 를 없앤다.
    function no_comma(data)
    {
        var tmp = '';
        var comma = ',';
        var i;

        for (i=0; i<data.length; i++)
        {
            if (data.charAt(i) != comma)
                tmp += data.charAt(i);
        }
        return tmp;
    }

    // 삭제 검사 확인
    function del(href) 
    {
        if(confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n정말 삭제하시겠습니까?")) 
            document.location.href = href;
    }

    // 쿠키 입력
    function set_cookie(name, value, expirehours, domain) 
    {
        var today = new Date();
        today.setTime(today.getTime() + (60*60*1000*expirehours));
        document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + today.toGMTString() + ";";
        if (domain) {
            document.cookie += "domain=" + domain + ";";
        }
    }

    // 쿠키 얻음
    function get_cookie(name) 
    {
        var find_sw = false;
        var start, end;
        var i = 0;

        for (i=0; i<= document.cookie.length; i++)
        {
            start = i;
            end = start + name.length;

            if(document.cookie.substring(start, end) == name) 
            {
                find_sw = true
                break
            }
        }

        if (find_sw == true) 
        {
            start = end + 1;
            end = document.cookie.indexOf(";", start);

            if(end < start)
                end = document.cookie.length;

            return document.cookie.substring(start, end);
        }
        return "";
    }

    // 쿠키 지움
    function delete_cookie(name) 
    {
        var today = new Date();

        today.setTime(today.getTime() - 1);
        var value = get_cookie(name);
        if(value != "")
            document.cookie = name + "=" + value + "; path=/; expires=" + today.toGMTString();
    }

    // 이미지의 크기에 따라 새창의 크기가 변경됩니다.
    // zzzz님께서 알려주셨습니다. 2005/04/12
    function image_window(img)
    {
        var w = img.tmp_width; 
        var h = img.tmp_height; 
        var winl = (screen.width-w)/2; 
        var wint = (screen.height-h)/3; 

        if (w >= screen.width) { 
            winl = 0; 
            h = (parseInt)(w * (h / w)); 
        } 

        if (h >= screen.height) { 
            wint = 0; 
            w = (parseInt)(h * (w / h)); 
        } 

        var js_url = "<script language='JavaScript1.2'> \n"; 
            js_url += "<!-- \n"; 
            js_url += "var ie=document.all; \n"; 
            js_url += "var nn6=document.getElementById&&!document.all; \n"; 
            js_url += "var isdrag=false; \n"; 
            js_url += "var x,y; \n"; 
            js_url += "var dobj; \n"; 
            js_url += "function movemouse(e) \n"; 
            js_url += "{ \n"; 
            js_url += "  if (isdrag) \n"; 
            js_url += "  { \n"; 
            js_url += "    dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x; \n"; 
            js_url += "    dobj.style.top  = nn6 ? ty + e.clientY - y : ty + event.clientY - y; \n"; 
            js_url += "    return false; \n"; 
            js_url += "  } \n"; 
            js_url += "} \n"; 
            js_url += "function selectmouse(e) \n"; 
            js_url += "{ \n"; 
            js_url += "  var fobj      = nn6 ? e.target : event.srcElement; \n"; 
            js_url += "  var topelement = nn6 ? 'HTML' : 'BODY'; \n"; 
            js_url += "  while (fobj.tagName != topelement && fobj.className != 'dragme') \n"; 
            js_url += "  { \n"; 
            js_url += "    fobj = nn6 ? fobj.parentNode : fobj.parentElement; \n"; 
            js_url += "  } \n"; 
            js_url += "  if (fobj.className=='dragme') \n"; 
            js_url += "  { \n"; 
            js_url += "    isdrag = true; \n"; 
            js_url += "    dobj = fobj; \n"; 
            js_url += "    tx = parseInt(dobj.style.left+0); \n"; 
            js_url += "    ty = parseInt(dobj.style.top+0); \n"; 
            js_url += "    x = nn6 ? e.clientX : event.clientX; \n"; 
            js_url += "    y = nn6 ? e.clientY : event.clientY; \n"; 
            js_url += "    document.onmousemove=movemouse; \n"; 
            js_url += "    return false; \n"; 
            js_url += "  } \n"; 
            js_url += "} \n"; 
            js_url += "document.onmousedown=selectmouse; \n"; 
            js_url += "document.onmouseup=new Function('isdrag=false'); \n"; 
            js_url += "//--> \n"; 
            js_url += "</"+"script> \n"; 

        var settings;

        if (g4_is_gecko) {
            settings  ='width='+(w+10)+','; 
            settings +='height='+(h+10)+','; 
        } else {
            settings  ='width='+w+','; 
            settings +='height='+h+','; 
        }
        settings +='top='+wint+','; 
        settings +='left='+winl+','; 
        settings +='scrollbars=no,'; 
        settings +='resizable=yes,'; 
        settings +='status=no'; 


        win=window.open("","image_window",settings); 
        win.document.open(); 
        win.document.write ("<html><head> \n<meta http-equiv='imagetoolbar' CONTENT='no'> \n<meta http-equiv='content-type' content='text/html; charset="+g4_charset+"'>\n"); 
        var size = "이미지 사이즈 : "+w+" x "+h;
        win.document.write ("<title>"+size+"</title> \n"); 
        if(w >= screen.width || h >= screen.height) { 
            win.document.write (js_url); 
            var click = "ondblclick='window.close();' style='cursor:move' title=' "+size+" \n\n 이미지 사이즈가 화면보다 큽니다. \n 왼쪽 버튼을 클릭한 후 마우스를 움직여서 보세요. \n\n 더블 클릭하면 닫혀요. '"; 
        } 
        else 
            var click = "onclick='window.close();' style='cursor:pointer' title=' "+size+" \n\n 클릭하면 닫혀요. '"; 
        win.document.write ("<style>.dragme{position:relative;}</style> \n"); 
        win.document.write ("</head> \n\n"); 
        win.document.write ("<body leftmargin=0 topmargin=0 bgcolor=#dddddd style='cursor:arrow;'> \n"); 
        win.document.write ("<table width=100% height=100% cellpadding=0 cellspacing=0><tr><td align=center valign=middle><img src='"+img.src+"' width='"+w+"' height='"+h+"' border=0 class='dragme' "+click+"></td></tr></table>");
        win.document.write ("</body></html>"); 
        win.document.close(); 

        if(parseInt(navigator.appVersion) >= 4){win.window.focus();} 
    }

    // a 태그에서 onclick 이벤트를 사용하지 않기 위해
    function win_open(url, name, option)
    {
        var popup = window.open(url, name, option);
        popup.focus();
    }

    // 우편번호 창
    function win_zip(frm_name, frm_zip1, frm_zip2, frm_addr1, frm_addr2)
    {
        url = g4_path + "/" + g4_bbs + "/zip.php?frm_name="+frm_name+"&frm_zip1="+frm_zip1+"&frm_zip2="+frm_zip2+"&frm_addr1="+frm_addr1+"&frm_addr2="+frm_addr2;
        win_open(url, "winZip", "left=50,top=50,width=616,height=460,scrollbars=1");
    }

    // 쪽지 창
    function win_memo(url)
    {
        if (!url)
            url = g4_path + "/" + g4_bbs + "/memo.php";
        win_open(url, "winMemo", "left=50,top=50,width=616,height=460,scrollbars=1");
    }

    // 포인트 창
    function win_point(url)
    {
        win_open(g4_path + "/" + g4_bbs + "/point.php", "winPoint", "left=20, top=20, width=616, height=635, scrollbars=1");
    }

    // 스크랩 창
    function win_scrap(url)
    {
        if (!url)
            url = g4_path + "/" + g4_bbs + "/scrap.php";
        win_open(url, "scrap", "left=20, top=20, width=616, height=500, scrollbars=1");
    }

    // 패스워드 분실 창
    function win_password_forget()
    {
        win_open(g4_path + "/" + g4_bbs + "/password_forget.php", 'winPasswordForget', 'left=50, top=50, width=616, height=500, scrollbars=1');
    }

    // 코멘트 창
    function win_comment(url)
    {
        win_open(url, "winComment", "left=50, top=50, width=800, height=600, scrollbars=1");
    }

    // 폼메일 창
    function win_formmail(mb_id, name, email)
    {
        win_open(g4_path+"/" + g4_bbs + "/formmail.php?mb_id="+mb_id+"&name="+name+"&email="+email, "winFormmail", "left=50, top=50, width=600, height=480, scrollbars=0");
    }

    // 달력 창
    function win_calendar(fld, cur_date, delimiter, opt)
    {
        if (!opt)
            opt = "left=50, top=50, width=240, height=230, scrollbars=0,status=0,resizable=0";
        win_open(g4_path+"/" + g4_bbs + "/calendar.php?fld="+fld+"&cur_date="+cur_date+"&delimiter="+delimiter, "winCalendar", opt);
    }

    // 설문조사 창
    function win_poll(url)
    {
        if (!url)
            url = "";
        win_open(url, "winPoll", "left=50, top=50, width=616, height=500, scrollbars=1");
    }

    // 자기소개 창
    function win_profile(mb_id)
    {
        win_open(g4_path+"/" + g4_bbs + "/profile.php?mb_id="+mb_id, 'winProfile', 'left=50,top=50,width=616,height=500,scrollbars=1');
    }

    var last_id = null;
    function menu(id)
    {
        if (id != last_id)
        {
            if (last_id != null)
                document.getElementById(last_id).style.display = "none";
            document.getElementById(id).style.display = "block";
            last_id = id;
        }
        else
        {
            document.getElementById(id).style.display = "none";
            last_id = null;
        }
    }

    function textarea_decrease(id, row)
    {
        if (document.getElementById(id).rows - row > 0)
            document.getElementById(id).rows -= row;
    }

    function textarea_original(id, row)
    {
        document.getElementById(id).rows = row;
    }

    function textarea_increase(id, row)
    {
        document.getElementById(id).rows += row;
    }

    // 글숫자 검사
    function check_byte(content, target)
    {
        var i = 0;
        var cnt = 0;
        var ch = '';
        var cont = document.getElementById(content).value;

        for (i=0; i<cont.length; i++) {
            ch = cont.charAt(i);
            if (escape(ch).length > 4) {
                cnt += 2;
            } else {
                cnt += 1;
            }
        }
        // 숫자를 출력
        document.getElementById(target).innerHTML = cnt;

        return cnt;
    }

    // 브라우저에서 오브젝트의 왼쪽 좌표
    function get_left_pos(obj)
    {
        var parentObj = null;
        var clientObj = obj;
        //var left = obj.offsetLeft + document.body.clientLeft;
        var left = obj.offsetLeft;

        while((parentObj=clientObj.offsetParent) != null)
        {
            left = left + parentObj.offsetLeft;
            clientObj = parentObj;
        }

        return left;
    }

    // 브라우저에서 오브젝트의 상단 좌표
    function get_top_pos(obj)
    {
        var parentObj = null;
        var clientObj = obj;
        //var top = obj.offsetTop + document.body.clientTop;<param name=wmode value="+wmode+">-->
        var top = obj.offsetTop;

        while((parentObj=clientObj.offsetParent) != null)
        {
            top = top + parentObj.offsetTop;
            clientObj = parentObj;
        }

        return top;
    }

    function flash_movie(src, ids, width, height, wmode)
    {
        var wh = "";
        if (parseInt(width) && parseInt(height)) 
            wh = " width='"+width+"' height='"+height+"' ";
        return "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' "+wh+" id="+ids+"><param name=movie value="+src+"><param name=quality value=high><embed src="+src+" quality=high wmode="+wmode+" type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash' "+wh+"></embed></object><center><a href='#' onclick=\"window.open('"+src+"','name','fullscreen,scrollbars')\">큰화면으로 보기</a></center>";
		var swfs = "+src+";
    }

    function obj_movie(src, ids, width, height, autostart)
    {
        var wh = "";
        if (parseInt(width) && parseInt(height)) 
            wh = " width='"+width+"' height='"+height+"' ";
        if (!autostart) autostart = false;
        return "<embed src='"+src+"' "+wh+" autostart='"+autostart+"'></embed>";
    }

    function doc_write(cont)
    {
        document.write(cont);
    }
}

//flash swf
function go_flash() {
var url = swfs;
window.open (url,"dicnote_flash","fullscreen=yes, scrollbars=0");
}

/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
var menu1=new Array()
menu1[0]='<span class="small"><a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_info_news">&nbsp;최근 애니소식</a>'
menu1[1]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_info_db">&nbsp;애니메이션 DB</a>'
menu1[2]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_info_pp">&nbsp;애니피플 DB</a>'
menu1[3]='&nbsp;'
menu1[4]='<a href="http://ani.dicnote.com/bbs/write.php?bo_table=ani_info_news">&nbsp;애니소식 글쓰기</a>'
menu1[5]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_info_detail">&nbsp;설명글 글쓰기</a>'
menu1[6]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_request">&nbsp;DB 등록요청</a></span>'
var menu2=new Array()
menu2[0]='<span class="small"><a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_review_ani">&nbsp;애니메이션 리뷰</a>'
menu2[1]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_onerow">&nbsp;한줄 감상평</a>'
menu2[2]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_recommend">&nbsp;추천&amp;비추천</a>'
menu2[3]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_story">&nbsp;애니이야기</a>'
menu2[4]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_shot01">&nbsp;애니 SHOT</a>'
menu2[5]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_famous">&nbsp;명대사명장면</a>'
menu2[6]='&nbsp;'
menu2[7]='<a href="http://ani.dicnote.com/bbs/write.php?bo_table=ani_review_ani">&nbsp;리뷰 글쓰기</a>'
menu2[8]='<a href="http://ani.dicnote.com/bbs/write.php?bo_table=ani_onerow">&nbsp;한줄감상평 글쓰기</a></span>'
var menu3=new Array()
menu3[0]='<span class="small"><a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_movie_01">&nbsp;감상노트 1관</a>'
menu3[1]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_movie_01&sst=wr_hit&sod=desc">&nbsp;- 인기도 정렬</a>'
menu3[2]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_movie_01&sst=wr_hit&sod=asc">&nbsp;- 조회수 정렬</a>'
menu3[3]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_movie_02">&nbsp;감상노트 2관</a>'
menu3[4]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_movie_02&sfl=wr_subject&stx=%EB%A7%A4%EB%93%9C%EB%AC%B4%EB%B9%84">&nbsp;- 매드무비</a>'
menu3[5]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_movie_02&sfl=wr_subject&stx=%EC%98%A4%ED%94%84%EB%8B%9D">&nbsp;- 오프닝</a>'
menu3[6]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_movie_02&sfl=wr_subject&stx=%EC%97%94%EB%94%A9">&nbsp;- 엔딩</a>'
menu3[7]='&nbsp;'
menu3[8]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_gallery_1">&nbsp;이미지관 이미지</a>'
menu3[9]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_gallery_2">&nbsp;이미지관 일러스트</a>'
menu3[10]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_gallery_3">&nbsp;이미지관 코스프레</a>'
menu3[11]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_gallery_4">&nbsp;이미지관 피규어</a>'
menu3[12]='&nbsp;'
menu3[13]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_music_data01">&nbsp;음악감상관 OP/ED</a>'
menu3[14]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_music_data02">&nbsp;음악감상관 OST</a>'
menu3[15]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_music_book">&nbsp;음악감상관 악보</a>'
menu3[16]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_music_lyric">&nbsp;음악감상관 가사</a>'

var menu4=new Array()
menu4[0]='<span class="small"><a href="http://club.dicnote.com">&nbsp;클럽전체보기</a>'
menu4[1]='<a href="http://ani.dicnote.com/club/club_main.php?cb_id=cb_realtime">&nbsp;RealTime</a>'
menu4[2]='<a href="http://ani.dicnote.com/club/club_main.php?cb_id=cb_imagenote">&nbsp;ImageNote</a>'
menu4[3]='<a href="http://ani.dicnote.com/club/club_main.php?cb_id=cb_musicclub">&nbsp;MusicClub</a></span>'
var menu5=new Array()
menu5[0]='<span class="small"><a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_freeboard">&nbsp;자유게시판</a>'
menu5[1]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_qna">&nbsp;질답게시판</a>'
menu5[2]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_humor">&nbsp;유머게시판</a>'
menu5[3]='&nbsp;'
menu5[4]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_broadcast_01">&nbsp;애니 24시간 음악방송</a>'
menu5[5]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_broadcast_01">&nbsp;- 신청곡 접수대</a>'
menu5[6]='<a href="http://antpeople.inlive.co.kr/listen.pls">&nbsp;- 방송 듣기</a>'
menu5[7]='&nbsp;'
menu5[8]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_mysong">&nbsp;애니노래방</a>'
menu5[9]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_mypic">&nbsp;애니그림방</a>'
menu5[10]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_relayquiz">&nbsp;릴레이퀴즈</a>'
menu5[11]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_creation">&nbsp;자작&amp;창작</a>'
menu5[12]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_oekaki">&nbsp;오에카키</a>'
menu5[13]='<a href="http://ani.dicnote.com/bbs/board.php?bo_table=ani_request">&nbsp;건의/요청</a>'
var menuwidth='100px'
var menubgcolor='white'
var disappeardelay=200
var hidemenu_onclick="yes"

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

//무비
function movieGo(url,w,h,autosize,showstbar,id){
	var movieStr=
	"<object classid='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95' id=MPlayer codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715' width='"+w+"' height='"+h+"' id='"+id+"' pluginspage='http://www.microsoft.com/windows/windowsmedia/download' />"+
	"<param name='Filename' value='"+url+"' />"+
	"<param name='AutoStart' value='true' />"+
	"<param name='ShowTracker' value='false' />"+
	"<param name='ShowControls' value='true' />"+
	"<param name='ShowGotoBar' value='false' />"+
	"<param name='ShowDisplay' value='false' />"+
	"<param name='ShowStatusBar' value='false' />"+
	"<param name='AutoSize' value='"+autosize+"' />"+
	"<param name='SHOWSTATUSBAR' value='"+showstbar+"' />"+
	"<param name='EnableContextMenu' value='0' />"+
	"</object>";
document.write(movieStr);
}
//여기까지

function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu