
var Fader = {
        make_hex : function (r,g,b) 
        {
                r = Math.round(r);
                g = Math.round(g);
                b = Math.round(b);
                r = r<0?0:r;
                g = g<0?0:g;
                b = b<0?0:b;
                r = r>255?255:r;
                g = g>255?255:g;
                b = b>255?255:b;
                
                r = r.toString(16); if (r.length == 1) r = '0' + r;
                g = g.toString(16); if (g.length == 1) g = '0' + g;
                b = b.toString(16); if (b.length == 1) b = '0' + b;
                return "#" + r + g + b;
        }
}

function fade(elem, steps, intervals, from, to) { 
    if (elem.colChangeMemInt) {
                window.clearInterval(elem.colChangeMemInt);
        }
        
        var rf = parseInt(from.substr(1,2),16);
        var gf = parseInt(from.substr(3,2),16);
        var bf = parseInt(from.substr(5,2),16);
        var rt = parseInt(to.substr(1,2),16);
        var gt = parseInt(to.substr(3,2),16);
        var bt = parseInt(to.substr(5,2),16);
        
    elem.currentR = rf;
    elem.currentG = gf;
    elem.currentB = bf;
    //alert(rf + " " + bf + " " + gf);
    elem.deltaR = (rt-rf)/steps;
    elem.deltaG = (gt-gf)/steps;
    elem.deltaB = (bt-bf)/steps;
    //alert(Fader.make_hex(elem.currentR,elem.currentG,elem.currentB));
    //alert(elem.deltaR + " " + elem.deltaG + " " + elem.deltaB);
        
    var actStep = 0;

    elem.colChangeMemInt = window.setInterval(
        function() { 
          elem.currentR += elem.deltaR; 
          elem.currentG += elem.deltaG; 
          elem.currentB += elem.deltaB;
          elem.style.background = Fader.make_hex(elem.currentR,elem.currentG,elem.currentB);
          actStep++;
          if (actStep > steps) {
                window.clearInterval(elem.colChangeMemInt);
                }
        } 
        ,intervals)
}


function loadurl(dest) {
 try {
   xmlhttp = window.XMLHttpRequest?new XMLHttpRequest():
                  new ActiveXObject("Microsoft.XMLHTTP");
 }
 catch (e) { /* do nothing */ }
 
 xmlhttp.onreadystatechange = triggered;
 xmlhttp.open("GET", dest);
 xmlhttp.send(null);
}


function triggered() {
  if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200))
    document.getElementById("output").innerHTML =xmlhttp.responseText;
}


function menumouseover(element) {
        if (element)
                fade(element, 20, 30, "#000000", "#7f7f7f");
}

function menumouseout(element) {
        if (element)
                fade(element, 20, 30, "#7f7f7f", "#000000");
}

// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this notice.

// SETUPS:
// ===============================

// Set the horizontal and vertical position for the popup

PositionX = 100;
PositionY = 100;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 660;
defaultHeight = 500;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
close();		
}}

