// Global.js

var global = {};

jQuery(document).ready(function() { onLoad(); });

function randomNumber(m, n) {
	m = parseInt(m);
	n = parseInt(n);
	return Math.floor(Math.random() * (n - m + 1)) + m;
}
// init

function onLoad() {
    //alert('1');
	// if flash logo is required, then get it
	var divFlashLogo = document.getElementById('FlashLogo');
	var divFlashLogoOrestad = document.getElementById('OrestadFlashLogo');
	var divFlashMapOrestad = document.getElementById('fp1');
	var divPersons = document.getElementById('persons');
	if (divFlashLogo)
	{
	  var fn = function() {
        var att = { data:logoServerPath, width:"172", height:"54" };
        var par = {wmode:"transparent"};
        var id = "FlashLogoLink";
        var myObject = swfobject.createSWF(att, par, id);
      };
      swfobject.addDomLoadEvent(fn);
     }
     if (divFlashLogoOrestad) {
     	
     	if (divPersons) {
     		divPersons.style.backgroundImage = 'url(gfx/orestad/par' + HeaderPicRandomNumber + '_ben.jpg)'
     	}
     	var fn2 = function() {
     		var att = { data: logoServerPath, width: "762", height: "200" };
     		var par = { wmode: "transparent", base: 'http://local.orestad.dk//flash/orestad/' };
     		var id = "OrestadFlashLogo";
	
     		var myObject = swfobject.createSWF(att, par, id);
     	};

     	swfobject.addDomLoadEvent(fn2);
     }
     if (divFlashMapOrestad) {

     	var fn2 = function() {
     	var att = { data: mapFlashServerPath, width: "299", height: "255" };
     		var par = { wmode: "transparent", base: 'http://local.orestad.dk//flash/orestad/' };
     		var id = "fp1";
     		var myObject = swfobject.createSWF(att, par, id);
     	};

     	swfobject.addDomLoadEvent(fn2);
     }
 }
