var browser_height = screen.height;
var browser_width = screen.width;
var scroller = null; 
if (browser_width <= 800) 
{
   document.write("<link REL='stylesheet' HREF='lalyboo_800.css' TYPE='text/css'>");
   content_height = 245;
} 
else 
   if (browser_width <= 1024)
   {
      document.write("<link REL='stylesheet' HREF='lalyboo_1024.css' TYPE='text/css'>");
      content_height = 290;
   }
   else 
   {
      document.write("<link REL='stylesheet' HREF='lalyboo_1280.css' TYPE='text/css'>");
      content_height = 405;
   }

function load_page(location) {
   var el = document.getElementById('content');
   scroller = new Scrolling.Scroller(el, 420, content_height);
   resize(location);
}

function resize(location) {
   var iframeElement1 = parent.document.getElementById('mainFrame');
   var iframeElement = parent.document.getElementById('productFrame');
   var browser_height = screen.height;
   if (iframeElement){
      if (location=="producten")
      {
         if (browser_height <= 600) {
            iframeElement1.height = '57';
            iframeElement.height = screen.availHeight-100;}
         else
            if (browser_height <= 768) {
               iframeElement1.height = '70';
               iframeElement.height = screen.availHeight-220;}
            else
               if (browser_height <= 800) {
                  iframeElement1.height = '70';
                  iframeElement.height = screen.availHeight-100;}
               else 
                  if (browser_height <= 1024) {
                     iframeElement1.height = '70';
                     iframeElement.height = screen.availHeight-220;}
                  else {
                     iframeElement1.height = '70';
                     iframeElement.height = screen.availHeight-220;}   
         iframeElement.width = '100%';
         }
      else
      {
         if (iframeElement.height != 0) {
            iframeElement.height = '0';
            iframeElement.width = '100%';
            iframeElement1.height = '1280';   
         }
      }
   }
}

function showmain(location) {
   var iframeElement1 = parent.document.getElementById('mainFrame');
   var iframeElement = parent.document.getElementById('productFrame');
   if (iframeElement){
         iframeElement1.src = location+".html";
   }
   else{
      if (window.location != "index.html?loc="+location) {
         window.location = "index.html?loc="+location;
      }
   }
}

function get_location() { 
  var loc = location.search.substring(1, location.search.length);
  var param_value = false;
  var params = loc.split("&");
  for (i=0; i<params.length;i++) {
      param_name = params[i].substring(0,params[i].indexOf('='));
      if (param_name == "loc") {
          param_value = params[i].substring(params[i].indexOf('=')+1)
      }
  }
  if (param_value) {
     showmain(param_value);
  }
  else {
     return "home.html";
  }
}
