function yjLayer(st) {

    if( st == 'i' ) {
	document.getElementById('m_menu').style.zIndex = 200;
    }else {
	document.getElementById('m_menu').style.zIndex = 0;
    }

}

function yjFlash(file, bg, ww, hh) {
    html  = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ';
    html += ' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ';
    html += ' width="'+ww+'" height="'+hh+'" align="middle">';
    html += '<param name="movie" value="'+file+'" '+'\/>';
    html += '<param name="allowScriptAccess" value="always">'; // Äü¸Þ´º¿¡ _self°¡ Àû¿ëÀÌ Àß ¾ÈµÇ¾î Ãß°¡ÇÔ
    html += '<param name="quality" value="high" '+'\/>';
    html += '<param name="wmode" value="transparent" '+'\/>';
    html += '<param name="bgcolor" value="'+bg+'" '+'\/>';
    html += '<embed src="'+file+'" ';
    html += ' quality="high" wmode="transparent" ';
    html += ' bgcolor="'+bg+'" width="'+ww+'" height="'+hh+'" ';
    html += ' align="middle" type="application/x-shockwave-flash" ';
    html += ' pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always" '+'\/>';
    html += '<'+'\/object>';
    document.write(html);
}
function yjFlash2(file, id, bg, ww, hh) {
    html  = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ';
    html += ' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ';
    html += ' width="'+ww+'" height="'+hh+'" id="'+id+'" align="middle">';
    html += '<param name="movie" value="'+file+'" '+'\/>';
	html += '<param name="allowScriptAccess" value="always"\/>'; // Äü¸Þ´º¿¡ _self°¡ Àû¿ëÀÌ Àß ¾ÈµÇ¾î Ãß°¡ÇÔ
    html += '<param name="quality" value="high" '+'\/>';
    html += '<param name="wmode" value="transparent" '+'\/>';
    html += '<param name="bgcolor" value="'+bg+'" '+'\/>';
    html += '<embed src="'+file+'" id="'+id+'" ';
    html += ' quality="high" wmode="transparent" ';
    html += ' bgcolor="'+bg+'" width="'+ww+'" height="'+hh+'" ';
    html += ' align="middle" type="application/x-shockwave-flash" ';
    html += ' pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always" '+'\/>';
    html += '<'+'\/object>';
    document.write(html);
}
function yjMovie(file, ww, hh) {
    html  = '<embed src="'+file+'" width="'+ww+'" height="'+hh+'" autostart="1" loop=1 showcontrols="1" id="mplayer" name="mplayer" enablecontextmenu="0" allowFullScreen="true">';
    html += '</embed>';
    document.write(html);
}

function yjMovie2(file, ww, hh) {
    toolbar = 1;
    html  = '<embed src="'+file+'" width="'+ww+'" height="'+hh+'" autostart="1" loop=1 showcontrols="'+toolbar+'" id="mplayer" name="mplayer" enablecontextmenu="0" >';
    html += '</embed>';
    document.write(html);
}

function clickMenu(mdl, url, sid, target, subID, d, UID){
    subID = 'sub'+subID;

    if(d != 3 && document.getElementById(subID)){
        if(document.getElementById(subID).style.display == "block"){
            document.getElementById(subID).style.display = "none";
        }else{
            document.getElementById(subID).style.display = "block";
        }
    }
    if( mdl && url ){
        if(mdl == 'board' || mdl == 'gallery' || mdl == 'data' || mdl == 'notice' || mdl == 'news' || mdl == 'express' ){
            pUrl = '../'+mdl+'/list.php?pid='+url;
        }else if(mdl == 'poll'){
            pUrl = '../'+mdl+'/list.php';
        }else if(mdl == 'url'){
            if(url.indexOf('mailto:')==-1&&url.indexOf('http:')==-1) url='http://'+url;
            pUrl = url;
        }else if( mdl == 'page' || mdl == 'link' ){
            pUrl = '../'+mdl+'/'+mdl+'.php?pid='+url;
        }else if( mdl == 'mypage' ){
            pUrl = '../'+mdl+'/'+url+'.php';
        }else if( mdl == 'car' ){
            if( url.substring(0,9) == 'car_info_' ){
                pUrl = '../'+mdl+'/car_info.php?p='+url.substring(9);
            }else{
                pUrl = '../'+mdl+'/'+url+'.php';
            }
        }else if( mdl == 'guestroom' ){
			pUrl = '../lodge/room.php?pid='+url;
		}else if( mdl == 'reserv' ){
			pUrl = '../lodge/list.php';
		}else if( mdl == 'shop' ){
            pUrl = '../'+mdl+'/list.php?cid='+url;
        }else if( mdl == 'policy' ){
            pUrl = '../'+mdl+'/privacy.php';
        }else{
            pUrl = '../'+mdl+'/'+mdl+'.php';
        }
        if( target == '_self' ){
            window.location = pUrl;
        }else{
            window.open(pUrl,target);
        }
    }
}

// for skuty
function clickMenu_skuty(mdl, url, sid, target, subID, d, UID){
    subID = 'sub'+subID;

    if(d != 3 && document.getElementById(subID)){
        if(document.getElementById(subID).style.display == "block"){
            document.getElementById(subID).style.display = "none";
        }else{
            document.getElementById(subID).style.display = "block";
        }
    }
    if( mdl && url ){
        if(mdl == 'board' || mdl == 'gallery' || mdl == 'data' || mdl == 'notice' || mdl == 'news' || mdl == 'express' ){
            pUrl = dubuServiceURL+ '/'+mdl+'/list.php?pid='+url;
        }else if(mdl == 'poll'){
            pUrl = dubuServiceURL+ '/'+mdl+'/list.php';
        }else if(mdl == 'url'){
            if(url.indexOf('mailto:')==-1&&url.indexOf('http:')==-1) url='http://'+url;
            pUrl = url;
        }else if( mdl == 'page' || mdl == 'link' ){
            pUrl = dubuServiceURL+ '/'+mdl+'/'+mdl+'.php?pid='+url;
        }else if( mdl == 'mypage' ){
            pUrl = dubuServiceURL+ '/'+mdl+'/'+url+'.php';
        }else if( mdl == 'car' ){
            if( url.substring(0,9) == 'car_info_' ){
                pUrl = dubuServiceURL+ '/'+mdl+'/car_info.php?p='+url.substring(9);
            }else{
                pUrl = dubuServiceURL+ '/'+mdl+'/'+url+'.php';
            }
        }else if( mdl == 'guestroom' ){
			pUrl = dubuServiceURL+ '/lodge/room.php?pid='+url;
		}else if( mdl == 'reserv' ){
			pUrl = dubuServiceURL+ '/lodge/list.php';
		}else if( mdl == 'shop' ){
            pUrl = dubuServiceURL+ '/'+mdl+'/list.php?cid='+url;
        }else if( mdl == 'policy' ){
            pUrl = dubuServiceURL+ '/'+mdl+'/privacy.php';
        }else{
            pUrl = dubuServiceURL+ '/'+mdl+'/'+mdl+'.php';
        }
        if( target == '_self' ){
            window.location = pUrl;
        }else{
            window.open(pUrl,target);
        }
    }
}

function yjOpenEditWin(ff,ww,hh,nn) {
    if( nn ) {
	windowName = nn;
    }else {
	windowName = 'editWin';
    }
    var editWin = window.open (ff, windowName, 'scrollbars=no,status=no,width='+ww+',height='+hh);
    editWin.focus();
}
function yjCloseWin() {
    window.close();
}
function yjOpenImageWin(ff) {
    var imageWin = window.open ('../image_viewer.php?ff='+ff, 'imageWin', 'scrollbars=yes,status=no');
    imageWin.focus();
}
function yjCharge() {
    yjOpenEditWin('http://www.dubuweb.com/bank/bank_charge.php', 650, 507, 'KCPPAGE');
}
function yjViewBankbook() {
    yjOpenEditWin('http://www.dubuweb.com/bank/bankbook_cash.php', 650, 507, 'KCPPAGE');
}
var moz;
var initTop;
function initQuickMenu(m) {
    moz = m;
    qmenu = document.getElementById('quickmenu');
    initTop = qmenu.offsetTop;
    sHeight = document.body.scrollHeight;
    if( moz == 'Y' ) {
        qmenu.style.top = top.pageYOffset + 100;
        qmenu.style.visibility = "visible";
    } else {
        qmenu.style.top = document.body.scrollTop + initTop;// + 100;
        qmenu.style.visibility = "visible";
    }
    if(document.getElementById('id="txt_search')){
        document.getElementById('id="txt_search').value = moz;
    }
    CheckUIElements();
}
function kkk(){
    qmenu = document.getElementById('quickmenu');
    alert(qmenu.offsetTop);
}
function CheckUIElements(){
    var yMenuFrom, yMenuTo, yButtonFrom, yButtonTo, yOffset, timeoutNextCheck;
    qmenu = document.getElementById('quickmenu');
    if( moz == 'Y' ){
        yMenuFrom  = qmenu.style.top;
        yMenuTo    = top.pageYOffset + 182;
    } else {
        yMenuFrom  = parseInt (qmenu.style.top, 10);
        yMenuTo    = document.body.scrollTop + initTop;   // ½½¶óÀÌµù ·¹ÀÌ¾î °ª¼³Á¤ 188
    }
	if( yMenuTo > document.body.scrollHeight - qmenu.offsetHeight ){
        yMenuTo = sHeight - qmenu.offsetHeight;
    }
    timeoutNextCheck = 50;
    if( Math.abs (yButtonFrom - (yMenuTo + 152)) < 6 && yButtonTo < yButtonFrom ){
        setTimeout ("CheckUIElements()", timeoutNextCheck);
        return;
    }

    if ( yButtonFrom != yButtonTo ) {
        yOffset = Math.ceil( Math.abs( yButtonTo - yButtonFrom ) / 10 );
        if ( yButtonTo < yButtonFrom ){
            yOffset = -yOffset;
        }
        if ( moz == 'Y' ){
            qmenu.style.top += yOffset;
        }else{
            divLinkButton.style.top = parseInt (divLinkButton.style.top, 10) + yOffset;
        }
        timeoutNextCheck = 10;
    }
    if ( yMenuFrom != yMenuTo ) {
        yOffset = Math.ceil( Math.abs( yMenuTo - yMenuFrom ) / 20 );
        if ( yMenuTo < yMenuFrom ){
            yOffset = -yOffset;
        }
        if (moz == 'Y'){
            qmenu.style.top += yOffset;
        }else{
            qmenu.style.top = parseInt (qmenu.style.top, 10) + yOffset;
        }
        timeoutNextCheck = 10;
    }
    setTimeout ("CheckUIElements()", timeoutNextCheck);
}



function yjHelp(){
    window.open ('http://www.dubuweb.com/manual/manual.php', 'helpPopup', 'scrollbars=no,status=no,top=100,left=100,width=800,height=600');
}

function yjNumberFormat(price) {
    var nfPrice = "";
    price = price + '';
    j = 0;
    for( i=price.length; i>0; i-- ) {
        if( j % 3 == 0 && j!=0 ) {
            nfPrice = price.substring(i,i-1) + "," + nfPrice;
        } else {
            nfPrice = price.substring(i,i-1) + nfPrice;
        }
        j++;
    }
    return nfPrice;
}

function yjGotoDemo(str) {
    var str = str || '';
    demoWin = window.open('find_demo.php?tp='+str, 'mainPages', 'toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=481,height=420');
    demoWin.focus();
}
function yjOpenSample(str) {
    no = rand(3);
    if( str == 's' ) no = 4;
    sampleWin = window.open('http://sample'+no+'.dubuweb.com', 'sample');
    sampleWin.focus();
}
function rand ( n ) {
  return ( Math.floor ( Math.random ( ) * n + 1 ) );
}


var scriptObj=null;
function yjJScriptRequest(fullUrl) {
    var noCacheIE ="&noCacheIE="+(new Date()).getTime();
    var headLoc = document.getElementsByTagName("head").item(0);
    if(scriptObj!=null) headLoc.removeChild(scriptObj);
    scriptObj = document.createElement("script");
    scriptObj.setAttribute("type", "text/javascript");
    scriptObj.setAttribute("src", fullUrl + noCacheIE);
    scriptObj.setAttribute("id", "jscriptid_100");
    headLoc.appendChild(scriptObj);
}
function yjSearchArray(str, arr){
    var key = false;
    for( var i = 0; i < arr.length; i++ ){
        if( arr[i] == str ){ key = i; break; }
    }
    return false || key;
}
function yjGetChildNode(obj){
    if( typeof obj != "object" ) return false;
    var cNode = obj.childNodes, arr = new Array();
    if( isIE ) return cNode;
    for( var i = 0; i < cNode.length; i++ ){
        if( cNode[i].nodeName != "#text" ) arr.push(cNode[i]);
    }
    return arr;
}
function yjCheckEscrow(type, eid){
	var openUrl, w, h;
	if( type == 'K' ){
		openUrl = 'http://ibn1.kbstar.com/quics?page=A010563&cc=a002346:a047278&mHValue='+eid;
		w = h = 700;
	} else if( type == 'W' ){
		openUrl = 'http://'+location.host+'/mypage/escrow_check.php?tp='+type;
		w = 600;
		h = 436;
		if( window.navigator.appVersion.indexOf('MSIE') == -1 ){
			w = 617;
		}
	} else if( type == 'H' ){
		openUrl = 'http://escrow.nonghyup.com/escrow/ebap5414.jsp?certMarkURLKey='+eid;
		w = 650; h = 700;
	}
	window.open(openUrl, 'escrow', 'width='+ w +', height='+ h);
}
function getCookie(name) {
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    } else {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}
function SendTodayData(){
    var _url = getCookie('TODAY_P_URL');
    var _img = getCookie('TODAY_P_IMG');
    if( _url ) _url = _url.split('^T');
    if( _img ) _img = _img.split('^T');
    try{
        document['Fl_TodayProduct'].SetTodayProduct(_url, _img);
    }
    catch(e){
        document.embeds['Fl_TodayProduct'].SetTodayProduct(_url, _img);
    }
}
function yjSetFlMenuScale(_id, w, h){
    var fl = document.getElementById(_id);
    fl.width = w;
    fl.height = h;
    fl.getElementsByTagName("embed")[0].setAttribute("width", w);
    fl.getElementsByTagName("embed")[0].setAttribute("height", h);
}
function yjNotOpen(ids, str){
    var now = new Date();
    var popup = document.getElementById(ids);
    var domain = location.host;
    var midNight = new Date(now.getFullYear(), now.getMonth(), now.getDate(), '23', '59', '59');
    if( str == 'Y' ){
        setCookie(ids,"Y", midNight, "/", domain, 0);
    }
    popup.style.display = "none";
}

var isIE = window.navigator.appName.indexOf('Microsoft') >= 0 ? true : false;

function setPng24(obj) {
 var request_os = window.navigator.userAgent;
 var os_array = request_os.split(";");

 if(os_array[1] != " MSIE 7.0") {
  if(os_array[1] != " MSIE 8.0"){
   obj.width=obj.height=1;
   obj.className=obj.className.replace(/img_tp/i,'');
   obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');";
   obj.src='';
  }
 }

 return '';
 }