var couponDownBtn = false;
var resolution_h = screen.height;
var openHeight = resolution_h - 100;
function bbsReload(){
var thisLocation = location.href;
makeForm(thisLocation,'_self','idx〓'+thisBBsIdx);
}
//구매목록 검색
function tryDown(idx,cash,adult,type){
if(!GetCookie('sUserInfo')){
alert('로그인 후 이용하실 수 있습니다. ');
return false;
}
if(adult==1 && GetCookie('adult')!=1) {
alert('성인 컨텐츠는 성인인증 후 다운 받으실 수 있습니다. ');
//openWin('./adult.php','adultCheck','300',180','no');
}
sendRequest(returnPurchaseCheck,'&act=ok&idx='+idx+'&cash='+cash+'&adult='+adult+'&type='+type,'POST','/models/common/main/module/purchaseCheck.php',true,true);
}
//구매목록 검색리턴
function returnPurchaseCheck(oj){
var res = decodeURIComponent(oj.responseText);
var split_res = res.split('|');
if(split_res[0]=='_exist'){
if(confirm('이미 구매한 컨텐츠입니다. 구매목록으로 이동하시겠습니까? ')){
opener.location.href='mypage.php?act=purchase';
window.self.close();
}
}else{
if(split_res[4]=='cash'){
normalSpeedDownload(split_res[1],split_res[2],split_res[3]);
}else if(split_res[4]=='coupon'){
downTryCoupon(split_res[1],split_res[2],split_res[3]);
}
}
}
function fnMoney(val){
var num = val;
try
{
while((/(-?[0-9]+)([0-9]{3})/).test(num)) {
num = num.replace((/(-?[0-9]+)([0-9]{3})/), "$1,$2");
}
}
catch(e) { num = val;}
return num;
}
function setDefaultVars(idx, cash, adult, pay_type, speed_type, purchase_idx, down_flag, file_list, sale_view){
this.bbs_idx = idx;
this.buy_cash = cash;
this.adult = adult;
this.pay_type = pay_type;
this.speed_type = speed_type;
this.purchase_idx = purchase_idx;
this.down_flag = down_flag;
this.file_list = file_list;
this.streaming = this.streaming; this.ces_encode = this.ces_encode;
this.sale_view = sale_view;
this.bChecksubmit = 0;
}
function funcContentsDownload(idx, cash, adult, pay_type, speed_type, purchase_idx, down_flag, file_list, contents_idx, noaccount, down_event, sale_view, folder) {
if( this.streaming != 1 && (jQuery.browser.msie || (/Trident\/7\./).test(navigator.userAgent))) {
if ( window.navigator.platform != "win32" && window.navigator.cpuClass != "x86" ) {
} else {
//if(chkDownApp(noaccount) == false) {
//
// //alert('어플 설치');
// return;
//
//}
}
}
if(this.bChecksubmit > 0) {
alert('이미 컨텐츠 구매중입니다. 잠시만 기다려주세요');
return;
}
// 변수 셋팅
setDefaultVars(idx, cash, adult, pay_type, speed_type, purchase_idx, down_flag, file_list, sale_view, folder);
// 다운로드 시 필요한 파라미터
var query_string = 'act=ok&idx='+this.bbs_idx+'&type='+pay_type+'&purchase_idx='+this.purchase_idx+'&down_flag='+this.down_flag+'&file_list='+this.file_list+'&speed_type='+this.speed_type;
query_string += '&sale_view='+sale_view+'&folder='+folder;
//prompt("1_ban=>",query_string);
//ces서비스
if( this.ces_encode == 1 || this.ces_encode == 2 || this.ces_encode == 3 ) {
query_string +="&ces=1";
this.ces_encode = 0;
}
var cashCmn = parseInt(GetCookie('cmn_cash'),10);
var cashBns = parseInt(GetCookie('bns_cash'),10);
var cashTotal = cashCmn + cashBns;
if(pay_type == 5) {
if(this.streaming == 1) {
alert('오픈자료실은 스트리밍서비스가 지원되지 않습니다');
return;
} else {
this.bChecksubmit = 1;
fnShowLayer('block');
sendRequest(doDownloadPorcess, query_string+"&use_point=0",'POST','/models/common/main/module/bbsDownTry_new_file.php',true,true);
return;
}
}
if(pay_type == 7){
//console.log(query_string); return;
sendRequest(doDownloadPorcess, query_string+"&use_point=0",'POST','/models/common/main/module/bbsDownTry_new_file_coupon.php',true,true);
return;
}
// 스트리밍 이용시
if(this.streaming == 1) {
if(!GetCookie('sUserInfo') && noaccount!='freedownspeedlow') {
jQuery(".pop_dim").fadeTo("fast",0.6);
openloginpopup('mfilebbs');
return false;
}
query_string += "&stm=1";
}
if(noaccount == 'freedownspeedlow') {
sendRequest(doDownloadSpeedLowPorcess, query_string+"&use_point=0",'POST','/models/common/main/module/bbs_freedown_speed_low.php',true,true);
return;
}
if(down_event || down_event == '0') {
if(down_event == 100) {
down_event_alert = '무료';
} else if(down_event == '0') {
down_event_alert = '가격지원';
} else {
down_event_alert = down_event + "%할인";
}
if(confirm(down_event_alert + " 이벤트 컨텐츠 입니다.\n내려받기 하시겠습니까?") == true) {
this.bChecksubmit = 1;
fnShowLayer('block');
sendRequest(doDownloadPorcess, query_string,'POST','/models/common/main/module/bbsDownTry_new_file.php',true,true);
return;
}
return;
}
if(GetCookie('ration')) {
if (contents_idx > 0 && purchase_idx == '') {
this.bChecksubmit = 1;
fnShowLayer('block');
sendRequest(doDownloadPorcess, query_string+"&use_point=0",'POST','/models/common/main/module/bbsDownTry_new_file.php',true,true);
return;
} else if(contents_idx > 0 && purchase_idx == '') {
if(confirm("해당 컨텐츠는 정액제로 구매하실수 없습니다.\r\n포인트로 구매하시겠습니까1?") == true) {
this.bChecksubmit = 1;
fnShowLayer('block');
sendRequest(doDownloadPorcess, query_string+"&use_point=1",'POST','/models/common/main/module/bbsDownTry_new_file.php',true,true);
return;
}
} else {
//alert(query_string+'_ration'); return;
this.bChecksubmit = 1;
fnShowLayer('block');
sendRequest(doDownloadPorcess, query_string+"&use_point=0",'POST','/models/common/main/module/bbsDownTry_new_file.php',true,true);
return;
}
} else {
if(purchase_idx != '' && file_list == '') {
//alert(query_string+"_purchase"); return;
this.bChecksubmit = 1;
fnShowLayer('block');
sendRequest(doDownloadPorcess, query_string+"&use_point=0",'POST','/models/common/main/module/bbsDownTry_new_file.php',true,true);
return;
} else {
var checkCash = ( contents_idx > 0 ) ? cashCmn : cashTotal;
if(checkCash >= this.buy_cash) {
this.bChecksubmit = 1;
fnShowLayer('block');
sendRequest(doDownloadPorcess, query_string,'POST','/models/common/main/module/bbsDownTry_new_file.php',true,true);
return;
} else {
this.bChecksubmit = 1;
fnShowLayer('block');
sendRequest(doDownloadPorcess, query_string,'POST','/models/common/main/module/bbsDownTry_new_file.php',true,true);
return;
}
}
}
}
function doDownEventProcess(oj){
var res = decodeURIComponent(oj.responseText);
var split_res = res.split('|');
//alert(res);
return false;
}
// 컨텐츠 다운로드 Ajax 리턴 처리.
function doDownloadPorcess(oj) {
var res = decodeURIComponent(oj.responseText);
//console.log(res);
//return;
//prompt('p_doDownloadPorcess',res);
var split_res = res.split('|');
couponDownBtn = false;
if(split_res[0] == '_poingMsg') {
if(confirm(split_res[1])) {
var query_string = 'act=ok&idx='+this.bbs_idx+'&type='+this.pay_type+'&purchase_idx='+this.purchase_idx+'&down_flag='+this.down_flag+'&file_list='+this.file_list+'&speed_type='+this.speed_type;
query_string += '&sale_view='+this.sale_view;
// 스트리밍 이용시
if(this.streaming == 1) {
query_string += "&stm=1";
}
sendRequest(doDownloadPorcess, query_string+"&use_point=1",'POST','/models/common/main/module/bbsDownTry_new_file.php',true,true);
} else {
this.bChecksubmit = 0;
fnShowLayer('none');
return;
}
}
if(split_res[0] == '_noFileIn') {
if(confirm("해당 컨텐츠의 특정 파일은 제휴사 정책에 따라 24시간 이내 3회만 다시받기가 가능합니다.")) {
var query_string = 'act=ok&idx='+this.bbs_idx+'&type='+this.pay_type+'&purchase_idx='+this.purchase_idx+'&down_flag='+this.down_flag+'&file_list='+this.file_list+'&speed_type='+this.speed_type;
query_string += '&sale_view='+this.sale_view;
// 스트리밍 이용시
if(this.streaming == 1) {
query_string += "&stm=1";
}
sendRequest(doDownloadPorcess, query_string+"&use_filein=1",'POST','/models/common/main/module/bbsDownTry_new_file.php',true,true);
} else {
this.bChecksubmit = 0;
fnShowLayer('none');
return;
}
}
if(split_res[0]=='_logindup'){
alert('다른 곳에서 접속하여 로그아웃 되었습니다.');
opener.location.reload();
self.close();
return;
}
if(split_res[0]=='_nopurchase'){
alert('구매 기간이 만료 되었습니다. ');
document.location.reload();
return;
}
if(split_res[0]=='_purchase') {
if(confirm('이미 구매한 컨텐츠입니다. 구매목록으로 이동하시겠습니까? ')){
opener.location.href='mypage.php?act=purchase';
window.self.close();
}
}
if(split_res[0]=='_video'){
this.bChecksubmit = 0;
fnShowLayer('none');
alert('저작권파일이 포함되어 있는 컨텐츠는 다운로드 되지 않습니다 . ');
return;
}
if(split_res[0]=='_deny_filefiltering'){
this.bChecksubmit = 0;
fnShowLayer('none');
alert('파일 금칙어가 포함되어 있는 컨텐츠는 다운로드 되지 않습니다 . ');
return;
}
if(split_res[0]=='_cannotstreaming') {
this.bChecksubmit = 0;
fnShowLayer('none');
alert('바로보기를 하실 수 없는 파일이 포함 되어 있습니다.');
this.streaming = 0; // 스트리밍 사용안함
return;
}
if(split_res[0]=='_nomem') {
this.bChecksubmit = 0;
try{
jQuery(".pop_dim").fadeTo("fast",0.6);
if(loginRtnUrl == undefined || loginRtnUrl == '') {
openloginpopup('normal','');
} else {
openloginpopup('normal',loginRtnUrl);
}
} catch(e) {
alert('회원님의 상태 정보가 정상적이지 않습니다. 재로그인 해주세요.');
opener.location.href='/models/common/main/login/logout.php';
window.self.close();
}
fnShowLayer('none');
}
if(split_res[0]=='_noconnect'){
this.bChecksubmit = 0;
fnShowLayer('none');
alert('다운로드 정보가 정상적이지 않습니다.\r\n내려받기를 다시 시도해 주세요.');
return;
}
if(split_res[0]=='_error'){
this.bChecksubmit = 0;
fnShowLayer('none');
alert('다운로드 정보가 정상적이지 않습니다.\r\n내려받기를 다시 시도해 주세요.');
return;
}
if(split_res[0]=='_error1'){
this.bChecksubmit = 0;
fnShowLayer('none');
alert('무료 이벤트 대상 컨텐츠가 아닙니다.');
return;
}
if(split_res[0]=='_error2'){
this.bChecksubmit = 0;
fnShowLayer('none');
alert('무료컨텐츠는 결제내역이 있는 회원만 이용 가능합니다.\r\n요금충전 페이지로 이동하시겠습니까?');
opener.location='/charge.php';
opener.focus();
return;
}
if(split_res[0]=='_bcast_nkip'){
try { __foreign_ip.open(); }
catch(e) { alert('지상파 방송3사와의 협약에 의해 해외에서는 해당 컨텐츠를 다운로드 받으실 수 없습니다.\n이용에 불편을 드려 죄송합니다'); }
return;
}
if(split_res[0]=='_expire') {
this.bChecksubmit = 0;
fnShowLayer('none');
alert('만료된 컨텐츠입니다. ');
return;
}
if(split_res[0]=='_down_deny') {
this.bChecksubmit = 0;
fnShowLayer('none');
alert('판매자의 요청에 의해서 해당 컨텐츠의 내려받기를 하실 수 없습니다.');
return;
}
if(split_res[0]=='_down_cnt') {
this.bChecksubmit = 0;
fnShowLayer('none');
alert('100원이벤트 사용시 성인컨텐츠는 일제한으로 1일 5회만 다운로드가능합니다. ');
return;
}
if(split_res[0]=='_adult_down_cnt') {
this.bChecksubmit = 0;
fnShowLayer('none');
alert('짧은 시간 컨텐츠이용이 많을시에는 트래픽증가로 인해 다운로드가 안될수도있습니다. 잠시후 이용해주시기 바랍니다. ');
return;
}
if(split_res[0]=='restrain'){
this.bChecksubmit = 0;
fnShowLayer('none');
alert('회원님의 제재로 인해 다운로드를 하실 수 없습니다. ');
return;
}
if(split_res[0]=='_notime'){
this.bChecksubmit = 0;
fnShowLayer('none');
alert('정액제 사용시간이 아닙니다. ');
alert('포인트가 부족합니다. 충전 후 다시 내려받기 하시기 바랍니다[2]. ');
opener.location='/charge.php';
opener.focus();
return;
}
if (split_res[0] == '_noadtbill') {
this.bChecksubmit = 0;
fnShowLayer('none');
alert("새디스크 성인컨텐츠 이용 안내!\r\n\n새디스크 성인컨텐츠는 첫결제 이후 이용하실 수 있습니다.\r\n\n(1회 결제 이후 무료포인트로 성인 컨텐츠 이용 가능)\r\n\n(통합포인트전환시 3900원 이상 모든컨텐츠 이용가능 )\r\n\n포인트 충전 시 50%할인, 추가 스페셜 포인트 지급!!\r\n이제 저렴한 반값으로 이용해 보세요.");
//jQuery("#blackbg").css("display","block");
goSimpleChargeAdt();
//document.getElementById("event_layer").innerHTML = "새디스크 성인컨텐츠 이용 안내!
새디스크의 성인컨텐츠는 첫결제 이후 이용하실 수 있습니다.
(1회 결제 이후 무료포인트로 성인 컨텐츠 이용 가능)
포인트 충전 시 50%할인, 추가 스페셜 포인트 지급!!
이제 저렴한 반값으로 이용해 보세요.";
//document.getElementById("event_layer").style.display = 'block';
//document.documentElement.scrollTop = 0;
return;
}
// 다운로드 시 필요한 파라미터
var query_string = 'act=ok&idx='+this.bbs_idx+'&type='+this.pay_type+'&purchase_idx='+this.purchase_idx+'&down_flag='+this.down_flag+'&file_list='+this.file_list+'&speed_type='+this.speed_type;
this.bChecksubmit = 0;
// 스트리밍 이용시
if(this.streaming==1){
query_string += "&stm=1";
}
if(split_res[0]=='_week') {
if(confirm('평일정액제는 평일에만 이용이 가능합니다. \r\n\r\n'+fnMoney(this.buy_cash)+'포인트가 차감됩니다. \r\n구매하시겠습니까? ')){
this.bChecksubmit = 0;
fnShowLayer('none');
sendRequest(doDownloadPorcess, query_string+"&use_point=1",'POST','/models/common/main/module/bbsDownTry_new_file.php',true,true);
return;
}
}
if(split_res[0]=='_down_exs'){
alert('죄송합니다. \r\n\r\n정상적인 정액제 이용이 아닌 것으로 판단되어 금일 더이상 내려받기를 할 수 없습니다. \r\n정액제의 부정 사용을 막기위해 일일 '+parseSize(split_res[1],1)+' 이상의 자료를 다운로드할 수 없습니다. \r\n자세한 내용은 고객센터나 1:1상담으로 문의해주시기 바랍니다. ');
this.bChecksubmit = 0;
fnShowLayer('none');
return;
}
if(split_res[0]=='_notime_point'){
if(confirm('정액제 사용시간이 아닙니다. \r\n\r\n'+fnMoney(this.buy_cash)+'포인트가 차감됩니다. \r\n구매하시겠습니까? ')){
sendRequest(doDownloadPorcess, query_string+"&use_point=1",'POST','/models/common/main/module/bbsDownTry_new_file.php',true,true);
return;
}
else {
this.bChecksubmit = 0;
fnShowLayer('none');
return;
}
}
if(split_res[0]=='_notime_point_buy'){
if(confirm(fnMoney(this.buy_cash)+'포인트가 차감됩니다. \r\n구매하시겠습니까? ')){
sendRequest(doDownloadPorcess, query_string+"&use_point=1",'POST','/models/common/main/module/bbsDownTry_new_file.php',true,true);
return;
}
}
if(split_res[0]=='_noration'){
if(confirm('판매자의 요청에 의해서 해당 컨텐츠의 내려받기를 하실 수 없습니다. ')){
fnShowLayer('none');
this.bChecksubmit = 0;
return;
}
}
if(split_res[0]=='_cpnnotime'){
alert('쿠폰은 주간(03:00 ~ 21:00)에 사용이 가능합니다. ');
fnShowLayer('none');
this.bChecksubmit = 0;
return;
}
if(split_res[0]=='_noadult') {
alert('성인 컨텐츠는 성인인증 후 이용하실 수 있습니다. ');
fnShowLayer('none');
this.bChecksubmit = 0;
return false;
}
if(split_res[0]=='_nocash') { //일반..
fnShowLayer('none');
this.bChecksubmit = 0;
//alert('포인트가 부족합니다. 충전 후 다시 내려받기 하시기 바랍니다[3]. \n');
alert('신규 웹하드가 드리는 초특가 이벤트!!\r\n\n깔~끔하게 50% 더 받고 시작하세요!~');
//opener.location='/charge.php';
//opener.focus();
//jQuery("#blackbg").css("display","block");
goSimpleCharge();
return;
}
if(split_res[0]=='_nocash2') { //일반..
fnShowLayer('none');
this.bChecksubmit = 0;
alert("해당 컨텐츠는 포인트(P)로만 구매 가능한 파일이 포함되어 있습니다.\n포인트 충전 후 이용해주시기 바랍니다.");
//opener.location='/charge.php';
//opener.focus();
try {
goSimpleCharge();
} catch (e) { }
return;
}
if(split_res[0]=='_nocoupon') {
alert('회원님께서는 사용할 수 있는 쿠폰이 없습니다. ');
fnShowLayer('none');
this.bChecksubmit = 0;
return;
}
if(split_res[0]=='_not_usecoupon'){
alert('해당 컨텐츠는 쿠폰으로 다운 받을 수 없습니다. ');
fnShowLayer('none');
this.bChecksubmit = 0;
return;
}
// 실시간 스트리밍 사용시
if(this.streaming == 1)
{
this.streaming = 0;
var streamWinPopup = window.open( "/storage.php?act=viewVOD&idx="+this.bbs_idx ,"streamView",'width=650,height=475,top=0,left=0,scrollbars=yes');
streamWinPopup.focus();
if(this.purchase_idx==''){
document.location.reload();
}
fnShowLayer('none');
this.bChecksubmit = 0;
return;
}else{
// 다운로드 클라이언트 호출
if(split_res[0]=='_bonus' || split_res[0]=='_ration' || split_res[0]=='_partner' || split_res[0]=='_common' || split_res[0]=='_coupon') {
if (jQuery.browser.msie || (/Trident\/7\./).test(navigator.userAgent)) {
if ( ( window.navigator.platform != "win32" && window.navigator.cpuClass != "x86" ) || !mmsv_check() ) {
document.frm_scrap.method = "POST";
document.frm_scrap.noStraa.value = oj.responseText;
document.frm_scrap.action = '/models/common/main/module/fileOther.php';
document.frm_scrap.submit();
}
else {
mmsv_download(split_res[1]);
if(this.purchase_idx == ''){
document.location.reload();
}
fnShowLayer('none');
this.bChecksubmit = 0;
}
}
else {
document.frm_scrap.method = "POST";
document.frm_scrap.noStraa.value = oj.responseText;
document.frm_scrap.action = '/models/common/main/module/fileOther.php';
document.frm_scrap.submit();
fnShowLayer('none');
this.bChecksubmit = 0;
}
}
}
return;
}
function fnShowLayer(sty)
{
var sty;
try {
document.getElementById("ongoing_layer").style.display = sty;
}
catch(e) {
}
return;
}
function aa(oj){
alert(oj.responseText);
}
// 무료 다운로드 Ajax 리턴 처리.
function doDownloadSpeedLowPorcess(oj){
var res = decodeURIComponent(oj.responseText); //alert(res);return;
var split_res = res.split('|');
couponDownBtn = false;
//alert(split_res[1]); return;
if(split_res[0]=='_video'){
alert('저작권파일이 포함되어 있는 컨텐츠는 다운로드 되지 않습니다 . ');
return;
}
if(split_res[0]=='_noconnect'){
alert('DB와의 접속이 끊어졌습니다. \r\n잠시후에 다시 이용해주십시요. ');
return;
}
if(split_res[0]=='_expire') {
alert('만료된 컨텐츠입니다. ');
return;
}
// 다운로드 클라이언트 호출
if(split_res[0]=='_freedownspeedlow'){
mmsv_freedown_speed_low(split_res[1]);
}
return;
}
/*
function openBbsModify(idx,write_domain) {
if(jQuery("#ipchk").val() != "") {
//opener.location.href=write_domain + 'storage.php?act=modify&idx='+idx;
opener.location.href = '/storage.php?act=modify&idx='+idx;
self.close();
window.self.close();
return;
}
if(GetCookie('sUserInfo')) {
if(openHeight > 768) openHeight = 730;
opener.location.href = write_domain + 'storage.php?act=modify&idx='+idx;
self.close();
} else {
alert('로그인 후 이용해주세요. ');
}
window.self.close();
}
*/
function openBbsModify(idx,write_domain) {
var openUrl = "";
if(jQuery("#ipchk").val() != "") {
//opener.location.href=write_domain + 'storage.php?act=modify&idx='+idx;
//opener.location.href = '/storage.php?act=modify&idx='+idx;
openUrl = write_domain + 'storage.php?act=modify&idx='+idx;
}
if(GetCookie('sUserInfo')) {
if(openHeight > 768) openHeight = 730;
//opener.location.href = write_domain + 'storage.php?act=modify&idx='+idx;
openUrl = write_domain + 'storage.php?act=modify&idx='+idx;
} else {
alert('로그인 후 이용해주세요. ');
self.close();
window.self.close();
}
window.open(openUrl,"bbsWritePop","width=800,height=775");
}
function openBbsModify_k(idx){
if(GetCookie('grade') > 0 && GetCookie('sUserInfo')){
if(openHeight > 768) openHeight = 730;
openWin('http://web1.sedisk.com/main/editor/modify.php?idx='+idx, 'bbs_write', '842', openHeight, 'yes');
}else{
alert('로그인 후 이용해주세요. ');
}
window.self.close();
}
function downTryCoupon(idx,cash,adult){
if(chkDownApp() ==false){
return;
}
if(couponDownBtn == true){
alert('작업 진행중입니다. 잠시만 기다려주십시오. ');
return;
}else{
couponDownBtn = false;
}
//alert('죄송합니다. 서버 작업으로 인해 다운로드가 중단됩니다. \r\n잠시후에 다시 이용해주십시요.');
//return false;
var vaildStart = 3; var vaildEnd = 21;//사용시간 설정
var now=new Date();var hr=now.getHours();
var cashTotal = parseInt(GetCookie('cmn_cash'))+parseInt(GetCookie('bns_cash'));
if(confirm('쿠폰을 사용하여 내려받기 하시겠습니까? ')){
sendRequest(returnTryDown,'&act=ok&idx='+idx+'&adult='+adult,'POST','/models/common/main/module/bbsCouponUse.php',true,true);
}
/*
if(GetCookie('coupon') > 0){
if(parseInt(hr) >= vaildStart && vaildEnd > parseInt(hr)){ //이용가능시간
if(confirm('쿠폰을 사용하여 내려받기 하시겠습니까? ')){
sendRequest(returnTryDown,'&act=ok&idx='+idx+'&adult='+adult,'POST','/models/common/main/module/bbsCouponUse.php',true,true);
}
}else{
if(cashTotal >= cash){
alert('쿠폰은 주간(03:00 ~ 21:00)에 사용이 가능합니다. ');
if(confirm('쿠폰 사용 가능시간이 아닙니다. \r\n포인트로 받으시겠습니까? ')){
tryDown(idx,cash,adult);
}
}else{
alert('쿠폰은 주간(03:00 ~ 21:00)에 사용이 가능합니다. ');
}
}
}else{
alert('회원님께서는 사용할 수 있는 쿠폰이 없습니다. ');
}
*/
}
function downTryCoupon2(idx,cash,adult){
if(chkDownApp() ==false){
return;
}
if(couponDownBtn == true){
alert('작업 진행중입니다. 잠시만 기다려주십시오. ');
return;
}else{
couponDownBtn = false;
}
//alert('죄송합니다. 서버 작업으로 인해 다운로드가 중단됩니다. \r\n잠시후에 다시 이용해주십시요.');
//return false;
var vaildStart = 3; var vaildEnd = 21;//사용시간 설정
var now=new Date();var hr=now.getHours();
var cashTotal = parseInt(GetCookie('cmn_cash'))+parseInt(GetCookie('bns_cash'));
if(confirm('쿠폰을 사용하여 내려받기 하시겠습니까? ')){
sendRequest(returnTryDown_z,'&act=ok&idx='+idx+'&adult='+adult,'POST','/models/common/main/module/bbsCouponUse.php',true,true);
}
/*
if(GetCookie('coupon') > 0){
if(parseInt(hr) >= vaildStart && vaildEnd > parseInt(hr)){ //이용가능시간
if(confirm('쿠폰을 사용하여 내려받기 하시겠습니까? ')){
sendRequest(returnTryDown_z,'&act=ok&idx='+idx+'&adult='+adult,'POST','/models/common/main/module/bbsCouponUse.php',true,true);
}
}else{
if(cashTotal >= cash){
alert('쿠폰은 주간(03:00 ~ 21:00)에 사용이 가능합니다. ');
if(confirm('쿠폰 사용 가능시간이 아닙니다. \r\n포인트로 받으시겠습니까? ')){
tryDown(idx,cash,adult);
}
}else{
alert('쿠폰은 주간(03:00 ~ 21:00)에 사용이 가능합니다. ');
}
}
}else{
alert('회원님께서는 사용할 수 있는 쿠폰이 없습니다. ');
}
*/
}
var isCmtCheck = 0;
function cmtInsert(idx){
var f = window.document.cmt_frm;
var noUsingAd = new Array('http','co.kr','com','net','가입');
if(!GetCookie('sUserInfo')){
//alert('로그인 후 글을 작성하실 수 있습니다. ');
jQuery('.pop_dim').fadeTo('fast',0.6);
openloginpopup('mfilebbscmt');
return false;
}
//var isDenyCnt = f.cmt.getAttribute("isDenyCnt");
var isDenyCnt = jQuery(f).find("textarea[name=cmt]").attr("isDenyCnt");
if( isDenyCnt != null && isDenyCnt != "0" )
{
alert('댓글작성이 금지되었습니다');
f.cmt.value='';
return false;
}
if(f.cmt.value.length < 2) {
alert('내용을 입력해주세요. ');
f.cmt.style.backgroundImage=''
f.cmt.value='';
f.cmt.focus();
return false;
}
if(f.cmt.value.length > 140) {
alert('입력된 내용이 너무 많습니다. \r\n댓글의 내용은 140자 이내로 입력해주세요. ');
f.cmt.focus();
return false;
}
var act='';
if(f.act){
act=f.act.value;
}
if(confirm('댓글을 등록하시겠습니까? ')) {
//f.cmt.disable=true;
if (isCmtCheck == 0) {
sendRequest(returnCmt,'&act=ok&idx='+idx+'&cmt_contents='+f.cmt.value+'&cmtCnt='+cmtCnt+'&rqCmt='+act,'POST','/models/common/main/module/bbsCmt.php',true,true);
isCmtCheck++;
return false;
}
else {
alert('등록 중 입니다. 잠시만 기다려주세요');
return false;
}
}else{
return false;
}
}
function returnCmt(oj){
var res = decodeURIComponent(oj.responseText);
//prompt('',res);
var split_res = res.split('|');
isCmtCheck = 0;
if(res=='cmt_time'){
alert('도배글 등록 방지를 위해 연속해서 덧글을 입력하실 수 없습니다.');
return false;
}
if(res=='_nostr'){
alert('금칙어가 포함되어 있으므로 덧글을 입력하실 수 없습니다. ');
return false;
}
if(res=='joinday'){
alert('덧글 입력은 가입 후 24시간후부터 사용하실 수 있습니다.');
return false;
}
if(res=='cmt_limit'){
alert('광고, 도배성글을 방지하기 위해 덧글은 하루에 5회이상 등록할 수 없습니다.');
return false;
}
if(split_res[0]=='_jeje'){
if(split_res[1]==0 && split_res[2]==0){
alert('회원님은 제재로 인해 덧글을 등록하실 수 없습니다. \r\n\r\n- 제재사유 : '+split_res[3]+' ');
return false;
}else{
alert('회원님은 제재로 인해 아래기간동안 덧글을 등록하실 수 없습니다. \r\n\r\n- 제재사유 : '+split_res[3]+' \r\n\r\n- 제재기간 : '+split_res[1]+'부터 '+split_res[2]+'까지 ');
return false;
}
}else if(split_res[0]=='_down_deny'){
alert('판매자의 요청에 의해서 해당 컨텐츠의 덧글작성을 하실 수 없습니다. ');
return;
}else if(split_res[0]=='_down_cnt') {
alert('100원이벤트 사용시 성인컨텐츠는 일제한으로 1일 20회만 다운로드가능합니다. ');
return;
}else if(split_res[0]=='_adult_down_cnt') {
alert('짧은 시간 컨텐츠이용이 많을시에는 트래픽증가로 인해 다운로드가 안될수도있습니다. 잠시후 이용해주시기 바랍니다. ');
return;
}else if(split_res[0]=='_commentevent') {
alert('댓글이벤트 참여로 '+split_res[1]+'보너스 포인트를 받으셧습니다.');
location.reload();
}else{
/*
var old_content = $('cmt_input').innerHTML;
$('cmt_input').innerHTML = old_content+res;
if($('nocomment')=='[object]') $('nocomment').style.display='none';
var frm = document.cmt_frm;
cmtCnt = cmtCnt+1;
frm.cmt.value='';
parent.calcHeight('bbsInfoCmtFrame');
//resizeFrame();
*/
location.reload();
}
}
function cmtAllView(b){
location.href='./bbs_info_cmt.php?idx='+thisBBsIdx+'&limitEnd='+cmtCnt+'&sell_userid='+sell_userid+'&view=all&bfont='+b;
}
//코멘트 신고하기 시작
function openCmtDeclare(n){
if(!GetCookie('sUserInfo')){
alert('로그인 후 이용하실 수 있습니다. ');
return false;
}
var f=document.frm_declare;
X = event.clientX + document.body.scrollLeft-250;
Y = event.clientY + document.body.scrollTop+10;
$('cmt_declare_layer').style.top=Y;
$('cmt_declare_layer').style.left=X;
$('cmt_declare_layer').style.display='';
f.cmt_idx.value=n;
}
function closeCmtDeclare(){
var f=document.frm_declare;
f.cmt_idx.value='';
f.kind.value='0';
f.declare_text.value='';
$('cmt_declare_layer').style.display='none';
}
function actCmtDeclare(){
var f=document.frm_declare;
if(f.kind.value < 1){
alert('분류를 선택해주세요! ');
f.kind.focus();
return false;
}
if(f.declare_text.value.length < 2){
alert('내용을 입력해주세요! ');
f.declare_text.focus();
return false;
}
if(confirm('입력하신 내용과 같이 신고하시겠습니까? \r\n허위 신고시 불이익을 받을 수 있습니다. ')){
sendRequest(returnDeclare,'&act=declare&cmt_idx='+f.cmt_idx.value+'&kind='+f.kind.value+'&declare_text='+f.declare_text.value,'POST','/models/common/main/module/bbsCmtPrc.php',true,true);
f.kind.disabled=true;
f.declare_text.disabled=true;
return false;
}else{
return false;
}
}
function returnDeclare(oj){
var res = decodeURIComponent(oj.responseText);
switch(res){
case '_nouserid' :
alert('로그인 후 이용해주세요! ');break;
case '_noperm' :
alert('자신의 코멘트는 신고할 수 없습니다. ');break;
case '_req' :
alert('분류 또는 신고내용이 입력되지 않았습니다. ');break;
case '_double' :
alert('이미 신고내용이 접수되어 처리중입니다. ');bbsReload();break;
case 'ok' :
alert('신고내용이 접수되었습니다. ');
bbsReload();
break;
}
}
//코멘트 신고하기 끝
//코멘트 삭제 시작
function cmtDelete(n){
if(!n){
alert('잘못된 접근입니다. ');
return false;
}
if(!GetCookie('sUserInfo')){
alert('로그인 후 이용하실 수 있습니다. ');
return false;
}
var f = document.cmt_frm;
var act='';
if(f.act){
act=f.act.value;
}
if(confirm('정말 삭제하시겠습니까? ')){
sendRequest(returnCmtDelete,'&act=delete&cmt_idx='+n+'&rqCmt='+act,'POST','/models/common/main/module/bbsCmtPrc.php',true,true);
return false;
}
}
function returnCmtDelete(oj){
var res = decodeURIComponent(oj.responseText);
switch(res){
case '_noperm' :
alert('삭제 권한이 없습니다. ');break;
case 'ok' :
//bbsReload(); 페어런츠가 리로드되야함
location.reload();
break;
}
}
//코멘트 삭제 끝
//게시물 신고하기 시작
function openBBsDeclare(){
if(!GetCookie('sUserInfo')){
alert('로그인 후 이용하실 수 있습니다. ');
return false;
}
X = event.clientX + document.body.scrollLeft-300;
Y = event.clientY + document.body.scrollTop+14;
$('bbs_declare_layer').style.top=Y;
$('bbs_declare_layer').style.left=X;
$('bbs_declare_layer').style.display='';
}
function closeBBsDeclare(){
var f = document.frm_bbs_declare;
f.kind.value='0';
f.declare_text.value='';
$('bbs_declare_layer').style.display='none';
}
function actBBsDeclare(){
var f=document.frm_bbs_declare;
/*
if(f.kind.value < 1){
alert('분류를 선택해주세요! ');
f.kind.focus();
return false;
}
*/
if(f.declare_text.value.length < 2){
alert('내용을 입력해주세요! ');
f.declare_text.focus();
return false;
}
if(confirm('입력하신 내용과 같이 컨텐츠를 신고하시겠습니까? ')){
sendRequest(returnBBsDeclare,'&act=declare&bbs_idx='+thisBBsIdx+'&code='+f.code.value+'&kind='+f.kind.value+'&declare_text='+f.declare_text.value,'POST','/models/common/main/module/bbsDeclare.php',true,true);
f.kind.disabled=true;
f.declare_text.disabled=true;
return false;
}else{
return false;
}
}
function returnBBsDeclare(oj){
var res = decodeURIComponent(oj.responseText);
switch(res){
case '_nouserid' :
alert('로그인 후 이용해주세요! ');break;
case '_req' :
alert('분류 또는 신고내용이 입력되지 않았습니다. ');break;
case 'ok' :
alert('신고내용이 접수되었습니다. ');
bbsReload();
break;
}
}
//코멘트 수 체크
function checkLength(e){
var form = document.cmt_frm;
var limit = 200;
var cmt = form.cmt.value;
var keyValue = event.keyCode;
var split_enter = form.cmt.value.split('\r\n');
if(split_enter.length > 5){
alert('덧글 내용에 5회 이상 엔터를 입력하실 수 없습니다. ');
split_enter[5]='';
form.cmt.value = split_enter[0]+'\r\n'+split_enter[1]+'\r\n'+split_enter[2]+'\r\n'+split_enter[3]+'\r\n'+split_enter[4];
}
var lastString = cmt.substring(cmt.length - 4,cmt.length);
if(form.cmt.value.indexOf('\r\n\r\n')!=-1){
alert('2회 이상 연속으로 엔터를 입력하실 수 없습니다. \r\n');
form.cmt.value = cmt.substring(0,form.cmt.value.length-2);
}
if(cmt.length > limit){
alert("덧글 내용은 "+limit+"자까지만 입력이 가능합니다.");
form.cmt.value = cmt.substring(0,limit);
}
$("cmtLen").innerHTML =form.cmt.value.length;
}
//게시물 신고하기 끝
//등록정보 광고창
function bnClick(){
if(!GetCookie('sUserInfo')){
alert('로그인 후 이용하실 수 있습니다. ');
return;
}
opener.focus();
var bbs_info_bn_url = new Array();
bbs_info_bn_url[0] = '/main/charge.php?doc=free';
bbs_info_bn_url[1] = '/main/charge.php?doc=free2';
bbs_info_bn_url[2] = '/main/charge.php?doc=event_special';
var rndNum = Math.round(Math.random()*2);
location.href=bbs_info_bn_url[rndNum];
}
function resizeFrameHeight(height) {
document.getElementById('cpFrame').style.height = height;
}
//-- 선택된 check 박스
function fnClickFileBox( fbox )
{
var fboxChecked = fbox.checked;
var fboxBundle = fbox.getAttribute("bundleIdx");
if( fboxBundle != "0" )
{
var fboxs = document.getElementsByName( fbox.name );
for( var i=0 ,iLen=fboxs.length ; i