/*
	GoGoCreate Clientscript
	Code by ://steinmeier.dk
	$Id: gogoclient.js,v 1.1 2004-04-05 22:34:57+02 chriz Exp chriz $
*/

function gogoFlipToPage(obj) {
	var sURL = "";
	
	if (obj.options) {
		sURL += obj.options[obj.selectedIndex].value;
		document.location = sURL;
	}
}

function gogoRequireAddress(obj) {
	var oEmail = obj.elements["email"];
	var sAddress = oEmail.value;
	var bOK = sAddress.match(/^[a-z][a-z0-9\._-]*@[a-z]([a-z0-9_-]*\.)+[a-z]{2,6}$/i);
	
	if (!bOK) {
		alert("Du skal indtaste en gyldig e-mail adresse!");
		gogoSetFocus(oEmail);
		return false;
	} else {
		return true;
	}
}

function gogoSelectAllOnEnter(obj) {
	if (obj.select) {
		obj.select();
	}
}

function gogoSetFocus(obj) {
	if (obj.focus) {
		setTimeout('document.forms[0].elements["' + obj.name + '"].focus();', 10);
	}
}
