function isFilled( textbox )
{
	if ( textbox.value != "" )
		return true;

	alert("Du må fylle inn søkefeltet");
	return false;
}

function isLoginFilled( textbox )
{
	if ( textbox.value != "" )
		return true;

	alert("Du må fylle inn brukernavn-feltet");
	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 DCLoginWindow( theURL,winName,features,openName,folder,discussion ) 
{ 			 
	theURL += "?folder=" + folder + "&discussion=" + discussion;		
	window.name = openName;
	window.open( theURL , winName , features );	
}

function DCLoginWindowSpecial( theURL,winName,features,openName,location ) 
{ 			 
	theURL += "?location=" + location;			
	window.name = openName;
	window.open( theURL , winName , features );	
}

function openUserUpdateWindow( aref )
{
	var url = "/cityguides/profile/user_update.jhtml#" + aref;
	window.open( url, 'profil', 'resizable=yes,scrollbars=yes,width=600,height=450' );
}

function oppdaterWindow( aref )
{
	var url = "/cityguides/profile/user_update.jhtml#" + aref;
	window.open( url, 'profil', 'resizable=yes,scrollbars=yes,width=600,height=450' );
}

function fordelerWindow()
{
	window.open('/cityguides/local/medlemsfordeler.jhtml', 'medlemsfordeler', 'resizable=yes,scrollbars=yes,width=600,height=450');
}

function kortWindow()
{
	window.open('/cityguides/local/medlemskort.jhtml', 'medlemskort', 'resizable=no,scrollbars=no,width=525,height=450');
}

function passordWindow()
{
	window.open('/cityguides/profile/forgot_password.jhtml', 'glemt_passord', 'resizable=yes,scrollbars=no,width=300,height=300');
}

function LoggedInUsersWindow()
{
	window.open('/cityguides/common/LoggedInUsers.jhtml', 'brukere', 'resizable=yes,scrollbars=no,width=300,height=375');
}

function personvernWindow()
{
	window.open('/cityguides/local/personvern.jhtml', 'personvern', '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 arrtipsWindow()
{
	window.open( "/cityguides/common/arrtips_form.jhtml", 'Arrangementtips', 'resizable=yes,scrollbars=yes,width=450,height=600' );
}

function checkDebate( form )
{
	if ( form.messageTitle.value == "" ) {
		alert( "Du må gi innlegget ditt en tittel" );
		form.messageTitle.focus();
		return false;
	}

	if ( form.messageContent.value == "" ) {
		alert( "Du kan ikke legge inn en tom melding" );
		form.messageContent.focus();
		return false;
	}

	return true;
}

function checkControl( control )
{
	control.checked = "true";
}

function redirectDebate( path )
{			
	opener.location = path;
}

function redirectDebate2( path )
{			
	opener.location = path;
	self.close();		
}

function formSubmit( form )
{	
	form.submit();		
}

function tempRedirect( path )
{	
	self.location = path;		
}

