function justify_screen()
{
  var x,y;
  if (self.innerHeight) // all except Explorer
  {
  	x = self.innerWidth;
  	y = self.innerHeight;
  }
  else if (document.documentElement && document.documentElement.clientHeight)
  	// Explorer 6 Strict Mode
  {
  	x = document.documentElement.clientWidth;
  	y = document.documentElement.clientHeight;
  }
  else if (document.body) // other Explorers
  {
  	x = document.body.clientWidth;
  	y = document.body.clientHeight;
  }

  if (x<1180 || y<830) {
    document.body.scroll = "yes";
    document.body.style.overflow = "auto";
  } else {
    document.body.scroll = "no";
    document.body.style.overflow = "hidden";  
  }
   
  if (x<1180) {
    document.getElementById("rahmen").style.marginLeft = "auto";
    document.getElementById("rahmen").style.left = "-360px";
    document.getElementById("rahmen").style.width = "1550px";
    
  } else {
    document.getElementById("rahmen").style.marginLeft = "-960px";
    document.getElementById("rahmen").style.left = "50%";
    document.getElementById("rahmen").style.width = "1920px";  
  }

  if (y<830) {
    document.getElementById("rahmen").style.marginTop = "auto";
    document.getElementById("rahmen").style.height = "1030px";
    document.getElementById("rahmen").style.top = "-180px";
  } else {
    document.getElementById("rahmen").style.marginTop = "-600px";
    document.getElementById("rahmen").style.height = "1200px";
    document.getElementById("rahmen").style.top = "50%";  
  }  
}

window.addEvent('domready', function(){
  justify_screen();

	//create our Accordion instance
	var myAccordion = new Accordion($('accordion'), 'div.toggler', 'div.element', {
		opacity: false,
		onActive: function(toggler, element){
			//toggler.setStyle('margin-left', '5px');
		},
		onBackground: function(toggler, element){
			//toggler.setStyle('margin-left', '5px');
		}
	});

  createFlash();


});




function beforeSubmit()
{
  var obj = document.getElementById("objektauswahl");
  var textBox = document.getElementById("ContentObjectAttribute_data_text_2400");

  for (var i = 0; i<obj.length ; i++) {
    if (obj.options[i].selected == true)
      textBox.value += obj.options[i].text + "\n";
  }

}
