var xmlHttp = false; if (!xmlHttp && typeof XMLHttpRequest != 'undefined') { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); }else { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } function program_ajax(key, attl) { var gnbtitile1 = document.getElementById("noticeMenu01"); var gnbtitile2 = document.getElementById("noticeMenu02"); var gnbtitile3 = document.getElementById("noticeMenu03"); var gnbtitile4 = document.getElementById("noticeMenu04"); if (key == 1) //상담프로그램 { gnbtitile1.className = "now"; gnbtitile2.className = ""; gnbtitile3.className = ""; gnbtitile4.className = ""; } else if(key==2) //치료재활프로그램 { gnbtitile1.className = ""; gnbtitile2.className = "now"; gnbtitile3.className = ""; gnbtitile4.className = ""; } else if (key == 3) //교육프로그램 { gnbtitile1.className = ""; gnbtitile2.className = ""; gnbtitile3.className = "now"; gnbtitile4.className = ""; } else if(key==4) //홍보프로그램 { gnbtitile1.className = ""; gnbtitile2.className = ""; gnbtitile3.className = ""; gnbtitile4.className = "now"; } var url = "/ajax_html/program.php?cate_num="+attl; xmlHttp.open("POST", url, true); xmlHttp.onreadystatechange = pre_view; xmlHttp.send(null); } function pre_view() { if (xmlHttp.readyState == 4) { var response = xmlHttp.responseText; document.getElementById("noticeList01").innerHTML = response; } } /** * 쿠키값 추출 * @param cookieName 쿠키명 */ function getCookie( cookieName ) { var search = cookieName + "="; var cookie = document.cookie; // 현재 쿠키가 존재할 경우 if( cookie.length > 0 ) { // 해당 쿠키명이 존재하는지 검색한 후 존재하면 위치를 리턴. startIndex = cookie.indexOf( cookieName ); // 만약 존재한다면 if( startIndex != -1 ) { // 값을 얻어내기 위해 시작 인덱스 조절 startIndex += cookieName.length; // 값을 얻어내기 위해 종료 인덱스 추출 endIndex = cookie.indexOf( ";", startIndex ); // 만약 종료 인덱스를 못찾게 되면 쿠키 전체길이로 설정 if( endIndex == -1) endIndex = cookie.length; // 쿠키값을 추출하여 리턴 return unescape( cookie.substring( startIndex + 1, endIndex ) ); } else { // 쿠키 내에 해당 쿠키가 존재하지 않을 경우 return false; } } else { // 쿠키 자체가 없을 경우 return false; } }