function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}


function init(){
	
	// Set the style for images within the COPY div based on their alignment
	var copy = document.getElementById('content');
	if(copy){
		var images = copy.getElementsByTagName('IMG');
		for(var i=0;i<images.length;i++){
			var align = images[i].getAttribute('align');
			if((align == 'left')||(align == 'right')){
				//images[i].setAttribute('align', '');
				images[i].setAttribute('className', align);
				images[i].setAttribute('class', align);
			}
		}
		
		/*/ Find Anchors with the "imagelink" class and set them up for lightbox
		var anchors = copy.getElementsByTagName('A');
		for(var i=0;i<anchors.length;i++){
			if(anchors[i].className == 'imagelink'){
				anchors[i].setAttribute('rel', 'lightbox[set]');
			}
		}
		
		// Add a self focus to the global search
		var search = document.getElementById('s');
		if(search){
			search.onfocus = function(){
				this.select();	
			}
		}*/
	}
}



addLoadEvent(init);