function setCookie(name, value, expiredays) {
    var today = new Date();
    today.setDate(today.getDate() + expiredays);
    document.cookie = name + "=" + escape(value) + ";path=/;expires=" + today.toGMTString() + ";";
}
function ajaxRequest(callUrl, param, callbackFunction) {
	var httpObj	=	new Ajax.Request(
		callUrl,
		{
			asynchronous : true,
			parameters : param,
			onLoading : function() {
			},
			method: "post",
			onSuccess : callbackFunction,
			onFailure : function(){ 
				//alert("error"); 
			},
			onComplete : function() {
			}
		}
	);
}
function onlyNum(obj) {
    var val = obj.value;
    var re = /[^0-9\,]/gi;
    obj.value = val.replace(re, '');
}
String.prototype.comma = function() {
    tmp = this.split('.');
    var str = new Array();
    var v = tmp[0].replace(/,/gi,'');
    for(var i=0; i<=v.length; i++) {
        str[str.length] = v.charAt(v.length-i);
        if(i%3==0 && i!=0 && i!=v.length) {
            str[str.length] = '.';
        }
    }
    str = str.reverse().join('').replace(/\./gi,',');
    return (tmp.length==2) ? str + '.' + tmp[1] : str;
}

//·¦ ¾º¿ì´Â ÇÔ¼ö
function lockPage(objName) {
 var lockPane = document.getElementById(objName);
 //lockPane.style.width = getWindowWidth();
 //lockPane.style.height = getWindowHeight();
 lockPane.style.display = "block";
 //lockPane.onclick = "return false";
 //lockPane.onclick = "return false";
 // ·¦Àº °¡Àå ¹Ù±ùÂÊ¿¡ ¾º¿ö¾ß ÇÑ´Ù.
 lockPane.style.zIndex = 90;
 // ·¦Àº Á¶±Ý Åõ¸íÇØ¾ß ³»¿ë¹°ÀÌ º¸ÀÎ´Ù.
 setOpacity(lockPane, 5);
}



// ·¦ ¹þ±â´Â ÇÔ¼ö
function unLockPage(objName) {
 var lockPane = document.getElementById(objName);
 //document.body.style.cursor = 'auto';
 lockPane.style.display = "none";
 setOpacity(lockPane, 10);
}
 
// Åõ¸íµµ ¼³Á¤ ÇÔ¼ö
function setOpacity(obj, value) {
  obj.style.opacity = value / 10;
  obj.style.filter = 'alpha(opacity=' + value * 10 + ')';
}
// ºê¶ó¿ìÀúÀÇ ¹®¼­¿µ¿ª ³ôÀÌ °¡Á®¿À±â
function getWindowHeight() {
  var windowHeight = 0;
  if (typeof (window.innerHeight) == 'number') {
      windowHeight = window.innerHeight;
  }
  else {
      if (document.documentElement && document.documentElement.clientHeight) {
          windowHeight = document.documentElement.clientHeight;
      }
      else {
          if (document.body && document.body.clientHeight) {
              windowHeight = document.body.clientHeight;
          }
      }
  }
  return windowHeight;
}
// ºê¶ó¿ìÀúÀÇ ¹®¼­¿µ¿ª ³Êºñ °¡Á®¿À±â
function getWindowWidth() {
  var windowWidth = 0;
  if (typeof (window.innerWidth) == 'number') {
      windowWidth = window.innerWidth;
  }
  else {
      if (document.documentElement && document.documentElement.clientWidth) {
          windowWidth = document.documentElement.clientWidth;
      }
      else {
          if (document.body && document.body.clientWidth) {
              windowWidth = document.body.clientWidth;
          }
      }
  }
  return windowWidth;
}
function imageOver(imgs) {
	imgs.src = imgs.src.replace("off.gif", "on.gif");
}
function imageOut(imgs) {
	imgs.src = imgs.src.replace("on.gif", "off.gif");
}

try{
	$(document).ready(function(){
		var options = { 'speed' : 500, // ½ºÇÇµå
						'initTop':240 ,  // ±âº» top À§Ä¡
						'alwaysTop' : false, // Ç×»ó°íÁ¤ true , false ÀÌµ¿
						'default_x' : '#header'  //·¹¾î¾Æ¿ôÀÌ °¡¿îµ¥ Á¤·Ä ÀÏ¶§ ·¹ÀÌ¾î°¡ ºÙ´Â ¾ÆÀÌµð°ª
					   }
		if( $('#floater').length > 0 ) {
			$('#floater').Floater(options);
		}
	});
}catch(e){
	
}

/* LEFT ¸Þ´º ÀÌ¹ÌÁö º¯°æ */
try {
	$(document).ready(function(){
		$('.snb').find('img').mouseover(function() {
	        var imgs = $(this).attr('src');
	        imgs = imgs.replace('_off.gif','_on.gif');
	        $(this).attr("src",imgs);
		}).mouseout(function(){
	        var imgs = $(this).attr('src');
	        if( imgs != $('.m_img_on').attr('src') ) {
	        	imgs = imgs.replace('_on','_off');
	        }
	        $(this).attr('src',imgs);
		});		
	});
}catch(e){
	
}
