var fontSize = getCookie('venusFontSize')||11;

if (fontSize<=11) fontSize=11; 

if (fontSize>=30) fontSize=11; 



function attachMenuBehaviour() {

	var menu = document.getElementById('mainMenu');

	for (var i=1; i<menu.childNodes.length-1; i++) {

		if (menu.childNodes[i].nodeType==1) {

			menu.childNodes[i].sub = menu.childNodes[i].lastChild.nodeType==1?menu.childNodes[i].lastChild:menu.childNodes[i].lastChild.previousSibling;

			menu.childNodes[i].onclick = function() {

				if(this.sub&&this.id!='fontSize') this.sub.style.display = (this.sub.style.display=='block')?'none':'block';

			}

			menu.childNodes[i].onselectstart = function() {return false}

		}

	}

}

onload = function() {

	document.body.style.fontSize=fontSize+'px';

	attachMenuBehaviour();

	

}



function fontUp() {

	fontSize+=3;

	if (fontSize>=30) fontSize=30; 

	document.body.style.fontSize=fontSize+'px';

	setCookie('venusFontSize',fontSize,new Date(2004,12,31));

}

function fontDown() {

	fontSize-=3;

	if (fontSize<=11) fontSize=11; 

	document.body.style.fontSize=fontSize+'px';

	setCookie('venusFontSize',fontSize,new Date(2004,12,31));

}



function setCookie(name, value, expires, path, domain, secure) {

  var curCookie = name + "=" + escape(value) +

      ((expires) ? "; expires=" + expires.toGMTString() : "") +

      ((path) ? "; path=" + path : "") +

      ((domain) ? "; domain=" + domain : "") +

      ((secure) ? "; secure" : "");

  document.cookie = curCookie;

}



function getCookie(name) {

  var dc = document.cookie;

  var prefix = name + "=";

  var begin = dc.indexOf("; " + prefix);

  if (begin == -1) {

    begin = dc.indexOf(prefix);

    if (begin != 0) return null;

  } else

    begin += 2;

  var end = document.cookie.indexOf(";", begin);

  if (end == -1)

    end = dc.length;

  return unescape(dc.substring(begin + prefix.length, end));

}

function openCam(uri) {
	window.open(uri,'','resizable=yes,scrollbars=yes,width=800,height=600');
}