$(document).ready(function(){
if (matchMedia("screen and (max-width:767px)").matches) {
$('.s7 .board_output:not(.nct) > tbody > tr:last-child()').hide();
mpop()
m_news()
s1_m();
}else if(matchMedia("screen and (min-width:768px)").matches){
s1();
};
});
function s1(){
//¸ÞÀν½¶óÀÌ´õ
var $tg = $(".s1");
$tg.find('>ul').bxSlider({
auto:true,
autoDelay:10000,
pager:true,
pagerSelector:$tg.find('> .pg'),
controls:false
})
};
function s1_m(){
//¸ÞÀν½¶óÀÌ´õ
var $tg = $(".s1_m");
$tg.find('>ul').bxSlider({
mode:'horizontal',
auto:($tg.find('>ul').children().length > 1) ? true: false,
autoDelay:10000,
adaptiveHeight:true,
touchEnabled:true,
pager:($tg.find('>ul').children().length > 1) ? true: false,
pagerSelector:$tg.find('.pg'),
controls:false
})
};
function m_news(){
$('.s7 .board_output:not(.nct) > tbody > tr:first-child').each(function() { //white-header is the class used for
var tr = $(this);
var td1 = tr.find('> td:eq(0)').html();
var td2 = tr.find('> td:eq(1)').html();
tr.find('> td').attr('width','50%');
});
}
//Æ˾÷
function mpop(){
var $el = $('.popbox:visible');
if($el.length ){
$('body').css('overflow','hidden');
$('body').bind('touchmove', function(e){e.preventDefault()});
$el.each(function() {
var idx = $el.index($(this));
var $eqs = $el.eq(idx);
var $elWidth = $eqs.outerWidth(),
$elHeight = $eqs.find('img').outerHeight() + 30,
docWidth = $(window).width(),
docHeight = $(window).height();
// ȸéÀÇ Áß¾Ó¿¡ ·¹À̾ ¶ç¿î´Ù.
//alert(docHeight+"/"+$elHeight)
if (docHeight < $elHeight) {
$eqs.css({'height':docHeight*0.95,'margin-top':-(docHeight*0.95)/2})
$eqs.find('>.pop_con').css({'height':docHeight*0.95-30,'overflow':'auto'})
} else {
$eqs.css({'height':$elHeight,'margin-top':-($elHeight)/2})
$eqs.find('>.pop_con').css({'height':$elHeight-30})
}
});
};
};
//Æ˾÷¾øÀ»½Ã ¹è°æ ¾È¶ß°Ô
function nonbg(){
//alert($('.popbox[style*="visibility: visible]').length);
if($('.popbox:not([style*="visibility: hidden"])').length > 0){
$('.popbox').wrapAll('')
}else{
$('body').css('overflow','');
$('body').unbind('touchmove');
};
};
function popnum(){
if($('.popbox:not([style*="visibility: hidden"])').length == 0) {
$('.popboxbg').hide();
$('body').css('overflow','');
$('body').unbind('touchmove');
}
};
function setCookie( name, value, expiredays ) {
var todayDate = new Date();
todayDate.setDate( todayDate.getDate() + expiredays );
document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
function closeWin(div, chk, cookname) {
if ( document.getElementById(chk).checked ){
setCookie(cookname, "done", 1);
}
document.getElementById(div).style.visibility = "hidden";
popnum()
}
window.onload = function() {
cookiedata = document.cookie;
/* popup1 */
if ( cookiedata.indexOf("maindiv=done") < 0 ){
document.getElementById('divpop').style.visibility = "visible";
} else {
document.getElementById('divpop').style.visibility = "hidden";
}
/* popup2 */
if ( cookiedata.indexOf("maindiv2=done") < 0 ){
document.getElementById('divpop2').style.visibility = "visible";
} else {
document.getElementById('divpop2').style.visibility = "hidden";
}
nonbg()
}