var WWW_DOMAIN_NAME = 'http://www.daiwaresort.co.kr'; var IMG_DOMAIN_NAME = 'http://home.worldtee.com'; var agt = navigator.userAgent.toLowerCase(); var is_opera = (agt.indexOf("opera") != -1); var is_ie = (agt.indexOf("msie") != -1) && document.all && !is_opera; //--------------------- // 언어 선택 //--------------------- function lang_change(sel) { location.href = sel.value; } function get_timestamp() { var d = new Date(); return (d.getTime()/1000).toFixed(); } function image_on_error() { event.srcElement.src = "/img/1x1.gif"; } function intval(s) { return (!s || s == "") ? 0 : parseInt(s.replace(/,/g,''),10); } function floatval(s) { return (!s || s == "") ? 0 : parseFloat(s.replace(/,/g,''),10); } function number_format(s) { var v = float_format(s,2,2)+''; return v.replace('.00',''); } function float_format(s,pointcut,pointpad) { if(!s || s == null || s == '') return 0; var temp = new String(s); if(temp.length < 1) return 0; if(temp.substr(0,1) == '-') minus = '-'; else minus = ''; dpoint = temp.search(/\./); if(dpoint > 0) { dpointVa = '.'+temp.substr(dpoint).replace(/\D/g,''); temp = temp.substr(0,dpoint); } else { dpointVa = ''; } temp = temp.replace(/\D/g,''); zero = temp.search(/[1-9]/); if(zero == -1) return 0; else if(zero != 0) temp = temp.substr(zero); if(temp.length < 4) return minus + temp + dpointVa; buf = ''; while(true) { if(temp.length < 3) { buf = temp + buf; break; } buf = ',' + temp.substr(temp.length - 3) + buf; temp = temp.substr(0, temp.length - 3); } if(buf.substr(0,1)==',') buf = buf.substr(1); if(pointcut) if(dpointVa.length > pointcut) dpointVa = dpointVa.substr(0,3); if(pointpad) if(dpointVa.length == pointpad) dpointVa = dpointVa+'0'; return minus+buf+dpointVa; } function is_valid_alpha_number(val,min,max) { var r = true; var s = val; var a = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; var l = s.length; for(var i=0; i max) r = false; return r; } function is_valid_email(email) { var re = /^[0-9a-zA-Z]([-_\.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-_\.]?[0-9a-zA-Z])*\.[a-zA-Z]{2,3}$/i; return re.test(email) ? true : false; } function style_toggle(obj, cls, str) { if(str) { if(obj.value == "") obj.value = str; else if(obj.value == str) obj.value = ""; } obj.className = cls; } function tr_over(obj, bgc) { obj.style.backgroundColor = (bgc == null || bgc == "") ? '#FFFFCC' : bgc; } function tr_out(obj, bgc) { obj.style.backgroundColor = (bgc == null || bgc == "") ? '' : bgc; } function td_over(obj, bgc, fgc) { obj.style.backgroundColor = (bgc == null || bgc == "") ? '#FFFFCC' : bgc; if(fgc) obj.style.color = fgc; } function td_out(obj, bgc, fgc) { obj.style.backgroundColor = (bgc == null || bgc == "") ? '' : bgc; obj.style.color = (fgc == null || fgc == "") ? '#000000' : fgc; } function rowspan(table_id, column_no) { var obj = document.getElementById(table_id); if(obj == null) return; var rows = obj.getElementsByTagName("TR"); var previous = -1; for(var i=0; i 0) { var compare = (previous < 0) ? (i - 1) : previous ; var preCol = rows[ compare ].getElementsByTagName("TD")[column_no]; var curCol = rows[i].getElementsByTagName("TD")[column_no]; if (preCol.innerHTML == curCol.innerHTML){ preCol.rowSpan = preCol.rowSpan + 1; curCol.style.display = 'none'; previous = compare; } else{ previous = -1; } } } } function get_win_height() { var win_height = 0; if(self.innerHeight) win_height = self.innerHeight; // Standard browsers (Mozilla, Safari, etc.) else if(document.documentElement && document.documentElement.clientHeight) win_height = document.documentElement.clientHeight; // IE 6 else if(document.body) win_height = document.body.clientHeight; // IE 5 return win_height; } function win_open(url, title, width, height, opt) { opt = opt ? opt : 'toolbar=no,menubar=no,scrollbars=yes,resizable=yes'; var left = (screen.availWidth / 2) - (width / 2); var top = (screen.availHeight / 2) - (height / 2) - 20; var win = window.open(url, "", "width="+width+",height="+height+",left="+left+",top="+top+','+opt); win.focus(); } function popup_image_view(file_no) { var url = "/common/popup_image_view.php?file_no="+file_no; var width = 320; var height = 240; var left = (screen.availWidth / 2) - (width / 2); var top = (screen.availHeight / 2) - (height / 2) - 20; var win = window.open(url,'popupimageview',"toolbar=no,menubar=no,scrollbars=yes,resizable=yes,width="+width+",height="+height+",left="+left+",top="+top); win.focus(); } function show_loading() { if(document.getElementById('loading')) document.getElementById('loading').style.visibility = 'visible'; } function hide_loading() { document.getElementById('loading').style.visibility = 'hidden'; } function flash(c,d,e) { var flash_tag = ""; flash_tag = ''; flash_tag+= ''; flash_tag+= ''; flash_tag+= ''; document.write(flash_tag); } //------------------ // 레이어 로드하기 //------------------ function load_layer(layer_id,file_url) { hide_layer_all(); $('body').append(''); $('#'+layer_id).locationcenter().show(); $('#'+layer_id).load(file_url, function() { $(this).locationcenter(); }); } //--------------------- // 레이어 숨기기 //--------------------- function hide_layer_all() { $('#login_layer').remove(); $('#signup_layer').remove(); $('#idpswd_search_layer').remove(); } function signup() { location.href = '/user/agreement.php'; } function logout() { $.post("/user/logout.php", {}, function(r) { self.location.reload(); }); } function popup_calendar_selector(input_name,input_value,date_limit) { input_name = input_name ? input_name : ''; input_value = input_value ? input_value : ''; date_limit = date_limit ? date_limit : ''; win_open('/common/calendar_selector.php?input_name='+input_name+'&input_value='+input_value+'&date_limit='+date_limit,'popupcalendarselector',680,270); } function openTimePicker(form_name, time_name) { window.open("/common/time_picker.php?form_name=" + form_name + "&time_name=" + time_name, 'time_picker', "toolbar=no,menubar=no,status=no,scrollbars=no,resizable=no,width=100,height=10"); } $(document).ready(function() { try { document_ready(); } catch(e) {} try { load_main_map(); } catch(e) {} }); function on_unalod() { try { GUnload(); } catch(e) {} // 구글지도 해제 } 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; } } function setCookie(cookieName, cookieValue, expireDate) { var today = new Date(); if(expireDate == '') { document.cookie = cookieName + "=" + escape( cookieValue ) + "; path=/;"; } else { today.setDate( today.getDate() + parseInt( expireDate ) ); document.cookie = cookieName + "=" + escape( cookieValue ) + "; path=/; expires=" + today.toGMTString() + ";"; } } function deleteCookie(cookieName) { var expireDate = new Date(); expireDate.setDate( expireDate.getDate() - 1 ); document.cookie = cookieName + "= " + "; expires=" + expireDate.toGMTString() + "; path=/"; } window.onunload = on_unalod;