function checkContactForm()
{

	if( document.Skjema )
	{

		document.Skjema.onsubmit = function() {
			if( document.Skjema.Navn.value == "" )
			{
				alert("Vennligst fyll inn navnet ditt.");
				document.Skjema.Navn.focus();
				return false;
			}

			if( document.Skjema.Telefon.value == "" )
			{
				alert("Vennligst fyll inn telefonnummer.");
				document.Skjema.Telefon.focus();
				return false;
			}
			
			return true;
		};
	}
}

/**
* Flashmovie object, used to place
* IE and Opera friendly plugin code
* through javascript...
**/
FlashMovie = function ( )
{
	this.classid = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
	this.codebase = window.location.protocol + '//fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0';
	this.width = '100%';
	this.height = '100%';
	this.quality = 'high';
	this.background = '#fff';
	this.name = '';
	this.align = 'middle';
	this.allowscriptaccess = 'sameDomain';
	this.src = '';
	this.pluginspage = 'http://www.macromedia.com/go/getflashplayer';
	this.type = 'application/x-shockwave-flash';
	this.id = '';
	
	// Render HTML to a string and return
	this.render = function ( )
	{
		var ar = Array (
			"<object ", "classid=\"", this.classid, "\"",
			" codebase=\"", this.codebase, "\" width=\"", this.width, "\"",
			" height=\"", this.height, "\" ", ( this.id ? "id=\"" + this.id + "\"" : "" ),
			" align=\"", this.align, "\">","<param name=\"allowScriptAccess\" value=\"", this.allowscriptaccess, "\" />",
			"<param name=\"movie\" value=\"", this.movie, "\" />",
			"<param name=\"quality\" value=\"", this.quality, "\" />",
			"<param name=\"bgcolor\" value=\"", this.background, "\" />",
			"<embed src=\"", this.movie, "\" quality=\"", this.quality, "\" bgcolor=\"", this.background, 
			"\" width=\"", this.width, "\" height=\"", this.height, "\" name=\"", this.name, "\" align=\"", 
			this.align, "\" allowScriptAccess=\"", this.allowscriptaccess, "\"", 
			" type=\"", this.type, "\" pluginspage=\"", this.pluginspage, "\" />",
			"</object>"
		);
		return ar.join ( '' );
	}
	
	// Place html on an element
	this.place = function ( varid )
	{
		if ( typeof ( varid ) == 'string' )
			varid = document.getElementById ( varid );
		if ( varid )
			varid.innerHTML = this.render ( );
	}
}

window.onload = function ( )
{
	if( document.getElementById( "HomeMainImage" ) )
	{
		var f = new FlashMovie();
		f.name = 'elsesforsidebilder';
		f.id = 'elsesforsidebilder';
		f.width = '649';
		f.height = '227';
		f.movie = 'gfx/elsesforsidebilder.swf';
		f.place( document.getElementById( 'HomeMainImage') )
		//document.getElementById( "HomeMainImage" ).innerHTML = 'flash her';
	}
	
	if(  document.getElementById( "HomeText" ) )
	{
		if( navigator.userAgent.indexOf('Firefox') )
			document.getElementById( "HomeText" ).className = 'nodax';

	}
	
	checkContactForm();
}
