/*
	version		2.00
	project		Website 'www.active-personeelsdiensten.com' (2006-12)
	client		Active Uitzendorganisatie Venray BV

	author		Guilty by Design (www.guiltybydesign.eu)
	copyright	Guilty by Design (www.guiltybydesign.eu)
				Dynamic Drive (www.dynamicdrive.com)
				Gez Lemon (www.juicystudio.com)

	remarks		
*/

AddLoadEvent(replaceExternalRel);
function replaceExternalRel(){
	var objCurrent, objReplacement;
	if(document.getElementsByTagName){
		var objAnchors = document.getElementsByTagName('a');
		for(var iCounter=0; iCounter<objAnchors.length; iCounter++){
			if(objAnchors[iCounter].getAttribute('href') && (objAnchors[iCounter].className=='externalleft' || objAnchors[iCounter].className=='externalright')){
				objAnchors[iCounter].onclick = function(event){ return openWindow(this, event); }
				objAnchors[iCounter].onkeypress = function(event){ return openWindow(this, event); }
			}
		}
	}
}
function openWindow(objAnchor, objEvent){
	var iKeyCode;
	if(objEvent && objEvent.type=='keypress'){
		if(objEvent.keyCode) iKeyCode = objEvent.keyCode;
		else if(objEvent.which) iKeyCode = objEvent.which;
		if(iKeyCode!=13 && iKeyCode!=32) return true;
	}
	return !window.open(objAnchor);
}

var win=null;
function popupWindow(href,name,width,height,scroll){
	LeftPosition=(screen.width)?(screen.width-width)/2:100;
	TopPosition=(screen.height)?(screen.height-height)/2:100;
	settings='width='+width+',height='+height+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	win=window.open(href,name,settings);
}
