//document.domain="www.dimaent.com";
//alert(document.domain);

if (document.domain != "www.dimaent.com") location.href = "http://www.dimaent.com";

function newOpen(url,name,mwidth,mheight,top,left,resizable,scrollbars,status,position,msg) {
	// Ã¢ È­¸é°¡¿îµ¥·Î ¶ç¿ì±â //
	if(position=="CENTER") {
		top = (window.screen.availHeight - mheight) / 2;
		left = (window.screen.availWidth - mwidth) / 2;
		if (top < 0) Top = 0;
		if (left < 0) Left = 0;
	}

	if(msg.length > 0) {
		if(confirm(msg)) {
			eval('window.open(url,name,"top='+top+'px,left='+left+'px,width='+mwidth+'px,height='+mheight+'px,resizable='+resizable+',scrollbars='+scrollbars+',status='+status+'")');
		} else {
			return false;
		}
	} else {
		eval('window.open(url,name,"top='+top+'px,left='+left+'px,width='+mwidth+'px,height='+mheight+'px,resizable='+resizable+',scrollbars='+scrollbars+',status='+status+'")');
	}
}

function divMainNews(num)
{
	divNews1.style.display = "none";
	divNews2.style.display = "none";
	divNews3.style.display = "none";
	
	eval("divNews" + num).style.display = "block";
}

String.prototype.bytes = function() 
{
    var str = this;
    var l = 0;
    for (var i=0; i<str.length; i++) 
        l += (str.charCodeAt(i) > 128) ? 2 : 1;

    return l;
}


function strLenCnt(str,lengths)	//¹®ÀÚ¿­ÀÇ Æ¯Á¤ ±æÀÌ¸¦ ¹ÝÈ¯ÇÑ´Ù.
{
  var len = 0;
  var newStr = '';
  
  for (var i=0;i<str.length; i++) {
    var n = str.charCodeAt(i);
    var nv = str.charAt(i);
    if ((n>= 0)&&(n<256)) {
      len ++;
    } else {
      len += 2;
	}

	if (len>lengths)
		break;
	else
		newStr = newStr + nv;
  }

  return newStr;
}

function getCookie( name )
{
	var nameOfCookie = name + "=";
    var x = 0;
    while ( x <= document.cookie.length )
    {
		var y = (x+nameOfCookie.length);
        if ( document.cookie.substring( x, y ) == nameOfCookie )
		{
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
				endOfCookie = document.cookie.length;
                return unescape( document.cookie.substring( y, endOfCookie ) );
		}
        x = document.cookie.indexOf( " ", x ) + 1;
        if ( x == 0 )
			break;
	}
    return;
}

