// ºê¶ó¿ìÁ®º° ÆË¾÷Ã¢ ¸®»çÀÌÁî
var Browser = new Object();
Browser.isIE = (navigator.userAgent.toLowerCase().indexOf("msie")!=-1);
Browser.isIE_SV1 = (navigator.userAgent.toLowerCase().indexOf("sv1")!=-1);
Browser.isIE_SV2 = (navigator.userAgent.toLowerCase().indexOf("sv2")!=-1);
Browser.isIE_7 = (navigator.userAgent.toLowerCase().indexOf("msie 7")!=-1);
Browser.isFirefox = (navigator.userAgent.toLowerCase().indexOf("firefox")!=-1);
Browser.isSafari = (navigator.userAgent.toLowerCase().indexOf("safari")!=-1);
Browser.isOpera = (navigator.userAgent.toLowerCase().indexOf("opera")!=-1);
Browser.isNetscape = (navigator.userAgent.toLowerCase().indexOf("netscape")!=-1);
Browser.isEtc = (navigator.userAgent.toLowerCase().indexOf("gecko")!=-1 && navigator.userAgent.toLowerCase().indexOf("firefox")==-1 && navigator.userAgent.toLowerCase().indexOf("netscape")==-1 );

function resizePopup() {
  var h=0;
  var popHeight = document.getElementById("popWrap").offsetHeight+34;

  if (Browser.isIE_SV1) { h = 14; }
  else if(Browser.isIE_7) { h = 18; }
  else if(Browser.isEtc) { h = 22; }
  else if(Browser.isFirefox) { h = 32; }
  else if(Browser.isNetscape) { h = -2; }
  else if(Browser.isOpera) { h = 26; }
  else { h = 0; }

  window.resizeTo(500,popHeight+h);
}
// Usage:
// window.onload=function() { resizePopup(); }

// Áñ°ÜÃ£±â
function addbookmark() {
  bookmarkurl = "http://www.all.or.kr/";
  bookmarktitle="Àü±¹³×Æ®¿öÅ© NO.1 ÇÑ±¹ºÎµ¿»ê´åÄÄÀÔ´Ï´Ù.";
  if (document.all) window.external.AddFavorite(bookmarkurl,bookmarktitle);
}

// ¼ýÀÚ¿¡ comma Âï±â
function costFormat(n){ 
  var costNum = n.split(',').join(''); 
  var costArr = costNum.split('.'); 
  var costInt = String(parseInt(costArr[0],10)); 
  var costFloat = costArr[1]; 
  var costIntText = ''; 
  var len = costInt.length; 
  for (var i=0;i<len;i++){ 
    if (i>0 && i%3==0) costIntText = ','+costIntText; 
    costIntText = costInt.charAt(len-i-1)+costIntText; 
  } 
  if (typeof costFloat == 'string') costIntText += '.'+costFloat; 

  return costIntText; 
} 
// Usage:
// alert(costFormat('0012,00000')); 
// alert(costFormat('1234567890.50')); 
// alert(costFormat('12,3456')); 
// alert(costFormat('12,3456.'));




// ie, ff Àü¿ë ½ºÅ©¸³Æ®(resizeTo ´ëÃ¼)
function resizeHeightStyleFormat(divName,frameName) {
  try
  {
    var h = document.body.scrollHeight;
    // alert(h + "..." + divName + "..." + frameName)
    if (divName != null && divName != "") parent.document.getElementById(divName).style.height = h+"px";
    if (frameName != null && frameName != "") parent.document.getElementById(frameName).style.height = h+"px";
  }catch (e) {}
}
// Usage:
// resizeHeightStyleFormat('dr_ui_ad','bann'); 
// resizeHeightStyleFormat('','bann'); 

function viewSearchType(){
  var sTypeLIst = document.getElementById("sType_list");
  if(sTypeLIst.style.display=="block"){
    sTypeLIst.style.display="none";
  }else{
    sTypeLIst.style.display="block";
  }
}

function selectSchType(obj,val){
  var tobj = obj.parentNode;
  var typeTxt = tobj.getElementsByTagName('label')[0].innerHTML;

  document.getElementById('sType').innerHTML = typeTxt;
  document.getElementById('cate').value = val;
  viewSearchType();
}

(function(){
	/*Use Object Detection to detect IE6*/
	var  m = document.uniqueID /*IE*/
	&& document.compatMode  /*>=IE6*/
	&& !window.XMLHttpRequest /*<=IE6*/
	&& document.execCommand ;
	
	try{
		if(!!m){
			m("BackgroundImageCache", false, true) /* = IE6 only */ 
		}
	}catch(oh){};
})();