var Lib = function() {
this.IsPosting = false;
this.RegExpEmail = /^[0-9a-zA-Z]([-_\.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-_\.]?[0-9a-zA-Z])*\.[a-zA-Z]{2,3}$/i;
this.RegExpPhone = /^\d{2,3}-\d{3,4}-\d{4}$/;
this.RegExpPwd = /^(?=.*[0-9])(?=.*[!@#$%^&*])[a-zA-Z0-9!@#$%^&*]{8,15}$/;
this.RegExpBizno = /^[0-9]{3}-?[0-9]{2}-?[0-9]{5}$/;
this.RegExpEng = /^[a-zA-Z0-9-\.\_]+$/;
//2017.01.10 ¹ÚÁÖ¼® ä¿ë¿¡ ¿µ¹®À̸§(¿µ¾î + ¶ç¿ö¾²±â)
this.RegExpEngNm = /^[a-zA-Z\s]+$/;
this.RegExpNumber = /[^0-9]/g;
this.RegExpId = /^[a-zA-Z]{1}[a-zA-Z0-9_]{5,20}$/;
this.RegExpKor = /^[°¡-힣]+$/;
var isCKEditorCSRF = false;
var isIE7 = false;
var isIE8 = false;
var isIE9 = false;
var isIE10 = false;
var isIE11 = false;
var cid="";
var $focusObjectAfterPopUpClose = null;
var DeptTreePop = function(url, selector) {
var obj = $(selector);
if ($.trim(obj.html()) == "") {
if (Metronic.isIE8() || Metronic.isIE9()) {
obj.css({"margin-top":"38px"});
}
$.get(url, function (d) {
obj.html(d);
});
} else {
obj.slideToggle();
}
}
var smartTrim = function(string, maxLength) {
if (!string) return string;
if (maxLength < 1) return string;
if (string.length <= maxLength) return string;
if (maxLength == 1) return string.substring(0,1) + '...';
var midpoint = Math.ceil(string.length / 2);
var toremove = string.length - maxLength;
var lstrip = Math.ceil(toremove/2);
var rstrip = toremove - lstrip;
return string.substring(0, midpoint-lstrip) + '...' + string.substring(midpoint+rstrip);
}
var AddThis = function(obj, initial_) {
var clone = $(obj).clone(true);
$(obj).parent().append(clone);
if (initial_ != undefined) {
$(obj).find("input:text, textarea").val("");
} else {
$(obj).find("select").each(function (i) {
$(obj).parent().children().last().find("select").eq(i).val($(this).val());
});
}
$(obj).parent().find("input:text").each(function(i) {
$(this).attr("title", "ÆÄÀÏ÷ºÎ_" + i);
});
$(obj).parent().find("input:file").each(function(i) {
$(this).attr("title", "ÆÄÀÏ÷ºÎ_" + i);
});
}
var RemoveThis = function(obj) {
if ($(obj).parent().children().size() > 1)
$(obj).remove();
else {
$(obj).find("input:text, textarea").val("");
}
}
var checkboxAll = function(obj) {
var frmObj = $(obj).parents("form");
var index = $(frmObj).find("input:checkbox").index(obj);
$(frmObj).find("input:checkbox").each(function(i) {
if (i != index) {
if ($(this).parent().parent().hasClass("checker")) {
if ($(this).is(":checked")) {
$(this).attr("checked", false);
$(this).parent().removeClass("checked");
} else {
$(this).attr("checked", true);
$(this).parent().addClass("checked");
}
}
}
});
}
var _safe_tags_replace = function(str) {
if (str != null && str != "") {
var regex = //g
//¹°À½Ç¥ »ý¼º ¿À·ù·Î Ãß°¡ 2014.06.25 ÀÌÇö¿ì
while (str.indexOf(unescape("%uFEFF")) > -1) {
str = str.replace(unescape("%uFEFF"), "");
}
while (str.indexOf(unescape("%uFF1F")) > -1) {
str = str.replace(unescape("%uFF1F"), "");
}
return str
.replace(/&/g, "&")
.replace(//g, ">")
.replace(regex, "
")
.replace(/
/g, "
")
.replace(/
/g, "
")
.replace(/&/g, "&")
.replace(//g, ">");
} else {
return "";
}
}
var _safe_search_keyword = function(str) {
return str
.replace(/&/g, ";amp;")
.replace(/\//g, ";slh;")
.replace(//g," ");
}
var _tags_replace = function(str) {
return str
.replace(/&/g, "&")
.replace(//g, ">");
}
var Left = function (str, n){
if (n <= 0)
return "";
else if (n > String(str).length)
return str;
else
return String(str).substring(0,n);
}
var Right = function(str, n){
if (n <= 0)
return "";
else if (n > String(str).length)
return str;
else {
var iLen = String(str).length;
return String(str).substring(iLen, iLen - n);
}
}
var getUrlHost = function() {
var url = $.url();
var rtnValue = url.attr("protocol") + "://" + url.attr('host');
var port = url.attr("port");
if (port != "80")
{
rtnValue += ":" + port;
}
return rtnValue;
}
var gettab = function() {
var url = $.url();
return url.attr("fragment");
}
var SelectText = function(element) {
var doc = document
, text = doc.getElementById(element)
, range, selection
;
if (doc.body.createTextRange) {
range = document.body.createTextRange();
range.moveToElementText(text);
range.select();
} else if (window.getSelection) {
selection = window.getSelection();
range = document.createRange();
range.selectNodeContents(text);
selection.removeAllRanges();
selection.addRange(range);
}
}
var getTimeString = function(milisecond, opt) {
var s = parseInt(milisecond);
var ms = s % 1000;
s = (s - ms) / 1000;
var secs = s % 60;
s = (s - secs) / 60;
var mins = s % 60;
var hrs = (s - mins) / 60;
if (opt == undefined)
{
if (hrs == 0 && mins == 0)
{
return "";
}
return Right("0" + hrs, 2) + ':' + Right("0" + mins, 2);//+ ':' + secs + '.' + ms;
} else {
if (hrs == 0 && mins == 0 && secs == 0)
{
return "";
}
return Right("0" + hrs, 2) + ':' + Right("0" + mins, 2) + ':' + Right("0" + secs, 2);
}
}
var autoImgResize = function(obj, maxSize, IsResize) {
//console.log(obj.size());
if (maxSize==0)
{
maxSize = $(window).width()-60;
}
obj.each(function() {
var width = 0, height = 0;
width = parseInt($(this).width(), 10);
height = parseInt($(this).height(), 10);
var data_width = $(this).attr("data-width");
if (data_width == undefined) {
//alert(width+":"+height);
if(width > maxSize) {
$(this).css({width: maxSize+"px", height: Math.round(height * (maxSize / width))+"px" });
$(this).attr("data-width",width);
}
} else {
var max_data_width = parseInt($(this).attr("data-width"), 10);
if (max_data_width > maxSize) {
$(this).css({width: maxSize+"px", height: Math.round(height * (maxSize / width))+"px" });
}
}
//alert($(this).width()+":::"+$(this).height());
});
}
var loadScript = function(url, callback) {
var script = document.createElement("script")
script.type = "text/javascript";
if (script.readyState){ //IE
script.onreadystatechange = function(){
if (script.readyState == "loaded" ||
script.readyState == "complete"){
script.onreadystatechange = null;
callback();
}
};
} else { //Others
script.onload = function(){
callback();
};
}
script.src = url;
document.getElementsByTagName("head")[0].appendChild(script);
}
var getBrowserType = function(){
var _ua = navigator.userAgent;
var rv = -1;
//IE 11,10,9,8
var trident = _ua.match(/Trident\/(\d.\d)/i);
if( trident != null )
{
if( trident[1] == "7.0" ) return rv = "IE" + 11;
if( trident[1] == "6.0" ) return rv = "IE" + 10;
if( trident[1] == "5.0" ) return rv = "IE" + 9;
if( trident[1] == "4.0" ) return rv = "IE" + 8;
}
//IE 7...
if( navigator.appName == 'Microsoft Internet Explorer' ) return rv = "IE" + 7;
/*
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if(re.exec(_ua) != null) rv = parseFloat(RegExp.$1);
if( rv == 7 ) return rv = "IE" + 7;
*/
//other
var agt = _ua.toLowerCase();
if (agt.indexOf("chrome") != -1) return 'Chrome';
if (agt.indexOf("opera") != -1) return 'Opera';
if (agt.indexOf("staroffice") != -1) return 'Star Office';
if (agt.indexOf("webtv") != -1) return 'WebTV';
if (agt.indexOf("beonex") != -1) return 'Beonex';
if (agt.indexOf("chimera") != -1) return 'Chimera';
if (agt.indexOf("netpositive") != -1) return 'NetPositive';
if (agt.indexOf("phoenix") != -1) return 'Phoenix';
if (agt.indexOf("firefox") != -1) return 'Firefox';
if (agt.indexOf("safari") != -1) return 'Safari';
if (agt.indexOf("skipstone") != -1) return 'SkipStone';
if (agt.indexOf("netscape") != -1) return 'Netscape';
if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla';
}
var CKEditorCSRF = function(csrfname, csrfvalue) {
$(document).ready(function(){
if (!isCKEditorCSRF) {
CKEDITOR.on('dialogDefinition', function(ev) {
var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;
if(dialogName == 'image' || dialogName == 'link') {
var uploadTab = dialogDefinition.getContents('Upload');
if (uploadTab == null && dialogName == 'link')
{
uploadTab = dialogDefinition.getContents('upload');
}
for (var i =0; i < uploadTab.elements.length; i++)
{
var el = uploadTab.elements[i];
if(el.type != 'fileButton') {
continue;
}
var onClick = el.onClick;
el.onClick = function(evt){
var dialog = this.getDialog();
var fb = dialog.getContentElement(this['for'][0], this['for'][1]);
var action = fb.getAction();
var editor = dialog.getParentEditor();
editor._.filebrowserSe = this;
// CSRF Protection ÄÚµå
$(fb.getInputElement().getParent().$)
.append('');
if(onClick && onClick.call(evt.sender, evt) === false) {
return false;
}
return true;
};
}
}
});
isCKEditorCSRF = true;
}
});
}
var formatBytes = function(bytes,decimals) {
if(bytes == 0) return '0 Byte';
var k = 1000;
var dm = decimals + 1 || 3;
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
var i = Math.floor(Math.log(bytes) / Math.log(k));
return (bytes / Math.pow(k, i)).toPrecision(dm) + ' ' + sizes[i];
}
var _CKEditorUpdateElement = function(frmObj, callback) {
for(var instanceName in CKEDITOR.instances)
CKEDITOR.instances[instanceName].updateElement();
var IsValid = true;
//$("form").each(function() {
// var frmObj = $(this);
$(frmObj).find("input, textarea").each(function() {
if (_IsValidCheck(this)) {
$(this).val(_safe_tags_replace($(this).val()));
} else {
IsValid = false;
return false;
}
});
//});
if (typeof callback == "function" && IsValid)
{
callback();
}
}
var _CKEditorReverseElement=function(frmObj) {
//$("form").each(function() {
// var frmObj = $(this);
$(frmObj).find("input:text, textarea").each(function() {
$(this).val(_tags_replace($(this).val()));
});
//});
}
var _CKEditorPopup = function(num, textareaname) {
var $iframe = $("[name='" + textareaname + "']").parent().find("iframe.cke_wysiwyg_frame");
var $iframeBody = null;
if ($iframe.size() > 0)
$iframeBody = $iframe.contents().find("body");
if ($iframeBody != null && $iframeBody.size() > 0) {
var $container = $iframeBody.find(".editor-layerpopup").eq(num);
if ($container.css("display") == "none") {
$container.show();
} else {
$container.hide();
}
}
}
var _CKEditorTabActivity = function(num, textareaname, taboptions) {
var $iframe = $("[name='" + textareaname + "']").parent().find("iframe.cke_wysiwyg_frame");
var $iframeBody = null;
if ($iframe.size() > 0)
$iframeBody = $iframe.contents().find("body");
if ($iframeBody != null && $iframeBody.size() > 0) {
var $container = $iframeBody.find(taboptions.tabcontainer);
$container.each(function() {
var $that = $(this);
var isAccordian = $(this).hasClass("accordian") ? true :false;
var $tabs = $that.find(taboptions.tabselector);
var $tabcontents = $that.find(taboptions.tabcontentselector);
//if ($tabs.size() > num && $tabcontents.size() > num) {
if (isAccordian) {
$tabs.parent().removeClass(taboptions.tabactclass)
.eq(num).addClass(taboptions.tabactclass);
} else {
$tabs.removeClass(taboptions.tabactclass)
.eq(num).addClass(taboptions.tabactclass);
}
$tabcontents.hide().eq(num).show();
//} else {
// bootbox.alert("ÇØ´ç ÅÇÀÌ ÄÁÅÙÃ÷¿¡ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù.");
//}
});
}
}
var _IsValidCheck = function(frmObj) {
var $that = $(frmObj);
var RequiredText = $that.attr("data-required");
var value = $that.val();
if (RequiredText != undefined &&
$.trim(value) == "") {
bootbox.alert(RequiredText, function() {
$that.focus();
});
return false;
}
return true;
}
var _ByteCheck = function(str) {
var byteLength = 0;
var TBox = str;
if (TBox.length != 0) {
for (var i = 0; i < TBox.length; i++) {
var oneChar = escape(TBox.charAt(i));
if (oneChar.length == 1) {
byteLength++;
}
else if (oneChar.indexOf("%u") != -1) {
byteLength += 2;
}
else if (oneChar.indexOf("%") != -1) {
if (escape(oneChar) == "%250D") {
byteLength++;
byteLength--;
}
else {
byteLength += oneChar.length / 3;
}
}
}
}
return byteLength;
}
var _EditorTab = function() {
var hash = window.location.hash;
$(".tabs").each(function() {
var isAccordian = $(this).hasClass("accordian") ? true :false;
var $that = $(this);
$that.find(".btn").click(function() {
var index = $that.find(".btn").index($(this));
if (isAccordian) {
if ($(this).parent().hasClass("on")) {
$(this).parent().removeClass("on");
$that.find(".contentdiv").eq(index).slideUp(200, function () { });
} else {
$that.find(".btn").parent().removeClass("on").eq(index).addClass("on");
$that.find(".contentdiv").not(":eq(" + index + ")").slideUp(200, function () {
$that.find(".contentdiv").eq(index).slideDown(200, function () {
jQuery("body, html").stop().animate({ scrollTop: $that.find(".on").offset().top }, 0);
});
});
}
} else {
$that.find(".btn").removeClass("on").eq(index).addClass("on");
$that.find(".contentdiv").hide().eq(index).show();
}
});
});
$(".tabs a[href='" + hash + "']").trigger("click");
}
var _LayerPopUp = function() {
jQuery(window).resize(function () {
var PopHeight = jQuery(".layerPop").height() / 2;
var PopWidth = jQuery(".layerPop").width() / 2;
jQuery(".layerPop").each(function() {
var fixsize = $(this).hasClass("mainPop") ? 0 : 40;
//alert(fixsize);
$(this).css({
top: (jQuery(window).height() / 2) - PopHeight + jQuery(window).scrollTop() - fixsize,
left: (jQuery(window).width() / 2) - PopWidth - fixsize});
});
})
jQuery(".popClose, .pCancel, .blackBg").click(function () {
var scrollNum = $(this).attr("data-scroll");
$("#wrap").css({
position: "relative",
overflowY: "auto",
top: 0
});
$("html,body").scrollTop(scrollNum);
$(".layerPop").css("display", "none");
$(".blackBg").fadeOut(300);
if ($focusObjectAfterPopUpClose != null)
$focusObjectAfterPopUpClose.focus();
});
// ¶ô¾Ø¶ô¼öÃâ±¹ ÆË¾÷ ¹öư Ŭ¸¯
jQuery(".globalLayerPop .tabBtnList li").each(function (e) {
jQuery(this).find("a").click(function () {
jQuery(".globalLayerPop .tabBtnList li").removeClass("on");
jQuery(this).parent("li").addClass("on");
var scrollHeight = 0;
if (e == 0) {
scrollHeight = 0;
} else {
for (var num = 0 ; num < e ; num++) {
scrollHeight = scrollHeight + jQuery(".stateList").find(".list").eq(num).outerHeight(true);
}
}
//console.log(scrollHeight);
jQuery(".stateList").stop().animate({ scrollTop: scrollHeight }, 0);
});
});
}
var _GetFaceBook = function (root) {
var token = "692140504282579|mPk38svd71Q7XzrZzKDp3ljsPMo";
var pageId = "ilocknlock";
var pageSize = 10;
var pageLimit = 4;
var pagei = 0;
var fields = ["picture", "full_picture", "message", "link", "likes", "comments", "created_time"];
var url = "https://graph.facebook.com/" + pageId + "/posts?access_token=" + token + "&fields=" + fields.join(",") + "&limit=" + pageSize + "&callback=?";
var $container = root == '/mobile' ? $(".snsBody.fb") : $(".faceBookA > .multiTypeA > ul");
var listhtml = $container.html();
//console.log(listhtml);
$.getJSON(url, function (json) {
$container.html("");
$.each(json.data,function(i,fb){
var link = fb.link != undefined ? fb.link : "";
var full_picture = fb.full_picture != undefined ? fb.full_picture : "";
var message = fb.message != undefined ? fb.message.substring(0,50) + "..." : "";
var likecnt = fb.likes != undefined ? fb.likes.data.length : 0;
var cmtcnt = fb.comments != undefined ? fb.comments.data.length : 0;
var created_time = fb.created_time != undefined ? fb.created_time.substring(0,10) : "";
if ($.trim(full_picture) != "" && pagei++ < pageLimit) {
$container.append(
$(listhtml
.replace("{linkurl}", link)
.replace("{imgurl}", full_picture)
.replace("{title}", message)
.replace("{date}", created_time)
.replace("{likecnt}", likecnt)
.replace("{cmtcnt}", cmtcnt)).show()
);
}
});
if (root != '/mobile') {
$(".multiTypeA li").filter(function (index) {
return index % 4 == 0
}).css({
marginLeft: 0
})
}
});
}
var _GetInstagram = function(root) {
var url = "/nowlocknlock/getinstagram"
var $container = root == '/mobile' ? $(".snsBody.insta") : $(".instagramA > .instaCon > ul.instaList");
var listhtml = $container.html();
$.getJSON(url,function(json){
$container.html("");
$.each(json.data,function(i,insta){
var link = insta.link != undefined ? insta.link : "";
var picture = insta.images.low_resolution.url != undefined ? insta.images.low_resolution.url : "";
var caption = insta.caption != undefined ? insta.caption.text : "";
var likecnt = insta.likes != undefined ? insta.likes.count : 0;
$container.append(
$(listhtml
.replace("{linkurl}", link)
.replace("{imgurl}", picture)
.replace("{title}", caption)
.replace("{likecnt}", likecnt)).show()
);
});
if (root != '/mobile') {
// ÀνºÅ¸±×·¥ list °£°Ý °ª
$(".instaList li").filter(function (index) {
return index % 4 == 0
}).css({
marginLeft: 0
})
$(".instaList li").filter(function (index) {
return index > 3
}).css({
marginTop: 22
})
$(".multiTypeA li").filter(function (index) {
return index % 4 == 0
}).css({
marginLeft: 0
})
$(".famSiteList ul li").filter(function (index) {
return index > 3
}).css({
marginTop: 12
})
$(".globalSiteList li").filter(function (index) {
return index > 2
}).css({
marginTop: 30
})
}
});
}
var _GetNaverBlog = function(root) {
var root_ = root == undefined ? "" : root;
var url = "/nowlocknlock/getnaverblog/";
$.get(url, {}, function(html) {
$(".naverBlogA").html(html);
});
}
var _GetSupporters = function(root) {
var root_ = root == undefined ? "" : root;
var url = "/nowlocknlock/getsupporters/";
$.get(url, {}, function(html) {
$(".supportA").html(html);
});
}
var _setCookie = function(name, value, expirehours) {
var todayDate = new Date();
todayDate.setHours(todayDate.getHours() + expirehours);
document.cookie = name + "=" + escape(value) + ";path=/;expires=" + todayDate.toGMTString() + ";";
}
var _closeWin = function(name, value, expirehours) {
_setCookie(name, value, expirehours);
}
var _keydown_number = function(event, Includekeypad) {
var code = event.which || event.keyCode;
if (
(code >= 48 && code <= 57) ||
(code >= 96 && code <= 105)
) {
return true;
}
return false;
}
var _keydown_specialkey = function(event) {
var code = event.which || event.keyCode;
if (
code == 186 || //:
code == 187 || //-
code == 188 || //,
code == 189 || //-
code == 190 || //.
code == 191 || //?
code == 219 || //[
code == 220 || //\
code == 221 || //]
code == 222 || //"
code == 111 || //ŰÆÐµå/
code == 106 || //ŰÆÐµå*
code == 109 || //ŰÆÐµå-
code == 107 || //ŰÆÐµå+
code == 110 //ŰÆÐµå.
) {
return true;
}
return false;
}
var _keydown_utility = function(event) {
var code = event.which || event.keyCode;
if (( code >=37 && code <= 40 ) || //arrowkey
code == 8 || //backspace
code == 9 || //tab
code == 36 || //home
code == 35 || //end
code == 46 //delete
) {
return true;
}
return false;
}
var _keydown_copypaste = function(event) {
var code = event.which || event.keyCode;
if (event.ctrlKey &&
(code == 67 || code == 86)
) {
return true;
}
return false;
}
var _keydown_money = function(event, minus) {
var code = event.which || event.keyCode;
if (code == 110 ||//ŰÆÐµå ¸¶Ä§Ç¥
(!event.shiftKey && code == 190) || //¸¶Ä§Ç¥
(!event.shiftKey && code == 188) ||// ÄÞ¸¶
(minus == undefined &&
(code == 109 || //ŰÆÐµå -
(!event.shiftKey && (code == 109 || code == 189) )
)
) // - ¿¹¿Üó¸®
) {
return true;
}
return false;
}
var _socialRoll = function () {
var isMove = false;
var newRNum;
var newRMax;
var curRnum = 1;
jQuery(".mRollDiv").each(function(q){
//class add
$(this).addClass("r"+(q+1));
//Ãʱâ À§Ä¡¼±Á¤
jQuery(this).find(".unit").each(function(k){
$(this).css("left", k*527);
});
//aCount ¸Æ½º°ª
$(this).find(".aCount").text($(this).find("div > .unit").length)
var currentN = 1;
//¹öư À̺¥Æ®
$(this).find(".bts a").each(function(k){
$(this).click(function(){
if(!isMove) {
isMove = true;
if(!k) {
var curN = parseInt($(this).parents(".mRollDiv").attr("class").split("r")[1])-1;
var lastDetach = $(".mRollDiv").eq(curN).find(".unit:last").detach();
$(".mRollDiv").eq(curN).find(".unitDiv").prepend(lastDetach);
$(".mRollDiv").eq(curN).find(".unit:first").css("left", -527);
$(".mRollDiv").eq(curN).find(".unit").each(function(j){
TweenMax.to($(this), 0.5, {left:parseInt($(this).css("left").split("p")[0]) + 527, ease:Power3.easeOut, onComplete:function(){
isMove = false;
}});
});
currentN--;
if(currentN < 1) currentN = $(".mRollDiv").eq(curN).find("div > .unit").length;
$(".mRollDiv").eq(curN).find(".nCount").text(currentN);
} else {
var curN = parseInt($(this).parents(".mRollDiv").attr("class").split("r")[1])-1;
$(".mRollDiv").eq(curN).find(".unit").each(function(j){
TweenMax.to($(this), 0.5, {left:parseInt($(this).css("left").split("p")[0]) - 527, ease:Power3.easeOut, onComplete:function(){
isMove = false;
if(!j) {
var firstDetach = $(".mRollDiv").eq(curN).find(".unit:first").detach();
$(".mRollDiv").eq(curN).find(".unitDiv").append(firstDetach);
$(".mRollDiv").eq(curN).find(".unit:last").css("left", ($(".mRollDiv").eq(curN).find(".unit").size()-1) * 527);
}
}});
});
currentN++;
if(currentN > $(".mRollDiv").eq(curN).find("div > .unit").length) currentN = 1;
$(".mRollDiv").eq(curN).find(".nCount").text(currentN);
}
}
});
});
});
}
return {
UrlHost: function() {
return getUrlHost();
},
init: function(isMobile) {
$(function() {
isIE7 = !! navigator.userAgent.match(/MSIE 7.0/);
isIE8 = !! navigator.userAgent.match(/MSIE 8.0/);
isIE9 = !! navigator.userAgent.match(/MSIE 9.0/);
isIE10 = !! navigator.userAgent.match(/MSIE 10.0/);
isIE11 = !! navigator.userAgent.match(/MSIE 11.0/);
});
/*$(window).load(function() {
if (isMobile == "True") {
autoImgResize( $("#cBody .subCon .boardView .viewCon .viewD img"), 0);
}
$(window).resize(function() {
autoImgResize( $("#cBody .subCon .boardView .viewCon .viewD img"), 0);
});
});*/
_EditorTab();
_LayerPopUp();
_socialRoll();
},
IsIE: function() {
return isIE7 || isIE8 || isIE9 || isIE10 || isIE11
},
smartTrim: function(string, maxLength) {
return smartTrim(string, maxLength);
},
DeptTreePop: function(url, selector) {
DeptTreePop(url, selector);
},
AddThis: function (obj, initial_) {
AddThis(obj, initial_);
},
RemoveThis: function (obj) {
RemoveThis(obj);
},
checkboxAll: function (obj) {
checkboxAll(obj);
},
safe_tags: function (str) {
return _safe_tags_replace(str);
},
html_tags: function (str) {
return _tags_replace(str);
},
Left: function(str, n) {
return Left(str, n);
},
Right: function(str, n) {
return Right(str, n);
},
SelectText: function(element) {
SelectText(element);
},
getTimeString: function(milisecond) {
return getTimeString(milisecond);
},
resizeTextArea: function(obj) {
obj.style.height = "1px";
obj.style.height = (20 + obj.scrollHeight) + "px";
},
gettab: function() {
return gettab();
},
numComma: function (x) {
x = x.toString().replace(/,/g, "");
//return $.trim(x).toString().replace(/\B(?=(?:\d{3})+(?!\d))/g, ",");
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
},
num: function(x) {
x = x.toString().replace(/,/g, "");
return x;
},
formatBytes: function(bytes, decimals) {
if (decimals != undefined && decimals == null)
{
decimals = 1024;
}
return formatBytes(bytes, decimals);
},
now: function() {
return new Date().getTime();
},
autoImgResize: function(obj, maxSize) {
autoImgResize(obj, maxSize);
},
getBrowserType : function(str){
return getBrowserType();
},
MainPopUp: function (language) {
$(function () {
//var $obj = $(obj);
//var id = $obj.attr("data-id");
var cookiename = "mainpopup" + language;
var cookie = document.cookie;
if (cookie.indexOf(cookiename + "=done") < 0) {
$(".mPopClose").click(function () {
if ($(this).closest(".layerPop").find(":checkbox").is(":checked")) {
_closeWin(cookiename, "done", 24);
}
$(".layerPop").css("display", "none");
$(".blackBg").fadeOut(300);
});
}
});
},
MainMobilePopUp: function (language) {
$(function () {
//var $obj = $(obj);
//var id = $obj.attr("data-id");
var cookiename = "m_mainpopup" + language;
var cookie = document.cookie;
if (cookie.indexOf(cookiename + "=done") < 0) {
$(".mPopClose").click(function () {
if ($(this).closest(".mRollPop").find(":checkbox").is(":checked")) {
_closeWin(cookiename, "done", 24);
}
$(".mRollPop").css("display", "none");
});
}
});
},
BrowserUpdate: function() {
$(function() {
//alert("isIE7:" + isIE7 + "\nisIE8:" + isIE8 + "\nisIE9:" +isIE9+ "\nisIE10:" +isIE10);
if (isIE7 || isIE8 || isIE9 || isIE10) {
var cookie = document.cookie;
if (cookie.indexOf("browserupdate=done") < 0) {
Lib.LayerPopUp($(this), ".browUpPop", ".browUpPop");
$(".browUpPop .popClose").click(function() {
if ($(".browUpPop input:checkbox").is(":checked")) {
_closeWin("browserupdate", "done", 24);
}
});
}
}
});
},
IsPosting:IsPosting,
RegExpEmail:RegExpEmail,
RegExpPhone:RegExpPhone,
RegExpPwd:RegExpPwd,
RegExpBizno:RegExpBizno,
RegExpEng: RegExpEng,
RegExpEngNm : RegExpEngNm,
RegExpKor:RegExpKor,
RegExpNumber:RegExpNumber,
RegExpId:RegExpId,
playWav:function(url) {
//var t = new Date().getTime();
//url += "?t=" + t;
if ($("#sound").size() == 0)
{
$("body").append("")
.append("