// Break out of Frames
if (self != top) { history.back(); 
top.location.href = 'http://www.opiumvoorhetvolk.com/index.asp'; 
}

//just a bloody useful function to have around. used a.o. in resadapter
document.getElementsByClassName = function(cl) {
var retnode = [];
var myclass = new RegExp('\\b'+cl+'\\b');
var elem = this.getElementsByTagName('*');
for (var i = 0; i < elem.length; i++) {
   var classes = elem[i].className;
   if (myclass.test(classes)) retnode.push(elem[i]);
   }
return retnode;
};

//needed for resadapter
var bodyheight
function getbodyheight(){
bodyheight = document.body.offsetHeight
}
		
//adapts element resolutions to screensize		
function ResAdapter(name, type, modifier){		
if (type == "class"){
 	var classarray = document.getElementsByClassName(name)
	for(i=0;i<classarray.length;i++){
	targetheight = bodyheight + modifier + "px"
	classarray[i].style.height = targetheight
	}
  } else if (type == "id"){
 var targetheight = bodyheight + modifier + "px"
 document.getElementById(name).style.height = targetheight
 }
}

//masks email adresses, call using: 'WriteOVHVAddy(willem)' 
function WriteOVHVAddy(user){
var hostname = "opiumvoo"
hostname += "rhetvolk.com"
var addy = user + "@" + hostname
document.write("<a href=" + "mai" + "lto:" + addy + ">" + addy + "</a>") 
}

//sets the tabsequence on a page, based on two arguments. 
function SetTabSequence(a, b){
  if (b == 'ClassName'){
  var GUI = document.getElementsByClassName(a)
  } else if (b == 'TagName'){
  var GUI = document.getElementsByTagName(a)
  } else if (b == 'Name'){
  var GUI = document.getElementsByName(a)
  }
  if (GUI.length > 0){
     for (i=0; i<GUI.length; i++){
     	   GUI[i].tabIndex = i+1
     }
  }
GUI = null
}

function trim(value) {
  value = value.replace(/^\s+/,'');
  value = value.replace(/\s+$/,'');
  return value;
}

