// free to use as long as this copyright notice stays intact
// copyright 2001 Jeff Rouyer and Eddie Traversa
// eddies site http://dhtmlnirvana.com/
// jeff’s site http://www.htmlguru.com/ 

function extraOnload() {}

  ns4    = (document.layers);
  ns6    = (!document.all && document.getElementById);
  ie4    = (document.all && !document.getElementById && !window.opera);
  ie5    = (document.all && !document.fireEvent && !window.opera);
  op7  	 = (window.opera && document.createComment) ;
  w3dom  = (document.getElementById || op7);

function defineObjects() {
  page          = new Object();
  page.width    = (ns4 || ns6 ||op7) ? innerWidth  : document.body.clientWidth;
  page.height   = (ns4 || ns6 ||op7) ? innerHeight : document.body.clientHeight;
  content		= new layerSetup(null,"contentLYR",-6,1,1,"visible");
			  setTimeout("actionManager()",500);
}

function layerSetup(parent,id,left,top,zindex,visibility) {
  if(ns4) {
    this.obj             = (parent != null) ? parent.document[id]          : document[id];
    this.obj.htm         = (parent != null) ? parent.document[id].document : document[id].document;
  } else if(ie4 ||ie5) {
    this.obj             = document.all[id].style;
    this.obj.htm         = document.all[id];
  } else if(w3dom) {
    this.obj             = document.getElementById(id).style;
    this.obj.htm         = document.getElementById(id);
  }
  this.obj.left          = (w3dom) ? left + "px" : left;
  this.obj.top           = (w3dom) ? top  + "px" : top;
  this.obj.zIndex        = zindex;
  this.obj.visibility    = visibility;
  return this.obj;
}





function getVar(name)
         {
         get_string = document.location.search;         
         return_value = '';
         
         do { //This loop is made to catch all instances of any get variable.
            name_index = get_string.indexOf(name + '=');
            
            if(name_index != -1)
              {
              get_string = get_string.substr(name_index + name.length + 1, get_string.length - name_index);
              
              end_of_value = get_string.indexOf('&');
              if(end_of_value != -1)                
                value = get_string.substr(0, end_of_value);                
              else                
                value = get_string;                
                
              if(return_value == '' || value == '')
                 return_value += value;
              else
                 return_value += ', ' + value;
              }
            } while(name_index != -1)
            
         //Restores all the blank spaces.
         space = return_value.indexOf('+');
         while(space != -1)
              { 
              return_value = return_value.substr(0, space) + ' ' + 
              return_value.substr(space + 1, return_value.length);
							 
              space = return_value.indexOf('+');
              }
          
         return(return_value);        
         }


//pg = location.search ? unescape(location.search.substring(1)):'1.welkom.php';
//pg = '1.welkom.php';
pg = getVar('pg');
if (pg == '') pg = "1.welkom.php";
if (pg == 'fotos/index.php') {pg = pg+"?dir="+getVar('dir')+"&type="+getVar('type')+"&t="+getVar('t')+"&id="+getVar('id');}

function actionManager() {
    pageManager("load_page",pg);
}

var page_timer = null;
function pageManager() {
  extraOnload;
  document.getElementById('emaillay').style.visibility='hidden';
  var args = pageManager.arguments;
  switch(args[0]) {
    case "load_page" :
	content.top = (w3dom) ? 1  + "px": 1;
	
	  if (args[1].indexOf("?") != '-1') {qmorand = "&";} else {qmorand = "?";}

	  args[1] = args[1]+qmorand+'lang='+lang;
	  
      if(ie4) {
        document.frames["frameData"].document.location = args[1];
      }
      if(w3dom) {
        document.getElementById("frameData").src = args[1];
      }
      if(ns4) {
        content.load(args[1],page.width);
      }
    break;
    case "page_is_loaded" :

      clearTimeout(page_timer);
      page_timer = setTimeout("pageManager('display_page')",500);
    break;
    case "display_page" :
      if(ie4) {
        content.htm.innerHTML = document.frames['frameData'].document.body.innerHTML;
      } else if(w3dom) {
        content.htm.innerHTML = window.frames.frameData.window.document.getElementById('body').innerHTML;
      }
	  document.getElementById('contentLYR').scrollTop = '0px';
    break;
  }
}