function provalol(){
	accordionClicks = document.getElementsByClassName('accordion-click');
	accordionContents = document.getElementsByClassName('accordion-content');
	accordion = new fx.Accordion(accordionClicks, accordionContents, {opacity: false, duration: 300 });
}

function amenu(name){
fader = new fx.Opacity('secondaryContent', {duration: 500});
new ajax ('./skins/acp/menu_' + name + '.html', {postBody: '', update: $('secondaryContent'), onStart: myFunction(), onComplete: myFunction()});
}
function menu(name){

fader = new fx.Opacity('secondaryContent', {duration: 500, onComplete: function()
  {
	new ajax ('./skins/acp/menu_' + name + '.html', {postBody: '', update: $('secondaryContent'), onComplete: myFunction()});
  }
});
fader.toggle();
setTimeout("fader.toggle()",1000);
setTimeout("provalol()",5000);
accordionClicks = document.getElementsByClassName('accordion-click');
	accordionContents = document.getElementsByClassName('accordion-content');
	accordion = new fx.Accordion(accordionClicks, accordionContents, {opacity: false, duration: 300 });

}

function topmenu(){

   var myHeight2 = new fx.Height('toppanel', {duration: 400, transition: fx.sineIn});
   //myHeight2.hide();
   $('dash').onclick = function() {
      myHeight2.toggle();
   };
   
var myHeight = new fx.Height('toppanel', {duration: 400, transition: fx.sineIn}); 
//fader = new fx.Opacity('toppanel', {duration: 500});
//fader.toggle();
accordionClicks = document.getElementsByClassName('acc');
	accordionContents = document.getElementsByClassName('acontent');
	accordion = new fx.Accordion(accordionClicks, accordionContents, {opacity: false, duration: 300 });
}


function myFunction(request){

}

function doRedirect(link, sec) {
if (link == "this") {
	link = window.location.href;
}
window.setTimeout("location.href='"+link+"'", sec);
}

function menu_home(){

new ajax ('./skins/acp/menu_home.html', {postBody: 'sleep=3', update: $('secondaryContent'), onComplete: myFunction});
}

function page(name, param){
if(param==null)
    param = '';
myHeight = new fx.Height('primaryContent', {onComplete: function()
  {
	new ajax ('./'+name+'.php'+param, {postBody: '', update: $('primaryContent')});
  }});

myHeight.toggle();
setTimeout("myHeight.toggle()",2000);
}

function makelogin(){
usr = document.getElementById("username").value
pass=document.getElementById("password").value
var poststr = "s=s&username=" + encodeURI(usr) + "&password=" + encodeURI(pass)
new ajax ('./login.php', {postBody: poststr, update: $('notify')});

}

function makelogout(){
new ajax ('./login.php', {postBody: 'l=l', update: $('notify')});
}

function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  document.getElementById("oscura").style.width = scrOfX;
  document.getElementById("oscura").style.height = scrOfY;
  return [ scrOfX, scrOfY ];
}
function ApriOscura(lol) {
	if (!lol > 0)
		lol = 0;
	lol += 10;

    if (navigator.appVersion.indexOf("MSIE")!=-1){
         document.getElementById("oscura").style.width = screen.width;
         document.getElementById("oscura").style.height = screen.height;
    }
    a = lol/100;
	document.getElementById("oscura").style.display = "block";

	document.getElementById("notify").style.display = "block";
	document.getElementById("oscura").style.filter = "alpha(opacity="+lol+")";
    document.getElementById("oscura").style.opacity = a;
    if( lol < 70)
	setTimeout('ApriOscura('+lol+')', 50);
}

function ChiudiOscura(lol) {
		if((lol<=70) && (lol>0))
			lol -= 10;
		else
			lol = 70;
		a = lol/100;
	document.getElementById("oscura").style.filter = "alpha(opacity="+lol+")";
    document.getElementById("oscura").style.opacity = a;
    if( lol > 0)
	setTimeout('ChiudiOscura('+lol+')', 50);
	else{
	document.getElementById("oscura").style.display = "none";
	document.getElementById("notify").style.display = "none";
	}
}
