function checkIsNan(is,msg){
	if(isNaN(is.value)){
		alert(msg)
		is.value="";
		is.focus();
	}
}
var xmlHttp;
function createXMLHttpRequest() {
    if (window.ActiveXObject) {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    } 
    else if (window.XMLHttpRequest) {
        xmlHttp = new XMLHttpRequest();
    }
}
function getSubCategory(parentIdx) {
    createXMLHttpRequest();
    xmlHttp.onreadystatechange = innerCateHtml;
    xmlHttp.open("GET", "/common/getCategory.jsp?parentIdx="+parentIdx, true);
    xmlHttp.send(null);
}
    
function innerCateHtml() {
    if(xmlHttp.readyState == 4) {
        if(xmlHttp.status == 200) {
        	document.getElementById("innerCate").innerHTML=xmlHttp.responseText;
        }
    }
}
function viewPentaxImages(img){
	var width = (img.width+50 > screen.width) ? screen.width : img.width+50
	var height =(img.height+100 > screen.height) ? screen.height : img.height+100
	window.open("/popUp/bbs_image_view.jsp?img="+img.src,"popUp","fullscreen=no,menubar=no,status=no,toolbar=no,titlebar=no,location=no,scrollbars=no,width="+width+",height="+height)
}
function checkBoxIsVal(name){
	var obj = document.getElementsByName(name);
	for(i=0;i < obj.length;i++){
		if(obj[i].checked) {
			return true;
		}
	}
	return false;
}
function windowOpen(url,name,width,height){
	window.open(url,name,"fullscreen=no,menubar=no,status=no,toolbar=no,titlebar=no,location=no,scrollbars=no,width="+width+",height="+height);
	return;
}
function windowPopUp(url,name,width,height,left,top){
	window.open(url,name,"fullscreen=no,menubar=no,status=no,toolbar=no,titlebar=no,location=no,scrollbars=no,width="+width+",height="+height+",left="+left+",top="+top);
	return;
}
function allCheckBoxChecked(flag,name){
	var obj = document.getElementsByName(name);
	for(i=0;i < obj.length;i++){
		obj[i].checked = flag;
	}
}
function checkIsNaN(obj){
	if(isNaN(obj.value)){
		alert("¼ýÀÚ¸¸ ÀÔ·Â ÇØ ÁÖ¼¼¿ä.");
		obj.value = 0;
		obj.focus();
	}
	return;
}
function getCookie(Name) {
  var search = Name + "="
  if (document.cookie.length > 0) { // ÄíÅ°°¡ ¼³Á¤µÇ¾î ÀÖ´Ù¸é
    offset = document.cookie.indexOf(search)
    if (offset != -1) { // ÄíÅ°°¡ Á¸ÀçÇÏ¸é
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset)
      // ÄíÅ° °ªÀÇ ¸¶Áö¸· À§Ä¡ ÀÎµ¦½º ¹øÈ£ ¼³Á¤
      if (end == -1)
        end = document.cookie.length
      return unescape(document.cookie.substring(offset, end))
    }
  }
  return "";
}
// ¾ÆÀÌµð ÀúÀå
function setCookie (name, value, expires) {
  document.cookie = name + "=" + escape (value) +
    "; path=/; expires=" + expires.toGMTString();
}
