function PutPage(div, url, param, fm){
if(url == "") return false;
var method = "GET";
//pageFocus = $(':focus').attr('id');
//$("#" + pageFocus).blur();
var ret;
var ob = null;
if(div) ob = $("#" + div);
if(fm){
method = "POST";
if(param) param = param + "&" + $(fm).serialize();
else param = $(fm).serialize();
}
if(ob != null && ob.width() != 0) Loading(div);
$.ajax({
url : url,
dataType : "html",
type : method,
data : param,
async : false,
success : function(result){
if(ob != null){
ob.html(result);
ob.css('border-style', 'none');
ob.css('width', 'auto');
ob.css('height', 'auto');
}else{
ret = result;
}
},
error : function(error){
//alert("Á˼ÛÇÕ´Ï´Ù. Àá½ÃÈÄ¿¡ ´Ù½Ã ½ÃµµÇϼ¼¿ä.");
}
});
//if(pageFocus) $("#" + pageFocus).select();
if(ret) return ret;
}
function Loading(div,border){
var ob = $("#" + div);
var guideText = "
";
ob.css('text-align', "center");
ob.css('width', ob.width());
ob.css('height', ob.height());
ob.html("");
if(border > 0){
ob.css('border-style', 'solid');
ob.css('border-color', '#F7F7F7');
}
ob.html(guideText);
}
function GetMegabyte(size){
return Math.ceil(size / 1024 / 1024 * 100) / 100;
}
function GetCookie(name) {
var cookies = document.cookie.split("; ");
for (var i = 0; i < cookies.length; i++) {
var [key, value] = cookies[i].split("=");
if (key === name) {
return value;
}
}
return null; // ÇØ´ç À̸§ÀÇ Äí۰¡ ¾øÀ» ¶§
}
function SetCookie(name, value, days) {
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
var expires = "expires=" + date.toUTCString();
document.cookie = name + '=' + value + '; ' + expires + '; path=/';
}
function Alert(mesg,x,opt){
if(mesg != -1){
if(!mesg) mesg = "ÀϽÃÀûÀÎ Àå¾Ö¹ß»ý\n\n°í°´¼¾ÅÍ·Î ¹®ÀÇÇϼ¼¿ä";
// È£Ãâ Àü Æ÷Ä¿½Ì
pageFocus = $(':focus').attr('id');
$("#" + pageFocus).blur();
ScreenDisabled();
if(!$('#div_alert').length){
var newDiv = $("");
$(parent.document.body).append(newDiv);
$('#div_alert',parent.document).css('width','auto');
$('#div_alert',parent.document).css('position','fixed');
$('#div_alert',parent.document).css('left','50%');
$('#div_alert',parent.document).css('z-index','100');
$('#div_alert',parent.document).css('overflow','hidden');
$('#div_alert',parent.document).css('text-align','right');
if(x != 1) $('#div_alert',parent.document).html(" X ");
$('#div_alert',parent.document).append("");
}
$('#div_alert_mesg',parent.document).html(mesg.replace(/\n/g,'
'));
$('#div_alert',parent.document).show();
$('#div_alert',parent.document).css('top', window.innerHeight / 2 - 70);
$('#div_alert',parent.document).css('margin-left',$('#div_alert',parent.document).width() / 2 * -1);
if(opt){
$('#div_alert',parent.document).css('cursor','default');
$('#div_alert_table',parent.document).attr('onClick','');
$('#div_alert_mesg',parent.document).append(opt);
}else{
$('#div_alert',parent.document).css('cursor','pointer');
//$('#div_alert_table',parent.document).attr('onClick','Alert(-1)');
}
}else{
$('#div_alert',parent.document).hide();
$('#div_alert_mesg',parent.document).text('');
ScreenDisabled(0);
}
}
function Hex2Rgba(hex, alpha) {
// 16Áø¼ö »ö»ó Äڵ忡¼ RGB °ª ÃßÃâ
var r = parseInt(hex.substring(1, 3), 16); // »¡°£»ö (Red)
var g = parseInt(hex.substring(3, 5), 16); // ÃÊ·Ï»ö (Green)
var b = parseInt(hex.substring(5, 7), 16); // ÆÄ¶õ»ö (Blue)
return 'rgba(' + r + ', ' + g + ', ' + b + ', ' + alpha + ')'; // rgba Çü½ÄÀ¸·Î ¹Ýȯ
}
function FocusHelper(items) {
var steps = (items || [])
.map(function (arr) {
var selector = arr[0];
var intro = arr[1];
var position = arr[2];
var node = document.querySelector(selector);
if (!node) return null;
var step = {
element: node,
intro: intro || " "
};
if (typeof position === "string") {
step.position = position;
}
return step;
})
.filter(Boolean);
if (!steps.length) return null;
var intro = introJs();
var baseOptions = {
steps: steps,
nextLabel: '´ÙÀ½',
prevLabel: 'ÀÌÀü',
doneLabel: '¿Ï·á',
showStepNumbers: false,
exitOnOverlayClick: true,
};
if (steps.length === 1) {
intro.setOptions({
...baseOptions,
//doneLabel: '´Ý±â',
showButtons: false,
showProgress: false,
showStepNumbers: false,
showBullets: false,
});
} else {
intro.setOptions({
...baseOptions,
showProgress: false,
showBullets: true,
});
}
intro.start();
requestAnimationFrame(() => intro.refresh());
setTimeout(() => intro.refresh(), 50);
setTimeout(() => intro.refresh(), 150);
setTimeout(() => intro.refresh(), 300);
intro.onafterchange(() => {
requestAnimationFrame(() => intro.refresh());
setTimeout(() => intro.refresh(), 80);
});
return intro;
}
function ScreenDisabled(md){
var ob = parent.document;
if(md == undefined || md == 1){
if(!$('#screen_disabled').length){
var newDiv = $("");
$(ob.body).append(newDiv);
$('#screen_disabled',ob).css('top','0');
$('#screen_disabled',ob).css('left','0');
$('#screen_disabled',ob).css('position','absolute');
$('#screen_disabled',ob).css('width','100%');
$('#screen_disabled',ob).css('background-color','#000000');
$('#screen_disabled',ob).css('opacity',0.25);
$('#screen_disabled',ob).css('z-index','90');
}
$('#screen_disabled',ob).css('height',$(ob).height());
$('#screen_disabled',ob).css('display','inline');
}else{
$("#screen_disabled",ob).css("display","none");
}
}
function setGuestCount(cont){
PutPage('','/_inc/collection.htm','&call_type=set_add_guest&cont=' + cont);
}