function openWindow(url,name,width, height)
{
		var f = window.open(url,name,'width='+width+',height='+height+
		',screenX=100,left=100,screenY=100,top=100,toolbar=NO,menubar=NO,location=NO,status=NO,resizable=NO,scrollbars=NO');
		setTimeout(f.Focus(), 300);
}

function confimDelete()
{
		var x = window.confirm("Would you like delete now?");
        if(x == true)
        {
                document.forms[0].submit();
        }
}

function confirmRedirect(s)
{
	var x = window.confirm("Would you like delete now?");

	if (x == true)
	{
		//alert("wird gelöscht: " + s);
		window.location = s;
	}
	else
	{
		//alert("wird nicht gelöscht: " +  window.location);
		window.location = window.location;
	}
}

function checkInput()
{
	var fields= new Array("first_name", "last_name", "email", "password");

	var ok = true;
	var first = -1;

	for (i=0; i<document.forms[0].elements.length; i++)
	{
		for(x=0; x<4; x++)
		{
			document.forms[0].elements(i).bgColor="";		
			if( (document.forms[0].elements(i).name == fields[x]) && (document.forms[0].elements(i).value=="") )
			{
				first = i;

				ok = false;
				//document.forms[0].elements(i).style.backgroundColor = "red";
				document.forms[0].elements(i).style.borderColor = "red";
			}
		}
		
	}

	if (!ok)	
	{
		alert("Insert fist name, last name, email and password!");
		document.forms[0].elements(first).focus();
	}
	else
	{
		document.forms[0].submit();
	}

	return ok
}