
function wopen_help(page, name, w, h) {
  // Fudge factors for window decoration space.
  // In my tests these work well on all platforms & browsers.
  //w += 32;
  //h += 96;
  wleft = (screen.width - w) / 2;
  wtop = (screen.height - h) / 2;
  // IE5 and other old browsers might allow a window that is
  // partially offscreen or wider than the screen. Fix that.
  // (Newer browsers fix this for us, but let's be thorough.)
  if (wleft < 0) {
    w = screen.width;
    wleft = 0;
  }
  if (wtop < 0) {
    h = screen.height;
    wtop = 0;
  }
  url = "help.php?page=" + page + "&w=" + w + "&h=" + h;
  var win = window.open(url,
    name,
    'width=' + w + ', height=' + h + ', ' +
    'left=' + wleft + ', top=' + wtop + ', ' +
    'location=no, menubar=no, ' +
    'status=no, toolbar=no, scrollbars=yes, resizable=yes, status=no, center=yes');
  // Just in case width and height are ignored
  win.resizeTo(w, h);
  // Just in case left and top are ignored
  win.moveTo(wleft, wtop);
  win.focus();
}

function wopen(url, name, w, h) {
  // Fudge factors for window decoration space.
  // In my tests these work well on all platforms & browsers.
  //w += 32;
  //h += 96;
  wleft = (screen.width - w) / 2;
  wtop = (screen.height - h) / 2;
  // IE5 and other old browsers might allow a window that is
  // partially offscreen or wider than the screen. Fix that.
  // (Newer browsers fix this for us, but let's be thorough.)
  if (wleft < 0) {
    w = screen.width;
    wleft = 0;
  }
  if (wtop < 0) {
    h = screen.height;
    wtop = 0;
  }
  url = "photo.php?p=" + url + "&w=" + w + "&h=" + h;
  var win = window.open(url,
    name,
    'width=' + w + ', height=' + h + ', ' +
    'left=' + wleft + ', top=' + wtop + ', ' +
    'location=no, menubar=no, ' +
    'status=no, toolbar=no, scrollbars=no, resizable=yes, status=no, center=yes');
  // Just in case width and height are ignored
  win.resizeTo(w, h);
  // Just in case left and top are ignored
  win.moveTo(wleft, wtop);
  win.focus();
}


function changeBackgroundOver(obj) {
	obj.style.backgroundColor = "#E9E9E9";	
}

function changeBackgroundOut(obj) {
	obj.style.backgroundColor = "#FAFAFA";	
}


function getClientHeight() {
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
}

function _changeMenuPosition() {
	
	
/*	
	var winW = 630, winH = 460;

if (parseInt(navigator.appVersion)>3) {
 if (navigator.appName=="Netscape") {
  winW = window.innerWidth;
  winH = window.innerHeight;
 }
 if (navigator.appName.indexOf("Microsoft")!=-1) {
  winW = document.body.offsetWidth;
  winH = document.body.offsetHeight;
//  winW = document.body.clientWidth;
  winH = document.body.clientHeight;
		   

 }
}

*/

	winH = getClientHeight();
	//alert(winH);
	
	//alert(document.documentElement.clientWidth); 
	//alert(document.body.clientHeight); 
	//alert(document.getElementById('full_menu_div').offsetHeight); 
	//alert(document.getElementById('full_menu_div').style.top);

//style.marginTop = "" + (offsetHeight < parentNode.offsetHeight ? parseInt((parentNode.offsetHeight - offsetHeight) / 2) + "px" : "0")

	var newtop = winH / 2 - document.getElementById('full_menu_div').offsetHeight / 2;
	if (newtop < 0) newtop = 0;

	document.getElementById('full_menu_div').style.top = newtop + "px";
	document.getElementById('full_menu_div').style.display = "block";
	
	//alert(document.getElementById('full_menu_div').style.top);

	
}

//from http://en.kioskea.net/faq/sujet-933-centering-vertically-a-web-page
function changeMenuPosition() {
	
	var iever = getInternetExplorerVersion();
if ((iever > 6) || (iever == -1)) {
//if (true) {


	var lmt = document.getElementById('full_menu_div');
	var container = document.documentElement;

	if(lmt && container)
	{
	    var containerHeight;
	    if (container.innerWidth)
	    {
            containerHeight = container.innerHeight;
		}
		else
		{
            containerHeight = container.clientHeight;
		}
	    var lmtHeight;
	    if (lmt.innerWidth)
	    {
            lmtHeight = lmt.innerHeight;
		}
		else
		{
            lmtHeight = lmt.offsetHeight;
		}
		var y = Math.ceil((containerHeight - lmtHeight) / 2);
		if(y < 0)
		{
			y = 0;
		}
		//lmt.style.position = "relative";
		lmt.style.top = y + "px";
		//alert(lmt.style.top);
	}
	if (document.getElementById)
	{
		document.body.style.visibility = 'visible';
	}
} else {
	//alert(iever);	
	winH = getClientHeight();
	//alert(winH);
	//alert(document.getElementById('full_menu_div').scrollHeight);
	
	var newtop = winH / 2 - document.getElementById('full_menu_div').scrollHeight / 2;
	if (newtop < 0) newtop = 0;
	//alert(newtop);

	document.getElementById('ie6fix').style.top = newtop + "px";
	document.getElementById('ie6fix').style.display = "block";

}
	
}

function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}


function getParameterFromLocation(name) {
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}


