// JavaScript Document
function dialogCreate( text )
{	
	Dialog.alert(text, {windowParameters: {className: 'alphacube', width:350}, okLabel: "close"});
}

function openWindow( tema )
{
	window.open('./modules/forum/new_comment.php?tema=' + tema,'comment','width=450,height=390');
}

function urlReplace ()
{
	var url = window.location.toString();;
	var array = url.split('&event=');

	if ( array.length == 2 )
		window.location.replace(array[0]);
}

function numbersonly( myfield, e, dec )
	{
		var key;
		var keychar;
		
		if (window.event)
			 key = window.event.keyCode;
		else if (e)
			 key = e.which;
		else
			 return true;
		keychar = String.fromCharCode( key );
		
		// control keys
		if ((key==null) || (key==0) || (key==8) || 
				(key==9) || (key==13) || (key==27) )
			 return true;
		
		// numbers
		else if ((("0123456789.").indexOf(keychar) > -1))
			 return true;
		
		// decimal point jump
		else if (dec && (keychar == "."))
			 {
			 myfield.form.elements[dec].focus();
			 return false;
			 }
		else
			 return false;
	}//End of numbersonly

