function addClass(obj,newClass) {
	if(!obj.className.match(new RegExp(newClass)))
		obj.className+=(obj.className.length>0? " ": "") + newClass;
}
	
function removeClass(obj,oldClass) {
	obj.className=obj.className.replace(new RegExp("( ?|^)"+oldClass+"\\b"), "");
}

function setLinks() {
	var aCollection = document.getElementsByTagName('a');
	for (var i = 0; i < aCollection.length; i++) {
		if (aCollection[i].rel) {
			switch (aCollection[i].rel) {
				case "partner" :
				case "external" :
				case "creation" :
				case "development" :			
					aCollection[i].onclick = function(e) {				
						if (!e) var e = window.event;
						if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey)
							return true;
						window.open(this.href);
						return false;
					}				
				break;
				case "credits" :
					aCollection[i].onclick = function(e) {				
						if (!e) var e = window.event;
						if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey)
							return true;
						ow(this.href,'credits');
						return false;
					}
				break;
			}
		}	
	}
}

var dimx,dimy,xPos,yPos,featur,xEcran=800,yEcran=600;
if(screen.width && screen.height){
	xEcran = screen.width;
	yEcran = screen.height;
}
function ow(aHref,type) {
	if(type == 'credits') {
		dimx=350; dimy=180;
	}
	xPos=(xEcran - dimx)/2; yPos=(yEcran - dimy)/2;
featur = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,screenX="+xPos+",left="+xPos+",screenY="+yPos+",top="+yPos+",width="+ dimx + ",height=" + dimy + "";
	if(type == 'credits') {
		var zoomPWcredits = window.open(aHref,'RemotePWCredits',featur);
		if (window.focus && zoomPWcredits) {zoomPWcredits.focus();}
	}
	return false;
}

/* Init
-------------------- */
var init = function() {
	if (arguments.callee.done) return;
	arguments.callee.done = true;
	if(!document.getElementsByTagName)
		return;
	setLinks();
}

window.onload = init;
if (document.addEventListener) {
    document.addEventListener("DOMContentLoaded", init, null);
}
else {
	/*@cc_on @*/
	/*@if (@_win32)
		document.write("<script defer src='js/ie_init.js' type='text/javascript'><"+"/script>");
	/*@end @*/	
}