var NVB = new Class(
{
  initialize: function()
  {
    var $this = this;
	
    window.addEvent("resize",function() {
	  $this.resize();
	  $this.innercontent();
	});
	
	$this.resize();
	
	$('wrapper').setStyles({
	  'display' : 'block',
	  'opacity' : 0
	});
	
	$('wrapper').fade('in');
  },
 
  resize : function()
  {    
    var $size = window.getSize();
	
	if($size.y < 700) {
	  var $h = 780;
	  var $m = 17;
	  $("wrapper").setStyle("height","595px");
	} else {
	  var $h = $size.y;
	  var $m = 0;
	}
	
	if($size.x <= 1000) {
	  var $w = 980;
	} else {
	  var $w = $size.x;
	}
	
	var $flash = ((500/768)*$h).round();
	var $cont  = 130;
	
	$("flashcontent").setStyle("height","500px");
	
	if($("no-flash-followup") != undefined) {
	  $("no-flash-followup").setStyle("height",$flash+"px");
	}
	
    $("wrapper").setStyle("width",$w+"px");
	$("flashcontent").setStyle("width",$w+"px");
	
	$("plattland").setStyles({
	  "top"  : "10px",
	  "left" : "10px"
	});
	
	$("nvb").setStyles({
	  "top"  : "15px",
	  "left" : "15px"
	});
  },
  
  swf : function(file,sound,site,debug) {
  
    if(debug && debug == "true") {
	  $v = "20";
	} else {
	  $v = "8";
	}
  
	var so  = new SWFObject(file+"?nocache="+new Date().getTime(), "", "100%", "100%", $v, "#a9dcf0");
	    so.addVariable("sound",sound);
		if(site != undefined && site != null && site.split(" ").join("") != "") {
	      so.addVariable("site",site);
	    } else {
		  so.addVariable("site","nvb");
		}
		if(Browser.Engine.trident4 === true) {
		  so.addVariable("ie6",true);
		}
		so.addParam("wmode","transparent");
	    so.write("flashcontent");
  },
  
  site : function(value) {
    if(value !== "false" && value !== false && $(value)) {
	  $(value).setStyles({opacity:"0",display:"block"});
	  $(value).fade("in");
	}
  },
  
  innercontent : function() {
    var $size = window.getSize();
	var $i    = $("inner-content");
	var $s    = $("switch");
	
    var $f  = $("flashcontent");
	    $f.set("class","clouds");
		
	var $fw = 200;
	
	/*if($size.x <= 1000) { 
	  $i.setStyle("left",$fw+"px");
	} else {
	  $i.setStyle("left",$fw+"px");
	}*/
	
	if($i != null) {
	  $i.setStyles({
	    "left" 		  : "50%",
	    "margin-left" : "-400px"
	  });
	}
	
	if($i != null && $i != undefined) {
	  $size  = $f.getSize();
	  $w     = 800;
	  $h     = $f.getStyle("height");
	  
	  $i.setStyles({
	    "height"  : $h,
		"width"   : $w
	  });
	}
	
	this.lines();
	this.lines.periodical(10000);
  },
  
  lines : function() {
	var $f = $("flashcontent");
	var $s = null;
	var $l = $("lines");
	
	if($("switch") != undefined && $("switch") != null) {
	  $s 	   = $("switch");
	  $noflash = false;
	  
	  if(Browser.Engine.trident4 === true ) {
	    $("switch").set("src",$("switch").get("src").split("-2.png").join("-2-ie6.jpg"));
	  }
	}
	
	if($s === null) {
	  if($("noflash-switch") !== undefined) {
	    $s 	   = $("noflash-switch");
	    $noflash = true;
	  }
	}
	
	if($l != null && $l != undefined && $s !== null) {
	  if($noflash === false) {
	    var $lh = ($f.getStyle("height").split("px").join("")).toInt()-(316)-(140);
	  } else {
	    var $lh = 100;
		
		$l.setStyles({
		  "left" 		: "50%",
		  "margin-left" : "-345px"
		});
	  }
	  
	  if($lh > 0) {
	    $l.setStyle("height",$lh+"px");
	  }
	}
  }
});

