// STYLE CHANGING
function changeStyle(id, newClass) {
	identity=document.getElementById(id);	
	identity.className=newClass;	
}	

//add event function
function XXXaddEvent(obj, evType, fn){ 
  if (obj.addEventListener){ 
    obj.addEventListener(evType, fn, true); 
    return true; 
  } 
  else if (obj.attachEvent){ 
    var r = obj.attachEvent("on"+evType, fn); 
    return r; 
  } 
  else { 
    return false; 
  } 
}

// Find all link elements and add an onfocus attribte and value
function XXXhideFocusBorders(){
  var theahrefs = document.getElementsByTagName("a");
  if (!theahrefs){return;}
  for(var x=0;x!=theahrefs.length;x++){
    theahrefs[x].onfocus = function stopLinkFocus(){this.hideFocus=true;};
  }
}

//event added using the addEvent() function above
//addEvent(window, 'load', hideFocusBorders);

function popPopperWin(thePage, theWidth, theHeight) {
		if (!theHeight || theHeight > 750) theHeight = 750;
		if (theHeight < 100) theHeight = 100;
		// theHeight += 50;
		// alert ("openHeight=" + theHeight);
		var winl = Math.floor((screen.width - theWidth) / 2);
		var wint = Math.floor((screen.height - theHeight) / 2);
		
		
		
		if (window.thePopper && !window.thePopper.closed) {
				
			window.thePopper.location = thePage;
			window.thePopper.innerHeight = theHeight;
            window.thePopper.innerWidth = theWidth;

 			// alert(winl + " and " + wint);
 			
  			window.thePopper.focus();			
   			
            //window.thePopper.pageXOffset = winl;
			//window.thePopper.pageYOffset = wint;
			
		} else {
		
		thePopper = window.open(thePage, 'thePopper', 'width='+theWidth+',height='+theHeight+',top='+wint+',left='+winl+',menubar=no, toolbar=no,scrollbars=no,resizable=no,dependent=yes');
		if (window.thePopper.focus()) setTimeout("focusPopper();",200);
		
		}
}
