var _userSeq = 0; var _userId = ""; var _pageSeq = 0; var _pageId = ""; var _userParam = ""; var _objPlayer = null; var _objPopWindow = null; function top_init() { spreadSubMenu(); try { document.getElementById("body").onmouseout = function() { document.getElementById("submenu").style.display = "none"; } } catch(e) {} document.body.onunload = function() { //해당 사용자 로그 아웃 상태로 변경 setLogState("N"); } } //팝업 로그인창 열기 function openLoginBox() { _objPopWindow = window.open("http://www.somsee.com/popup/login.mog", "pop", "width=50, height=50"); } function setLogState(state) { var url = "http://www.somsee.com/inc/setLogState.inc"; var myAjax = new Ajax.Request ( url, { method:'post', parameters : {"state": state}, evalScript : true, onComplete : function() {} } ); } function spreadSubMenu() { var menu = document.getElementById("menubar").firstChild; while (menu) { if (menu.getAttribute("type") == "menu") { menu.onmouseover = function() { this.className = this.className + " mouseover"; var sMenu = document.getElementById("submenu"); var pos = Element.cumulativeOffset(this); if (navigator.appVersion.indexOf("MSIE 6") > -1) { pos[1] -= document.body.scrollTop; } // IE 6.0 if (this.getAttribute("menu") != "6") { sMenu.style.left = pos[0] - 1; } else { sMenu.style.left = pos[0] - 153; } sMenu.style.top = pos[1] + 29; sMenu.style.height = "auto"; sMenu.style.zIndex = 1000; sMenu.setAttribute("menu", this.getAttribute("menu")); subMenuCallback(this.getAttribute("menu")); sMenu.onmouseout = function() { this.style.display = "none"; var m = document.getElementById("menubar").firstChild; while (m) { if (m.getAttribute("type") == "menu") { m.className = m.className.replace(/ mouseover/g, ""); } m = m.nextSibling; } } sMenu.onmouseover = function() { this.style.display = "block"; var m = document.getElementById("menubar").firstChild; while (m) { if (m.getAttribute("type") == "menu") { if (m.getAttribute("menu") == this.getAttribute("menu")) { m.className = m.className + " mouseover"; } } m = m.nextSibling; } } } menu.onmouseout = function() { this.className = this.className.replace(/ mouseover/g, ""); } } menu = menu.nextSibling; } } function subMenuCallback(menuIndex) { var menuEntities = new Array(); var target = document.getElementById("submenu"); var targetWidth = "0px"; var targetLeft = 0; switch (menuIndex) { case "1": //마이홈 targetWidth = "0px"; targetLeft = 0; break; case "2": //음악 targetWidth = "0px"; targetLeft = 0; break; case "3": //친구 menuEntities.push(new Array("친구 목록", "http://www.somsee.com/friend/")); menuEntities.push(new Array("보낸 요청", "http://www.somsee.com/friend/rqstList.mog")); menuEntities.push(new Array("받은 요청", "http://www.somsee.com/friend/takeList.mog")); targetWidth = "130px"; targetLeft = 0; break; case "4": //쪽지 menuEntities.push(new Array("받은 쪽지", "http://www.somsee.com/slippaper/")); menuEntities.push(new Array("보낸 쪽지", "http://www.somsee.com/slippaper/sendList.mog")); menuEntities.push(new Array("보관한 쪽지", "http://www.somsee.com/slippaper/keepList.mog")); menuEntities.push(new Array("쪽지 보내기", "http://www.somsee.com/slippaper/sendSlippaper.mog")); targetWidth = "130px"; targetLeft = 0; break; case "5": //위젯 targetWidth = "0px"; targetLeft = 0; break; case "6": //사진 targetWidth = "0px"; targetLeft = 0; break; case "7": //친구 솜씨 if (_userSeq) { menuEntities.push(new Array("친구 목록을 불러 오는 중 입니다..", "")); getFriendList(); } targetWidth = "201px"; targetLeft = 100; default: break; } target.innerHTML = ""; target.style.display = "none"; target.style.width = targetWidth; if (menuEntities.length <= 0) { return; } else { Effect.Appear(target, { duration: 0.2 }); } for (var i=0; i -1) { // IE 7.0 } else { var submenu = document.getElementById("submenu"); if (Element.getHeight(submenu) > 188) { submenu.style.height = "188px"; } } } } ); } function tabEvent(seed) { try { var tabs = seed.firstChild; while (tabs) { tabs.onmouseover = function() { this.className = this.className + " selected_tab1"; } tabs.onmouseout = function() { this.className = this.className.replace(/ selected_tab1/g, ""); } tabs = tabs.nextSibling; } } catch(e) {} } function trim(str) { str = str.replace(/^\s*/,'').replace(/\s*$/,''); return str; } //set member history (log) function mh_setHistory(param) { // param : array param['flag'] = param['flag'] ? param['flag'] : 0; param['kind'] = param['kind'] ? param['kind'] : 0; param['numSong'] = param['numSong'] ? param['numSong'] : 0; param['songno'] = param['songno'] ? param['songno'] : 0; param['otherUserSeq'] = param['otherUserSeq'] ? param['otherUserSeq'] : 0; param['folName'] = param['folName'] ? param['folName'] : 0; param['etc'] = param['etc'] ? param['etc'] : 0; var url = "http://www.somsee.com/inc/member_setHistoryProcess.inc"; var myAjax = new Ajax.Request( url, { method:'post', parameters : { "flag":param['flag'], "kind":param['kind'], "numSong":param['numSong'], "songno":param['songno'], "otherUserSeq":param['otherUserSeq'], "folName":param['folName'], "etc":param['etc'] }, evalScript : true } ); } function expand(element) { var numRow = element.innerText.toString().split(/\n/gmi).length; if (numRow > 6) { element.style.height = (115 + (16 * (numRow - 6))) + "px"; } else { element.style.height = "115px"; } } /* function setTxtBox(element) { if (element.firstChild.nodeName == "INPUT") { return; } var str = element.innerHTML; element.innerHTML = ""; var txtBox = document.createElement("INPUT"); txtBox.className = "input_text2"; txtBox.style.width = "99%"; txtBox.value = str; element.appendChild(txtBox); txtBox.select(); txtBox.focus(); var shadow = document.createElement("DIV"); var pos = Element.cumulativeOffset(element); if (navigator.appVersion.indexOf("MSIE 6") > -1) { pos[1] -= document.body.scrollTop; } // IE 6.0 shadow.style.position = "absolute"; shadow.style.left = (pos[0] - 4) + "px"; shadow.style.top = (pos[1] - 7) + "px"; shadow.style.width = Element.getWidth(element); shadow.style.height = Element.getHeight(element); shadow.style.filter = "progid:DXImageTransform.Microsoft.alpha(opacity=20) progid:DXImageTransform.Microsoft.Blur(pixelradius=4)"; shadow.style.backgroundColor = "#000000"; document.body.appendChild(shadow); element.style.zIndex = "2"; shadow.style.zIndex = "1"; txtBox.onblur = function() { var changedStr = trim(txtBox.value); element.removeChild(txtBox); document.body.removeChild(shadow); element.innerHTML = changedStr; } } */ function setTxtBox(element, strElement, nextElement, txtOption, shadowOption, callbackFunc) { var str = strElement.innerHTML; strElement.innerHTML = ""; var tWid = 0; var tHeight = 0; var tHPos = 0; var tVPos = 0; try {tWidth = txtOption[0];} catch (e) {} try {tHeight = txtOption[1];} catch (e) {} try {tHPos = txtOption[2];} catch (e) {} try {tVPos = txtOption[3];} catch (e) {} var txtDiv = document.createElement("DIV"); var pos = Element.cumulativeOffset(element); if (navigator.appVersion.indexOf("MSIE 6") > -1) { pos[1] -= document.body.scrollTop; } // IE 6.0 txtDiv.setAttribute("id", "tmpTxtBox"); txtDiv.className = "input_text2"; txtDiv.style.left = (pos[0] + tHPos) + "px"; txtDiv.style.top = (pos[1] + tVPos) + "px"; txtDiv.style.width = (Element.getWidth(element) + tWidth) + "px"; txtDiv.style.height = (Element.getHeight(element) + tHeight) + "px"; txtDiv.style.position = "absolute"; txtDiv.style.backgroundColor = "#FFFFFF"; document.body.appendChild(txtDiv); var txtBox = document.createElement("INPUT"); txtBox.className = "input_text2"; txtBox.style.width = "100%"; txtBox.style.border = "0px"; txtBox.value = str; txtDiv.appendChild(txtBox); txtBox.style.marginTop = (Element.getHeight(txtDiv) - Element.getHeight(txtBox)) / 2 - 2; txtBox.select(); txtBox.focus(); var shadow = document.createElement("DIV"); var sHPos = 0; var sVPos = 0; try {sHPos = shadowOption[0];} catch (e) {} try {sVPos = shadowOption[1];} catch (e) {} var pos = Element.cumulativeOffset(txtDiv); if (navigator.appVersion.indexOf("MSIE 6") > -1) { pos[1] -= document.body.scrollTop; } // IE 6.0 shadow.style.position = "absolute"; shadow.style.left = (pos[0] - 4 + sHPos) + "px"; shadow.style.top = (pos[1] - 7 + sVPos) + "px"; shadow.style.width = Element.getWidth(txtDiv); shadow.style.height = Element.getHeight(txtDiv); shadow.style.filter = "progid:DXImageTransform.Microsoft.alpha(opacity=40) progid:DXImageTransform.Microsoft.Blur(pixelradius=7)"; shadow.style.backgroundColor = "#000000"; document.body.appendChild(shadow); txtDiv.style.zIndex = "2"; shadow.style.zIndex = "1"; txtBox.onkeydown = function() { if (window.event.keyCode == 9 && nextElement) { nextElement.select(); nextElement.focus(); return false; } if (window.event.keyCode == 13) { txtBox.onblur(); return false; } } txtBox.onblur = function() { var changedStr = trim(txtBox.value); document.body.removeChild(txtDiv); document.body.removeChild(shadow); strElement.innerHTML = changedStr; var tmpSetTxtBox = setTxtBox; setTxtBox = function() {} setTimeout (function() { setTxtBox = tmpSetTxtBox; }, 300); try { callbackFunc(element); } catch (e) {} } } function setTxtBox2(element, strElement, txtOption, shadowOption, callbackFunc) { var blurFlag = true; var str = strElement.innerHTML; strElement.innerHTML = ""; var tWid = 0; var tHeight = 0; var tHPos = 0; var tVPos = 0; try {tWidth = txtOption[0];} catch (e) {} try {tHeight = txtOption[1];} catch (e) {} try {tHPos = txtOption[2];} catch (e) {} try {tVPos = txtOption[3];} catch (e) {} var txtDiv = document.createElement("DIV"); var pos = Element.cumulativeOffset(element); if (navigator.appVersion.indexOf("MSIE 6") > -1) { pos[1] -= document.body.scrollTop; } // IE 6.0 txtDiv.setAttribute("id", "tmpTxtBox"); txtDiv.className = "input_text2"; txtDiv.style.left = (pos[0] + tHPos) + "px"; txtDiv.style.top = (pos[1] + tVPos) + "px"; txtDiv.style.width = (Element.getWidth(element) + tWidth) + "px"; txtDiv.style.height = (Element.getHeight(element) + tHeight) + "px"; txtDiv.style.position = "absolute"; txtDiv.style.backgroundColor = "#FFFFFF"; document.body.appendChild(txtDiv); var txtBox = document.createElement("INPUT"); txtBox.className = "input_text2"; txtBox.style.width = "96%"; txtBox.style.marginLeft = "3px"; txtBox.style.border = "0px"; txtBox.value = str; txtDiv.appendChild(txtBox); txtBox.style.marginTop = (Element.getHeight(txtDiv) - Element.getHeight(txtBox)) / 2 - 2; txtBox.select(); txtBox.focus(); var shadow = document.createElement("DIV"); var sHPos = 0; var sVPos = 0; try {sHPos = shadowOption[0];} catch (e) {} try {sVPos = shadowOption[1];} catch (e) {} var pos = Element.cumulativeOffset(txtDiv); shadow.style.position = "absolute"; shadow.style.left = (pos[0] - 4 + sHPos) + "px"; shadow.style.top = (pos[1] - 7 + sVPos) + "px"; shadow.style.width = Element.getWidth(txtDiv); shadow.style.height = Element.getHeight(txtDiv); shadow.style.filter = "progid:DXImageTransform.Microsoft.alpha(opacity=40) progid:DXImageTransform.Microsoft.Blur(pixelradius=7)"; shadow.style.backgroundColor = "#000000"; document.body.appendChild(shadow); txtDiv.style.zIndex = "2"; shadow.style.zIndex = "1"; txtBox.onkeydown = function() { if (window.event.keyCode == 9) { //tab 키 blurFlag = false; var thisElement = this; var changedStr = trim(txtBox.value); document.body.removeChild(txtDiv); document.body.removeChild(shadow); strElement.innerHTML = (changedStr != "") ? changedStr : str; if (str != changedStr && changedStr != "") { try { callbackFunc(element); } catch (e) {} } try { var objTimer = setInterval (function() { try { if (setTxtBox2 != null) { switch (element) { case element.parentNode.childNodes[1]: case element.parentNode.childNodes[2]: element.nextSibling.onclick(); break; case element.parentNode.childNodes[3]: element.parentNode.nextSibling.childNodes[1].onclick(); break; } clearTimeout(objTimer); objTimer = null; } } catch (e) { clearTimeout(objTimer); objTimer = null; } }, 5); } catch(e) {} return false; } if (window.event.keyCode == 27) { //esc 키 document.body.removeChild(txtDiv); document.body.removeChild(shadow); strElement.innerHTML = str; } if (window.event.keyCode == 13) { //enter 키 blurFlag = true; this.onblur(); return false; } if (window.event.keyCode == 38) { //up 키 try { blurFlag = false; var thisElement = this; var changedStr = trim(txtBox.value); document.body.removeChild(txtDiv); document.body.removeChild(shadow); strElement.innerHTML = (changedStr != "") ? changedStr : str; if (str != changedStr && changedStr != "") { try { callbackFunc(element); } catch (e) {} } try { var preRow = element.parentNode.previousSibling; } catch(e) { blurFlag = true; thisElement.blur(); } var index = 1; switch (element) { case element.parentNode.childNodes[1]: index = 1; break; case element.parentNode.childNodes[2]: index = 2; break; case element.parentNode.childNodes[3]: index = 3; break; } if (preRow.className != "chart1_title") { var objTimer = setInterval( function() { try { if (setTxtBox2 != null) { preRow.childNodes[index].onclick(); clearTimeout(objTimer); objTimer = null; } } catch (e) { clearTimeout(objTimer); objTimer = null; } }, 5); } } catch (e) { blurFlag = true; this.blur(); } return false; } if (window.event.keyCode == 40) { //down 키 try { blurFlag = false; var thisElement = this; var changedStr = trim(txtBox.value); document.body.removeChild(txtDiv); document.body.removeChild(shadow); strElement.innerHTML = (changedStr != "") ? changedStr : str; if (str != changedStr && changedStr != "") { try { callbackFunc(element); } catch (e) {} } try { var nextRow = element.parentNode.nextSibling; } catch(e) { blurFlag = true; thisElement.blur(); } var index = 1; switch (element) { case element.parentNode.childNodes[1]: index = 1; break; case element.parentNode.childNodes[2]: index = 2; break; case element.parentNode.childNodes[3]: index = 3; break; } var objTimer = setInterval( function() { try { if (setTxtBox2 != null) { nextRow.childNodes[index].onclick(); clearTimeout(objTimer); objTimer = null; } } catch (e) { clearTimeout(objTimer); objTimer = null; } }, 5); } catch (e) { blurFlag = true; this.blur(); } return false; } } txtBox.onblur = function() { if (!blurFlag) return; var changedStr = trim(txtBox.value); document.body.removeChild(txtDiv); document.body.removeChild(shadow); strElement.innerHTML = changedStr; var tmpSetTxtBox = setTxtBox2; setTxtBox2 = function() {}; setTimeout (function() { setTxtBox2 = tmpSetTxtBox; }, 300); if (str == changedStr) { return; } try { callbackFunc(element); } catch (e) {} } } function reDefineShiftTabKey(element, targetElement) { if (window.event.shiftKey && window.event.keyCode == 9) { targetElement.onclick(); return false; } } //선택된 객체 바로 다음에 객체 삽입 function insertAfter(newElement, targetElement) { var parent = targetElement.parentNode; if (parent.lastChild == targetElement) { parent.appendChild(newElement); } else { parent.insertBefore(newElement, targetElement.nextSibling); } return newElement; } { //class Layer function Layer(option) { this.mo_layer = null; this.mo_shadow = null; if (option == "duplication") { this.ms_option = option; } else { this.ms_option = "unique"; } this.preprocess(); } Layer.prototype = { preprocess: function() { if (this.ms_option == "unique") { try { document.getElementById("createdTempLayer").parentNode.removeChild(document.getElementById("createdTempLayer").nextSibling); } catch(e) {} try { document.getElementById("createdTempLayer").parentNode.removeChild(document.getElementById("createdTempLayer")); } catch(e) {} } this.mo_layer = document.createElement("DIV"); if (this.ms_option == "unique") {this.mo_layer.setAttribute("id", "createdTempLayer")} this.mo_layer.style.position = "absolute"; this.mo_layer.style.left = 0; this.mo_layer.style.top = 0; this.mo_layer.style.width = "auto"; this.mo_layer.style.height = "auto"; this.mo_layer.style.zIndex = "3000"; this.mo_layer.style.backgroundColor = "#FFFFFF"; document.body.appendChild(this.mo_layer); }, setShadow: function() { this.mo_shadow = document.createElement("DIV"); var pos = Element.cumulativeOffset(this.mo_layer); //if (navigator.appVersion.indexOf("MSIE 6") > -1) { pos[1] -= document.body.scrollTop; } // IE 6.0 this.mo_shadow.style.zIndex = "2999"; this.mo_shadow.style.backgroundColor = "#000000"; this.mo_shadow.style.filter = " progid:DXImageTransform.Microsoft.alpha(opacity=30) progid:DXImageTransform.Microsoft.Blur(pixelradius=4)"; this.mo_shadow.style.position = "absolute"; this.mo_shadow.style.left = (pos[0] - 4) + "px"; this.mo_shadow.style.top = (pos[1] - 3) + "px"; this.mo_shadow.style.width = (Element.getWidth(this.mo_layer) + 6) + "px"; this.mo_shadow.style.height = (Element.getHeight(this.mo_layer) + 6) + "px"; document.body.appendChild(this.mo_shadow); }, setPosition: function() { this.mo_layer.style.left = (document.documentElement.clientWidth / 2) + document.documentElement.scrollLeft - (Element.getWidth(this.mo_layer) / 2) ; this.mo_layer.style.top = (document.documentElement.clientHeight / 2) + document.documentElement.scrollTop - (Element.getHeight(this.mo_layer) / 2) ; }, setTargetPosition: function(element) { var pos = Element.cumulativeOffset(element); if (navigator.appVersion.indexOf("MSIE 6") > -1) { pos[1] -= document.body.scrollTop; } // IE 6.0 var width = Element.getWidth(element); this.mo_layer.style.left = ( pos[0] + (width / 2) - (Element.getWidth(this.mo_layer) / 2) ) + "px" ; this.mo_layer.style.top = pos[1] + "px"; }, getElement: function() { return this.mo_layer; }, closeElement: function() { try { document.body.removeChild(this.mo_layer); } catch(e) {} try { document.body.removeChild(this.mo_shadow); } catch(e) {} } } } //플레이어 열기 function openPlayer(list, style, boxSeq) { var numSong = 0; if (boxSeq >= 0) boxSeq = -1; //재생 곡 별 권한 설정으로 고정 //랜덤 듣기(곡 섞기) if (style == "rnd") { var resultList = new Array(); var tmpList = list.split(","); while(tmpList.length) { var rndIndex = Math.floor(Math.random() * 10000) % tmpList.length; resultList.push(tmpList[rndIndex]); tmpList = tmpList.without(tmpList[rndIndex]); } list = ""; for (var i=0; i -1) { pos[1] -= document.body.scrollTop; } // IE 6.0 rqstLayer.getElement().style.width = "350px"; rqstLayer.getElement().style.height = "94px"; rqstLayer.getElement().style.border = "1px solid #C44977"; rqstLayer.getElement().style.fontFamily = "verdana, gulim"; rqstLayer.getElement().style.fontSize = "12px"; rqstLayer.getElement().style.color = "#676767"; rqstLayer.setPosition(); //rqstLayer.setTargetPosition(document.getElementById("songList")); //new Draggable(rqstLayer.getElement(), {endeffect: function() {}}); rqstLayer.setShadow(); var rqstTitle = document.createElement("DIV"); rqstTitle.style.width = "350px"; rqstTitle.style.height = "25px"; rqstTitle.innerHTML = '
친구 신청
' + '
r
'; rqstTitle.style.filter = "progid:DXImageTransform.Microsoft.gradient(StartColorStr=#FFC44979,EndColorStr=#FFA33D65,GradientType=0)"; rqstLayer.getElement().appendChild(rqstTitle); var content = document.createElement("DIV"); content.style.padding = "10px 10px 10px 10px"; content.innerHTML = '
' + _pageName + '님과의 관계를 입력해 주세요.
' + '' + ''; rqstLayer.getElement().appendChild(content); content.childNodes[1].select(); content.childNodes[1].focus(); content.lastChild.onclick = function() { var url = "http://www.somsee.com/inc/rqstFriend.inc"; var myAjax = new Ajax.Request ( url, { method:'post', parameters : { "relation": this.previousSibling.value, "memberSeq": _pageSeq }, evalScript : true, onComplete : function() { clearLayer(); var objMsgBox = new MsgBox(); objMsgBox.setMessage(_pageName + "님을 친구로 신청 했습니다."); objMsgBox.create(); var param = new Array(); param['flag'] = 4; //친구 4 param['kind'] = 2; //친구 신청 param['otherUserSeq'] = _pageSeq; mh_setHistory(param); window.location.reload(); } } ); } } //파일 업로드 function upLoadFile(folSeq) { if (navigator.appVersion.indexOf('MSIE 7') > -1) { window.open('http://www.somsee.com/updown/upload.mog?fseq=' + folSeq, 'stepup', 'width=840,height=600,status=yes,scrollbar=no'); } else { window.open('http://www.somsee.com/updown/upload.mog?fseq=' + folSeq, 'stepup', 'width=840,height=625,status=yes,scrollbar=no'); } } //CD RIP function cdRip(folSeq) { window.open( 'http://www.somsee.com/updown/?type=rip&folder='+folSeq, 'pop', 'width=600,height=553,status=yes,scrollbar=no' ); } //알람창 확장 function moreAlarm(element) { var alarmLayer = document.getElementById("alarm"); if (element.getAttribute("type") == "more") { var pos = Element.cumulativeOffset(alarmLayer); alarmLayer.style.position = "absolute"; alarmLayer.style.left = pos[0]; alarmLayer.style.top = pos[1] - 6; alarmLayer.style.height = "auto"; element.setAttribute("type", "hide"); element.firstChild.nodeValue = "감추기"; element.lastChild.innerHTML = "5"; } else { alarmLayer.style.position = "static"; alarmLayer.style.left = "auto"; alarmLayer.style.top = "auto"; alarmLayer.style.height = "21px"; element.setAttribute("type", "more"); element.firstChild.nodeValue = "더보기"; element.lastChild.innerHTML = "6"; } } //알림창 닫기 function releaseAlarm(type, link) { var url = "http://www.somsee.com/inc/alarmRelease.inc"; var myAjax = new Ajax.Request ( url, { method:'post', parameters : {"type": type}, evalScript : true, onComplete : function() { if (link) window.location.href = link; else removeNode(document.getElementById("alarm")); } } ); } //쪽지 보내기 layer function sendSlippaperLayer(seq, id, name, target) { if (!_userSeq) { openLoginBox(); return; } clearLayer(); var slipLayer = new Layer(); var pos = Element.cumulativeOffset(document.getElementById("songList")); if (navigator.appVersion.indexOf("MSIE 6") > -1) { pos[1] -= document.body.scrollTop; } // IE 6.0 slipLayer.getElement().style.width = "450px"; slipLayer.getElement().style.height = "251px"; slipLayer.getElement().style.border = "1px solid #C44977"; slipLayer.getElement().style.fontFamily = "verdana, gulim"; slipLayer.getElement().style.fontSize = "12px"; slipLayer.getElement().style.color = "#676767"; slipLayer.setTargetPosition(target); slipLayer.getElement().style.left = (Element.cumulativeOffset(slipLayer.getElement())[0] + 225) + "px"; //new Draggable(treeLayer.getElement(), {endeffect: function() {}}); slipLayer.setShadow(); var slipTitle = document.createElement("DIV"); slipTitle.style.width = "450px"; slipTitle.style.height = "25px"; slipTitle.innerHTML = '
' + '
쪽지보내기
' + '
' + '
r
'; slipTitle.style.filter = "progid:DXImageTransform.Microsoft.gradient(StartColorStr=#FFC44979,EndColorStr=#FFA33D65,GradientType=0)"; slipLayer.getElement().appendChild(slipTitle); var contLayer = document.createElement("DIV"); contLayer.setAttribute("id", "slipCont"); contLayer.style.width = "430px"; contLayer.style.height = "206px"; contLayer.style.padding = "10px 10px 10px 10px"; slipLayer.getElement().appendChild(contLayer); var url = "http://www.somsee.com/slippaper/inc/sendForm.inc"; var myAjax = new Ajax.Updater ( {success : contLayer}, url, { method:'post', parameters : { "id": id, "name": name }, evalScript : true, onComplete : function() { document.getElementById("slipTitle").focus(); document.getElementById("slipSend").onclick = function() { sendSlippaper(seq, id); } } } ); } //쪽지 보내기 function sendSlippaper(seq, id) { var txtTitle = document.getElementById("slipTitle"); var txtContent = document.getElementById("slipContent"); var title = trim(txtTitle.value); var content = trim(txtContent.innerText); if (title == "") { var msgBox = new MsgBox(); msgBox.setMessage("제목을 입력하세요."); msgBox.setEvent(function() { txtTitle.select(); txtTitle.focus(); }); msgBox.create(); } else if (content == "") { var msgBox = new MsgBox(); msgBox.setMessage("내용을 입력하세요."); msgBox.setEvent(function() { txtContent.select(); txtContent.focus(); }); msgBox.create(); } else { var url = "http://www.somsee.com/slippaper/inc/process.inc"; var myAjax = new Ajax.Request( url, { method:'post', parameters : { "takeSeq":seq, "title":title, "content":content, "reSlipSeq":0, "reSongSeq":0, "flag":"send" }, evalScript : true, onComplete : function() { var param = new Array(); param['flag'] = 7; //쪽지 7 param['otherUserSeq'] = seq; mh_setHistory(param); var msgBox = new MsgBox(); msgBox.setMessage("쪽지를 보냈습니다."); msgBox.setEvent(function() { clearLayer(); }); msgBox.create(); var url = "http://www.somsee.com/slippaper/inc/sendMail.inc"; var myAjax = new Ajax.Request( url, { method:'post', parameters : { "takeSeq":tSeq, "title":title, "content":content }, evalScript : true, onComplete : function() { } } ); } } ); } } //조르기 function coax(flag) { //flag: 친구 신청 여부 (true: 친구신청O, false: 친구신청X) clearLayer(); var treeLayer = new Layer(); var msg = "Top 10을 요청 하였습니다."; if (flag) { msg = "친구 신청 및 " + msg; } try { //메인 TOP 10 조르기 var songs = document.getElementById("main_top10").childNodes[1]; var list = ""; while (songs) { try { var songname = songs.childNodes[3].firstChild.firstChild.nodeValue; var artistname = songs.childNodes[4].firstChild.firstChild.nodeValue; if (list != "") list += "$$"; list += songs.getAttribute("seq") + "||" + songname + "||" + artistname; } catch(e) {} songs = songs.nextSibling; } } catch (e) { //곡 목록, 선택 조르기 var songs = document.getElementById("songList").childNodes[1].childNodes[1]; var list = ""; while (songs) { try { if (!songs.firstChild.firstChild.checked) { songs = songs.nextSibling; continue; } try { var songname = songs.childNodes[1].firstChild.firstChild.nodeValue; var artistname = songs.childNodes[3].firstChild.firstChild.nodeValue; var albumname = songs.childNodes[2].firstChild.firstChild.nodeValue; } catch(e) { var songname = songs.childNodes[2].firstChild.firstChild.nodeValue; var artistname = songs.getAttribute("artistname"); var albumname = songs.getAttribute("albumname"); } if (list != "") list += "$$"; list += songs.getAttribute("mysongseq") + "||" + songname + "||" + artistname + "||" + songs.getAttribute("albumno") + "||" + albumname + "||" + (_defaultOpenFolder ? _defaultOpenFolder : 0); } catch(e) {} songs = songs.nextSibling; } msg = _pageName + "님께 곡을 요청 하였습니다."; } if (trim(list) == "") { var objMsgBox = new MsgBox(); objMsgBox.setMessage("선택된 항목이 없습니다."); objMsgBox.create(); return; } //var pos = Element.cumulativeOffset(element); treeLayer.getElement().style.width = "350px"; treeLayer.getElement().style.height = "166px"; treeLayer.getElement().style.border = "1px solid #C44977"; treeLayer.getElement().style.fontFamily = "verdana, gulim"; treeLayer.getElement().style.fontSize = "12px"; treeLayer.getElement().style.color = "#676767"; treeLayer.setPosition(); treeLayer.setShadow(); var treeTitle = document.createElement("DIV"); treeTitle.style.width = "350px"; treeTitle.style.height = "25px"; treeTitle.innerHTML = '
조르기
' + '
r
'; treeTitle.style.filter = "progid:DXImageTransform.Microsoft.gradient(StartColorStr=#FFC44979,EndColorStr=#FFA33D65,GradientType=0)"; treeLayer.getElement().appendChild(treeTitle); var content = document.createElement("DIV"); content.style.padding = "10px 10px 10px 10px"; content.innerHTML = '
요청 메시지를 입력하세요.
' + ''; if (flag) { content.innerHTML += '
- 조르기를 하시면 자동으로 친구 신청이 됩니다.
'; } content.innerHTML += ''; treeLayer.getElement().appendChild(content); content.childNodes[1].focus(); } //조르기 _ 쪽지 보내기 function coax_send(flag, list, msg) { //flag: 친구 신청 여부 (true: 친구신청O, false: 친구신청X) if (flag) { var url = "http://www.somsee.com/inc/rqstFriend.inc"; var myAjax = new Ajax.Request( url, { method:'post', parameters : { "memberSeq": _pageSeq, "relation": "" }, evalScript : true, onComplete : function() { } } ); } var url = "http://www.somsee.com/inc/rqstSong.inc"; var myAjax = new Ajax.Request( url, { method:'post', parameters : { "user": _pageSeq, "list": list, "message": trim(document.getElementById("coax_message").innerText) }, evalScript : true, onComplete : function() { clearLayer(); var objMsgBox = new MsgBox(); objMsgBox.setMessage(msg); objMsgBox.create(); return; } } ); } //친구에게 곡 보내기 function sendMusic(method) { try { var friends = document.getElementById("selFriend_fList").firstChild; var list = ""; while (friends) { if (friends.firstChild.checked) { if (list != "") list += ","; list += friends.getAttribute("seq"); } friends = friends.nextSibling; } } catch (e) {} var songs = document.getElementById("songList").childNodes[1].firstChild; var infoText = ""; while (songs) { try { if (songs.firstChild.firstChild.checked) { if (infoText != "") infoText += "$$"; try { var songName = trim(songs.childNodes[1].firstChild.firstChild.nodeValue.replace(/\ \;/g, "")); } catch(e) { var songName = ""; } try { var albumName = trim(songs.childNodes[2].firstChild.firstChild.nodeValue.replace(/\ \;/g, "")); } catch(e) { var albumName = ""; } try { var artistName = trim(songs.childNodes[3].firstChild.firstChild.nodeValue.replace(/\ \;/g, "")); } catch(e) { var artistName = ""; } if (songs.getAttribute("mysongseq")) { infoText += songs.getAttribute("mysongseq") + "||" + songName + "||" + artistName + "||" + songs.getAttribute("albumno") + "||" + albumName + "||" + _defaultOpenFolder; } } } catch(e) {} songs = songs.nextSibling; } if (infoText == "") { var objMsgBox = new MsgBox(); objMsgBox.setMessage("선택된 항목이 없습니다."); objMsgBox.create(); return; } var layer = new Layer(); layer.getElement().style.display = "none"; layer.getElement().style.width = "430px"; var url = "http://www.somsee.com/toolbar/send_friendList.inc"; var myAjax = new Ajax.Updater( {success : layer.getElement()}, url, { method:'post', parameters : { "sort": method, "chkList": list }, evalScript : true, onComplete : function() { layer.setPosition(); layer.getElement().style.display = "block"; layer.setShadow(); document.getElementById("btn_sendMusic").onclick = function() { try { //선택된 친구 목록 var friends = document.getElementById("selFriend_fList").firstChild; var userList = ""; while (friends) { if (friends.firstChild.checked) { if (userList != "") userList += ","; userList += friends.getAttribute("seq"); } friends = friends.nextSibling; } } catch (e) {} if (userList == "") { var objMsgBox = new MsgBox(); objMsgBox.setMessage("친구를 선택하세요."); objMsgBox.create(); return; } var message = ""; if (document.getElementById("selFriend_message").getAttribute("setMsg") == "true") { message = trim(document.getElementById("selFriend_message").innerText); } var url = "http://www.somsee.com/toolbar/send_sendFile.inc"; var myAjax = new Ajax.Request( url, { method:'post', parameters : { "userList": userList, "songList": infoText, "message": message }, evalScript : true, onComplete : function() { clearLayer(); var objMsgBox = new MsgBox(); objMsgBox.setMessage("해당 친구들에게 선택한 곡을 보냈습니다."); objMsgBox.create(); return; } } ); } } } ); } //내 솜씨, 내 친구 곡 검색 function searchSong() { var txtBox = document.getElementById("searchTxt"); var loc = "http://www.somsee.com/music/search.mog?keyword=" + encodeURI(txtBox.value) + "&searchType=" + txtBox.getAttribute("t"); if (_userParam) { loc += "&" + _userParam; } window.location.href = loc; } //검색 옵션 펼침 메뉴 function searchOption(target) { clearLayer(); var subMenu = new Layer(); //서브 메뉴 DIV var menu = document.createElement("DIV"); menu.style.fontFamily = "verdana, gulim"; menu.style.fontSize = "12px"; menu.style.color = "#676767"; menu.style.width = "82px"; menu.style.borderLeft = "1px solid #ABABAB"; menu.style.borderRight = "1px solid #ABABAB"; menu.style.padding = "3px"; menu.style.paddingTop = "0px"; menu.style.backgroundColor = "#FFFFFF"; //top border var topBorder = document.createElement("DIV"); topBorder.style.width = "59px"; topBorder.style.height = "1px"; topBorder.style.marginTop = "-1px"; topBorder.style.marginLeft = "29px"; topBorder.style.fontSize = "1px"; //topBorder.style.styleFloat = "right"; topBorder.style.borderBottom = "1px solid #ABABAB"; subMenu.getElement().appendChild(topBorder); //top border2 var topBorder2 = document.createElement("DIV"); topBorder2.style.width = "59px"; topBorder2.style.height = "1px"; topBorder2.style.marginLeft = "29px"; topBorder2.style.fontSize = "1px"; //topBorder2.style.styleFloat = "right"; topBorder2.style.clear = "both"; topBorder2.style.borderRight = "1px solid #ABABAB"; topBorder2.style.backgroundColor = "#FFFFFF"; subMenu.getElement().appendChild(topBorder2); //서브 메뉴 설정 var sMenu = new Array(); //폴더편집 메뉴 sMenu.push(document.createElement("DIV")); sMenu.push(document.createElement("DIV")); sMenu[0].style.marginTop = "5px"; for (var i in sMenu) { if (!isNaN(i)) { var eventClick = null; switch (parseInt(i)) { default: case 0: sMenu[i].innerHTML = "내 솜씨 검색"; eventClick = function() { target.nextSibling.firstChild.firstChild.nodeValue = "내 솜씨"; document.getElementById("searchTxt").setAttribute("t", "M"); } break; case 1: sMenu[i].innerHTML = "내 친구 검색"; eventClick = function() { target.nextSibling.firstChild.firstChild.nodeValue = "내 친구"; document.getElementById("searchTxt").setAttribute("t", "F"); } break; } sMenu[i].style.padding = "1px"; sMenu[i].style.paddingTop = "4px"; sMenu[i].style.cursor = "pointer"; sMenu[i].style.width = "80px"; sMenu[i].style.height = "15px"; sMenu[i].onmouseover = function() { this.style.color = "#232323"; this.style.backgroundColor = "#E4E4E4"; } sMenu[i].onmouseout = function() { this.style.color = "#676767"; this.style.backgroundColor = "#FFFFFF"; } sMenu[i].onclick = eventClick; menu.appendChild(sMenu[i]); } } subMenu.getElement().appendChild(menu); subMenu.setTargetPosition(target); subMenu.getElement().style.left = Element.cumulativeOffset(subMenu.getElement())[0] + 31; subMenu.getElement().style.top = Element.cumulativeOffset(subMenu.getElement())[1] + 12; //서브 메뉴 bottom var bot1 = document.createElement("DIV"); bot1.style.clear = "both"; bot1.style.width = "86px"; bot1.style.height = "1px"; bot1.style.fontSize = "1px"; bot1.style.borderLeft = "1px solid #ABABAB"; bot1.style.borderRight = "1px solid #ABABAB"; bot1.style.marginLeft = "1px"; bot1.style.backgroundColor = "#FFFFFF"; subMenu.getElement().appendChild(bot1); var bot2 = document.createElement("DIV"); bot2.style.clear = "both"; bot2.style.width = "86px"; bot2.style.height = "0px"; bot2.style.fontSize = "1px"; bot2.style.borderTop = "1px solid #ABABAB"; bot2.style.marginLeft = "2px"; subMenu.getElement().appendChild(bot2); subMenu.getElement().style.backgroundColor = "transparent"; subMenu.setShadow(); subMenu.getElement().nextSibling.style.top = Element.cumulativeOffset(subMenu.getElement())[1] + 2; subMenu.getElement().nextSibling.style.height = Element.getHeight(subMenu.getElement()) + 1; //팝업 레이어 겹침 배제 subMenu.getElement().setAttribute("flag", "menu"); //서브 메뉴 닫힘 subMenu.getElement().focus(); subMenu.getElement().onblur = function() { setTimeout (function() { if (document.getElementById("createdTempLayer").getAttribute("flag") == "menu") { clearLayer(); } }, 100); } }