window.onload = function() {
    var randomImages = [
      "itincnet/fieldstream/totaloutdoorsman/img/header1.jpg",
      "itincnet/fieldstream/totaloutdoorsman/img/header2.jpg",
      "itincnet/fieldstream/totaloutdoorsman/img/header3.jpg",
      "itincnet/fieldstream/totaloutdoorsman/img/header4.jpg"
    ];
    document.images['random_image'].src = randomImages[Math.floor(Math.random() * randomImages.length)];
    initLightbox();
  };

function popUp(URL) {
	alert("hello");
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=800,height=350');");
}

function OAS_AD(pos){OAS_RICH(pos)}

function dhtmlLoadScript(url)
{
  var e = document.createElement('script');
  e.setAttribute('src',url);
  e.setAttribute('type','text/javascript');
  document.getElementsByTagName("head")[0].appendChild(e);
}

var randomnumber=Math.floor(Math.random()*999999999);

//dhtmlLoadScript("http://oasc03049.247realmedia.com/RealMedia/ads/adstream_mjx.ads/www.fieldandstream.com/totaloutdoorsman/19454868958@Position1,Right?rand="+randomnumber);

fullUrl = "http://oasc03049.247realmedia.com/RealMedia/ads/adstream_mjx.ads/www.fieldandstream.com/totaloutdoorsman/19454868958@Position1,Right?rand="+randomnumber;

function staticLoadScript(url)
{
   document.write('<script src="', url, '" type="text/JavaScript"><\/script>');
}

staticLoadScript(fullUrl);

// Mozilla and alike load like this
/*
if (window.XMLHttpRequest) {    
    req = new XMLHttpRequest();    
    //FIXXXXME if there are network errors the loading will hang, since it is not done asynchronous since    
    // we want to work with the script right after having loaded it    
    req.open("GET",fullUrl,false); // true= asynch, false=wait until loaded    
    req.send(null);
} else if (window.ActiveXObject) {    
    req = new ActiveXObject((navigator.userAgent.toLowerCase().indexOf('msie 5') != -1) ? "Microsoft.XMLHTTP" : "Msxml2.XMLHTTP");
    if (req) {
        req.open("GET", fullUrl, false);
        req.send();
    }
}

if (req!==false) {
    if (req.status==200) {
        // eval the code in the global space (man this has cost me time to figure out how to do it grrr)                
        window.eval(req.responseText);
    } else if (req.status==404) {
        // you can do error handling here
    }
}
*/
