function printP(loc)
		{			
			newWindow = window.open( loc + '&formatting=printer&start=now', '_blank' );
		}
		var MID = '', iURL = '';
		var is_dom = ( document.getElementById ) ? true : false;
		var is_opera = (  navigator.userAgent.toLowerCase().indexOf( 'opera' ) != -1 );
		var is_ie = ( navigator.appName.toLowerCase() == 'microsoft internet explorer' && !is_opera );
      var mainLink = null, mState = 0, oldStyle = new Array();

      function hoverMainLink( mainLink, mState )
      {
         if( document.getElementById( mainLink ) )
         {
            if( mState == 1 )
            {
               oldStyle[ mainLink ] = document.getElementById( mainLink ).className;
               document.getElementById( mainLink ).className = 'mLHover';
            }
            else if( oldStyle[ mainLink ] != '' )
            {
               document.getElementById( mainLink ).className = oldStyle[ mainLink ];
            }
         }
      }

	  var tdo = null, dotd = 0, mmode = 0, aid = 0;
		function showM( tdo, dotd, mmode, aid, mainLink, mState )
		{
			if( tdo )
			{
				if( dotd == 1 )
				{
					// tdo.className = ( ( mmode == 1 ) ? 'mainMa' : 'mainM' ); 
					tdo.className = 'mL';
				}
				if( mmode == 1 )
				{
					// näytä
					if( document.getElementById( 'submenu' + aid ) && loaded )
					{
						document.getElementById( 'submenu' + aid ).style.visibility = 'visible';
						dopops( aid );
					}
				}
				else
				{
					// piilota
					start_hideNavi();
				}
			}
			hoverMainLink( mainLink, mState );
		}
		
	var efname = '';
    function checkEF( efname )
    {
       var OK = true;
       var fe = document.forms[ efname ].elements;
       if( fe[ 'username' ].value == '' )
       {
          OK = false;
       }
       if( fe[ 'passwd' ].value == '' )
       {
          OK = false;
       }
       return OK;
   }
		
	function CUIPopUp( cui_url, cui_parameters, popname )
	 {
		 if( popname != '' )
		 {
			 var usename = popname;
		 }
		 else
		 {
			 var random_windowname = Math.round( ( Math.random() * 100 ) );
			 var usename = 'CUIpop' + random_windowname;
		 }
		 newWindow = window.open( cui_url, usename, cui_parameters );
	 }
	 function CUIImageChange( cui_img_name, cui_img_src )
	 {
		 if( document.images[ cui_img_name ] )
		 {
			 document.images[ cui_img_name ].src = cui_img_src;
		 }
	 }

	function checkForm( fe ) {
	   msg = '';
       if( fe.name.value == '' ) {
		  alert("Syötä nimesi, ole hyvä!");
		  return false;
       }
       
	   	if(fe.email.value == "") {
			alert("Syötä sähköpostiosoitteesi, ole hyvä!");
			return false;
		}
		else {
			var piste = false;
			var at = false;
			for(x = 0; x < fe.email.value.length; x++){
				if(fe.email.value.charAt(x) == "'") {
					window.alert("Älä käytä '-merkkiä sähköpostikentässä");
					return false;
				}
				if(fe.email.value.charAt(x) == ".")
					piste = true;
				if(fe.email.value.charAt(x) == "@")
					at = true;
			}
			if(!piste || !at) {
				alert("Sähköpostiosoite on virheellinen.");
				return false;
			}
		}
       return true;
   }

