function isFilled( textbox )
{
	if ( textbox.value != "" )
		return true;

	alert("Du må fylle inn søkefeltet");
	return false;
}


function openwindow(url,winName,features,openName)
{
	window.name = openName;
	window.open(url,winName,features);
}

function openVoteWindow( theURL , repId, winName, features, category, discussion, formHandler )
{		
	theURL += "?id=" + repId + "&category=" + category + "&discussion=" + discussion + "&formHandler=" + formHandler;	
	window.open( theURL, 'vote', 'resizable=yes,scrollbars=no,width=375,height=600' );		
}

function openMapWindow( theURL , repId )
{
	theURL += "?repositoryId=" + repId;
	window.open( theURL,'Kart','resizable=yes,scrollbars=yes,width=600,height=525' );
}

function addPlace( repId )
{
	var url = "/cityguides/common/fragments/add_place.jhtml?id=" + repId;
	MM_openBrWindowName( url , 'leggtil', 'resizable=yes,scrollbars=no,width=300,height=300', 'ep_main' );
}

function loginWindow()
{
	window.open( "/cityguides/profile/user_login.jhtml", 'innlogging', 'resizable=yes,scrollbars=no,width=300,height=320' );
}


function DCLoginWindowSpecial( theURL,winName,features,openName,location ) 
{ 			 
	theURL += "?location=" + location;			
	window.name = openName;
	window.open( theURL , winName , features );	
}


function oppdaterWindow( aref )
{
	var url = "/cityguides/profile/user_update.jhtml#" + aref;
	window.open( url, 'profil', 'resizable=yes,scrollbars=yes,width=600,height=450' );
}


function registerWindow()
{
	window.open('/cityguides/profile/user_create.jhtml', 'registrering', 'resizable=yes,scrollbars=yes,width=600,height=450');
}


function checkControl( control )
{
	control.checked = "true";
}

function redirectDebate( path )
{			
	opener.location = path;
}


function formSubmit( form )
{	
	form.submit();		
}

function selectAndSubmit( select )
{
	if ( select.selectedIndex != 0 ) {
		select.form.submit();
		return true;
	}

	alert("Du må velge et sted fra listen");
	return false;
}

function erase(fld,def) {
	if(fld.value==def)
		fld.value="";
	
	return false;
}

function validate(mNv,msg) {
	if (mNv=='') 
	{
		alert(msg);
		event.returnValue=false; 
	}
} 