document.domain='nate.com';

/*
	°øÅë»ç¿ë ÇÔ¼öµé
	
	@ happymiya / 2006.12.06
 */

function openWindow(pURL, pWinName, pWidth, pHeight)
{
	w = pWidth;
	h = pHeight;
	sx = (screen.width - w)/2;
	sy = (screen.height - h)/2;
	mywin = window.open(pURL,pWinName,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=yes,width='+w+',height='+h+',top='+sy+',left='+sx);
	mywin.focus();
}

function openWindow_noResizable(pURL, pWinName, pWidth, pHeight)
{
	w = pWidth;
	h = pHeight;
	sx = (screen.width - w)/2;
	sy = (screen.height - h)/2;
	mywin = window.open(pURL,pWinName,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=no,width='+w+',height='+h+',top='+sy+',left='+sx);
	mywin.focus();
}

function openWindow_noScrollbars(pURL, pWinName, pWidth, pHeight)
{
	w = pWidth;
	h = pHeight;
	sx = (screen.width - w)/2;
	sy = (screen.height - h)/2 ;
	mywin = window.open(pURL,pWinName,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+w+',height='+h+',top='+sy+',left='+sx);
	mywin.focus();
}

function openWindowToolbar(pURL, pWinName)
{
	mywin = window.open(pURL,pWinName);
	mywin.focus();
}

function goPage(pURL)
{
	document.location = pURL;
}

function goParentPage(pURL)
{
	parent.location.href = pURL;
}

function isNumerics(pNum)
{
	return !pNum.match(/[^0-9]/i); 
}
	
function checkEngNum(pStr)
{
	var pattern = /^[a-zA-Z0-9]+$/;
	
	return pStr.match(pattern);
}

function validateEmail(pStr)
{
	s=pStr.value;
	
	if(s.search)
	{
		return (s.search(new RegExp("^([-!#$%&'*+./0-9=?A-Z^_`a-z{|}~])+@([-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+\\.)+[a-zA-Z]{2,4}$","gi"))>=0);
	}
	if(s.indexOf)
	{
		at_character=s.indexOf('@');
		
		if(at_character<=0 || at_character+4>s.length)
			return false;
	}
	
	if(s.length<6)
		return false;
	else
		return true;	
}

function checkBytes(pStr)
{
	var length = 0;
	
	for (var i=0; i<pStr.length; i++)
		length += (pStr.charCodeAt(i) > 128) ? 2 : 1;
		
	return length;
}