// GET NAVIGATOR
function getNavigator() {
	if (navigator.userAgent.indexOf('MSIE') !=-1)
		browser = 'MSIE';
	else 
		browser = 'Other';
	return browser;
}
			
// GET WIN HEIGHT
function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number')
		windowHeight = window.innerHeight;
	else {
		if (document.documentElement && document.documentElement.clientHeight)
			windowHeight = document.documentElement.clientHeight;
		else if (document.body && document.body.clientHeight)
			windowHeight = document.body.clientHeight;
	}		return windowHeight;
}

// GET WIN WIDTH
function getWindowWidth() {
	var ww = 0;
	if (self.innerWidth)
		ww = self.innerWidth;
	else if (document.documentElement && document.documentElement.clientWidth)
		ww = document.documentElement.clientWidth;
	else if (document.body)
		ww = document.body.clientWidth;
	return ww;
}

// MENU STYLE
function rowOverEffect(row) {
	if (row.className == 'moduleRow') row.className = 'moduleRowOver';
}
function rowOutEffect(row) {
	if (row.className == 'moduleRowOver') row.className = 'moduleRow';
}

// AFFICHE/MASQUE UN DIV
function showDivByID(divID, mode) {
	var div = document.getElementById(divID);
	mode = mode ? "visible" : "hidden";
	div.style['visibility'] = mode;
}

// MOVE DIV TO BOTTOM LEFT
function moveDivToBottomLeft(divID, dx, dy) {
	dx = dx ? dx : 0;
	dy = dy ? dy+20 : 20;
	if (document.getElementById) {
		var div = document.getElementById(divID);
		var windowHeight = getWindowHeight();
		if (windowHeight>0) {
			var contentHeight=0;
			var footerHeight=div.offsetHeight;
			if (windowHeight-footerHeight>=0) {
				div.style.position='relative';
				div.style.top = (windowHeight-(footerHeight)-dy)+'px';
				div.style.left = dx+'px';
			} else
				div.style.position = 'static';
		}
	}
}

// MOVE DIV TO CENTER
function moveDivToCenter(divID, dx, dy) {
	dx = dx ? dx : 0;
	dy = dy ? dy+20 : 20;
	if (document.getElementById) {
		var div = document.getElementById(divID);
		var windowWidth = getWindowWidth();
		if (windowWidth>0) {
			if (windowWidth>=0) {
				div.style.position='absolute';
				div.style.left = (windowWidth/2+dx)+'px';
				div.style.top = dy+'px';
			} else
				div.style.position = 'static';
		}
	}
}

// MOVE DIV TO BOTTOM CENTER
function moveDivToBottomCenter(divID, dx, dy) {
	dx = dx ? dx : 0;
	dy = dy ? dy+20 : 20;
	if (document.getElementById) {
		var div = document.getElementById(divID);
		var windowWidth = getWindowWidth();
		var windowHeight = getWindowHeight();
		if (windowHeight>0) {
			var contentHeight=0;
			var footerHeight=div.offsetHeight;
			if (windowHeight-footerHeight>=0) {
				div.style.position='absolute';
				div.style.top = (windowHeight-(footerHeight)-dy)+'px';
			} else
				div.style.position = 'static';
		}
		
		if (windowWidth>=0)
			div.style.left = (windowWidth/2+dx)+'px';
	}
}

// ZOOM IN OUT
document.onkeydown = function (evt){
	evt = evt ? evt:typeof event!='undefined' ? evt : null;
	if (!evt) return;
	var swf=(navigator.appName.indexOf("Microsoft") != -1) ? window["site"] :  document["site"];
	if (!swf) window["site"];
	var isMac = (navigator.appVersion.indexOf("Mac")!=-1);
	if (swf) {
		// PC
		if (!isMac) {
			if (evt.ctrlKey && evt.keyCode==107)
				swf.zoomIn();
			else if (evt.ctrlKey && (evt.keyCode==109 || evt.keyCode==54))
				swf.zoomOut();
				
		// MAC
		} else {
			if ((evt.ctrlKey || evt.metaKey) && (evt.keyCode==191 || evt.keyCode==107))
				swf.zoomIn();
			else if ((evt.ctrlKey || evt.metaKey) && (evt.keyCode==187 || evt.keyCode==109))
				swf.zoomOut();
		}
	}
}

	
