function createScroll(thePlaceholder, thePlayerId, theFile) {
	var flashvars = {
			file:theFile, 
	}
    var params = {
			allowfullscreen:"false", 
			allowscriptaccess:"always",
			wmode:"opaque"
    }

    var attributes = {
   			id:thePlayerId,  
			name:thePlayerId
    }
	
    swfobject.embedSWF("/fileadmin/templates/res/scrolltext.swf", thePlaceholder, "792", "37", "9.0.123", "/fileadmin/templates/player/expressinstall.swf", flashvars, params, attributes);
}

function getFlashMovieObject(movieName)
{
  if (window.document[movieName]) 
  {
      return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }
}

function savelastmsg() {
	id = getFlashMovieObject("scrolltext");
	x = id.getLastPos("");
	document.cookie="scrollX="+x+';path=/';
}

function addEvent( obj, type, fn ) {
  if ( obj.attachEvent ) {
    obj['e'+type+fn] = fn;
    obj[type+fn] = function(){obj['e'+type+fn]( window.event );}
    obj.attachEvent( 'on'+type, obj[type+fn] );
  } else
    obj.addEventListener( type, fn, false );
}
	
addEvent(window, 'unload', function(event) {
	savelastmsg();
});


