function setCookie(name, value, expires, path, domain){
 var exdate=new Date();exdate.setDate(exdate.getDate()+expires);
 var curCookie = name + "=" + escape(value) +
  ((expires) ? "; expires=" + exdate.toGMTString() : "") +
  ((path) ? "; path=" + path : "") +
  ((domain) ? "; domain=" + domain : "");
 document.cookie = curCookie;
}

function getCookie(name){
 if(document.cookie.length>0){
  start=document.cookie.indexOf(name + "=");
  if(start!=-1){ 
   start=start + name.length+1; 
   end=document.cookie.indexOf(";",start);
   if(end==-1){
    end=document.cookie.length;
   }
   return unescape(document.cookie.substring(start,end));
  } 
 }
 return "";
}

function Collapse(x){
 if(document.getElementById(x).style.display=='none'){
  document.getElementById(x).style.display='block';
  document.getElementById(x+'_img').src="images/minus.png";
  setCookie(x, "expand", 0, "/", ".emagware.com");
 }else{
  document.getElementById(x).style.display='none';
  document.getElementById(x+'_img').src="images/plus.png";
  setCookie(x, "collapse", 0, "/", ".emagware.com");
 }}

function CollapseAll(x,y,z){
 for(var j=y; j<=z; j++){
  document.getElementById('c'+x+'_'+j).style.display='none';
 }
 document.getElementById('scroller').scrollTop = 0;
}

function MM_setTextOfLayer(objId,x,newText) {
  with (document) if (getElementById && ((obj=getElementById(objId))!=null))
    with (obj) innerHTML = unescape(newText);
}

function MM_showHideLayers() {
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MenuMMO() {
$('defaultinfo').hide()
new Effect.Morph('libinfo', { style: 'color:#999999', duration: 0.0 })
}

function MenuMO() {
MM_setTextOfLayer('f_definition','','')
$('defaultinfo').show()
new Effect.Morph('libinfo', { style: 'color:#FFFFFF', duration: 0.0 })
}

function ShowCC() {
new Effect.Move('console_b', { x:72 , y: 0, mode: 'absolute', duration: 0.5, queue:'1' })
new Effect.Move('lib_title', { x:14 , y: 5, mode: 'absolute', duration: 0.5, queue:'1' })
Effect.Fade('reveal_console', { duration: 1.0, queue:'end' })
new Effect.Morph('console_c', { style: 'top:0px; left:315px; width:707px;', duration: 0.5, queue:'front' })
}

function closenavtree()	{
new Effect.Move('navtree', { x: -237, y: 44, mode: 'absolute', duration: 0.5, queue:'1' })
new Effect.Morph('mycubepages', { style: 'width:1024px; top:45px; left:0px;', duration: 0.5, queue:'1'})
}