/* Good old popup function */
function popUp(URL, width, height ) {
    day = new Date();
    id = day.getTime();
    if ( typeof height == 'undefined'){
        height = 400;
    }
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width="+width+",height="+height+",left = 347.5,top = 0');");
}

/*.
Validate and check for numbers 
*/
function valNumber(error){
	var allowKeys 	= 	'1234567890';
	var state	=	false;
	var key = 0;
	if (error.which){
		key = error.which;
	}else{
		key = error.keyCode;
	}
	if ((key == 9) || (key == 8) || (key == 46) || (key == 37) || (key == 39)){
		state = true;
	}else if(allowKeys.indexOf(String.fromCharCode(key))>-1){
		state = true;
	}
	return state;
}

function openPopup(url,style)
{
	if(style == undefined)
	{
		var newWindow = window.open(url,null,'height=300,width=430,resizable=yes,scrollbars=no');
	}
	else
	{
		var newWindow = window.open(url,null,style);
	}	
	
	if (window.focus)
	{
		newWindow.focus();
	}
	return false;
}