/* 쿠기 설정 함수 */ function setCookie( name, value, expiredays ){ var todayDate = new Date(); todayDate.setDate( todayDate.getDate() + expiredays ); document.cookie = name + '=' + escape( value ) + '; path=/; domain=.sarangbang.com; expires=' + todayDate.toGMTString() + ';' } function getCookie( name ){ var nameOfCookie = name + '='; var x = 0; while ( x <= document.cookie.length ) { var y = (x+nameOfCookie.length); if ( document.cookie.substring( x, y ) == nameOfCookie ) { if ( (endOfCookie=document.cookie.indexOf( ';', y )) == -1 ) endOfCookie = document.cookie.length; return unescape( document.cookie.substring( y, endOfCookie ) ); } x = document.cookie.indexOf( ' ', x ) + 1; if ( x == 0 ) break; } return ''; } function DisplayFlash(width,height,url){ document.writeln(''); } function getById(id, where) { if (where == null) return document.getElementById(id); else return eval(where + ".document.getElementById('"+id+"')"); } // 메인 상단 통합검색 function sTotalSearch(obj) { var strSelected = obj.szSearchType.value; if( strSelected=='house' ){ obj.action = "http://home.sarangbang.com/search/"; //obj.p.value = obj.search_value.value; }else if( strSelected=='room' ){ var totalSearch_Input=document.getElementById('totalSearch_Input').value; document.frmSearch.p.value=''; obj.action = "http://room.sarangbang.com/search.html?sword="+totalSearch_Input; }else if( strSelected=='job' ){ obj.action = "http://job.sarangbang.com/employ/List.html"; }else if( strSelected=='car' ){ obj.action = "http://car.sarangbang.com/search/"; }else if( strSelected=='life' ){ obj.action = "http://life.sarangbang.com/linead/list.html?menu1=LF&menu2=L1"; }else if( strSelected=='living' ){ obj.action = "http://life.sarangbang.com/linead/list.html?menu1=LV&menu2=X01"; }else if( strSelected=='car' ){ obj.action = "http://car.sarangbang.com/search/"; }else if( strSelected=='joonggo' ){ var totalSearch_Input=document.getElementById('totalSearch_Input').value; obj.action = "http://joonggo.sarangbang.com/?do=item&mode=list&kw="+totalSearch_Input; }else if( strSelected=='cococ' ){ var totalSearch_Input=document.getElementById('totalSearch_Input').value; document.frmSearch.p.value=''; obj.action = "http://www.cococ.co.kr/search/?q=main&where=all&x=0&y=0&sword="+totalSearch_Input; } else{ obj.action = "http://"+strSelected+".sarangbang.com/"; } obj.submit(); //if(document.getElementById('suggestKeyword').value=='채용박람회' || document.getElementById('suggestKeyword').value=='') { // window.open('http://job.sarangbang.com/event/2009/',null); //location.href='http://job.sarangbang.com/event/2009/'; // return false; //} } /** * @brief GNB 영역 검색 타이틀 설정 */ function setSearchData( nValue, oTitle, oSearchType, oSearchList ) { var szTitle = ""; if(nValue == "house") { szTitle = "부동산"; } else if(nValue == "room") { szTitle = "원룸"; } else if(nValue == "job") { szTitle = "취업"; } else if(nValue == "car") { szTitle = "자동차"; } else if(nValue == "life") { szTitle = "라이프"; } else if(nValue == "living") { szTitle = "생활용품"; } else if(nValue == "joonggo") { szTitle = "중고장터"; } else if(nValue == "cococ") { szTitle = "코콕"; } try { oTitle.innerHTML = szTitle; oSearchType.value = nValue; } catch (e) { } oSearchList.style.display = 'none'; } /** * @brief GNB 영역 검색메뉴 설정 */ function setSearchMenu( oSearchList ) { try { var szDisp = (oSearchList.style.display == "block") ? "none" : "block"; oSearchList.style.display = szDisp; } catch (e) { } } Array.prototype.shuffle = function(){ return this.concat().sort( function(){return Math.random() - Math.random();} ); } function DisplayBanner(szArray,n){ var arr = szArray.shuffle(); var nIndex = 0; for(i=0;i"); document.write(flashTemp[1]); document.write("<"); document.write("/script>"); } else document.write(arr[i]); document.write("
"); nIndex++; } if(n==nIndex) break; } } // 메인 중앙 뉴스 분류 function cNews2010(n){ document.getElementById('NewsImg1').src='/img/main2010/news_c_1.jpg'; document.getElementById('NewsImg2').src='/img/main2010/news_c_2.jpg'; document.getElementById('NewsImg3').src='/img/main2010/news_c_3.jpg'; document.getElementById('NewsImg4').src='/img/main2010/news_c_4.jpg'; document.getElementById('news1').style.display='none'; document.getElementById('news2').style.display='none'; document.getElementById('news3').style.display='none'; document.getElementById('news4').style.display='none'; document.getElementById('newPhoto1').style.display='none'; document.getElementById('newPhoto2').style.display='none'; document.getElementById('newPhoto3').style.display='none'; document.getElementById('newPhoto4').style.display='none'; document.getElementById('NewsImg'+n).src='/img/main2010/news_c_'+n+'_over.jpg'; document.getElementById('news'+n).style.display=''; document.getElementById('newPhoto'+n).style.display=''; } function ViewColumn(){ var obj = document.getElementById("divColumn"); obj.style.top = 5; obj.style.left = 47; obj.style.display=''; } // 우측칼럼 function cColumn(n){ document.getElementById('cColumn1').style.display='none'; document.getElementById('cColumn2').style.display='none'; document.getElementById('cColumn3').style.display='none'; document.getElementById('cColumn4').style.display='none'; document.getElementById('cColumn5').style.display='none'; document.getElementById('cColumn'+n).style.display=''; } function ViewFood(){ var obj = document.getElementById("divFood"); obj.style.top = 5; obj.style.left = 47; obj.style.display=''; } // 우측 맛집 function cFood(n){ document.getElementById('food1').style.display='none'; document.getElementById('food2').style.display='none'; document.getElementById('food'+n).style.display=''; } // 하단 쉼터 function cSNS(n){ document.getElementById('SnsImg2').src='/img/main2010/sns_2.gif'; document.getElementById('SnsImg3').src='/img/main2010/sns_3.gif'; document.getElementById('SnsImg4').src='/img/main2010/sns_4.gif'; document.getElementById('cA1').style.display='none'; document.getElementById('cA2').style.display='none'; document.getElementById('cA3').style.display='none'; document.getElementById('cA4').style.display='none'; document.getElementById('SnsImg'+n).src='/img/main2010/sns_'+n+'_over.gif'; document.getElementById('cA'+n).style.display=''; } function cSNS2(n){ document.getElementById('SnsImg5').src='/img/main2010/sns_5.gif'; document.getElementById('SnsImg6').src='/img/main2010/sns_6.gif'; document.getElementById('SnsImg7').src='/img/main2010/sns_7.gif'; //document.getElementById('SnsImg8').src='/img/main2010/sns_8.gif'; document.getElementById('cA1').style.display='none'; document.getElementById('cA5').style.display='none'; document.getElementById('cA6').style.display='none'; document.getElementById('cA7').style.display='none'; //document.getElementById('cA8').style.display='none'; document.getElementById('SnsImg'+n).src='/img/main2010/sns_'+n+'_over.gif'; document.getElementById('cA'+n).style.display=''; } // 메인 중앙 뉴스 분류 function cNews2011(n){ document.getElementById('NewsImg1').src='/img/main2010/news_c_1.jpg'; document.getElementById('NewsImg2').src='/img/main2010/news_c_2.jpg'; document.getElementById('NewsImg3').src='/img/main2010/news_c_3.jpg'; document.getElementById('NewsImg5').src='/img/main2010/news_c_5.jpg'; document.getElementById('NewsImg6').src='/img/main2010/news_c_6.jpg'; document.getElementById('news1').style.display='none'; document.getElementById('news2').style.display='none'; document.getElementById('news3').style.display='none'; document.getElementById('news5').style.display='none'; document.getElementById('news6').style.display='none'; document.getElementById('newPhoto1').style.display='none'; document.getElementById('newPhoto2').style.display='none'; document.getElementById('newPhoto3').style.display='none'; document.getElementById('newPhoto5').style.display='none'; document.getElementById('newPhoto6').style.display='none'; document.getElementById('NewsImg'+n).src='/img/main2010/news_c_'+n+'_over.jpg'; document.getElementById('news'+n).style.display=''; document.getElementById('newPhoto'+n).style.display=''; } // 숫자체크 function isNumberKey(evt) { var charCode = (evt.which) ? evt.which : event.keyCode if (charCode > 31 && (charCode < 48 || charCode > 57)) return false; return true; } function NewWindow(mypage,myname,w,h,scroll){ var winl = (screen.width-w)/2; var wint = (screen.height-h)/2; var settings ='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',status=no,menubar=no'; win=window.open(mypage,myname,settings); return win; }