var fadeObjects = new Object();
var fadeTimers = new Object();
var fadeClick = new Object();

function fade(object, fade_to){

    if (object != "[object]") eval("object="+object);

    //const wont work :'(
    var delta = 10;

    //cancel all other fades acording to this object
    clearTimeout(fadeTimers[object.sourceIndex]);


    //determine if its a fade in or out.
    var direction = 1;
    if (fade_to-object.filters.alpha.opacity < 0){
        direction = -1;
    }

    if (direction == 1) {
      if (object.filters.alpha.opacity+delta >= fade_to) {
        object.filters.alpha.opacity=fade_to;
        return;
      }
      else
        object.filters.alpha.opacity+=delta;
    }
    else {
      if (object.filters.alpha.opacity-delta <= fade_to) {
        object.filters.alpha.opacity=fade_to;
        return;
      }
      else
        object.filters.alpha.opacity-=delta;
    }

    fadeObjects[object.sourceIndex]=object;
    fadeTimers[object.sourceIndex]=setTimeout("fade(fadeObjects["+object.sourceIndex+"],"+fade_to+")",10);
    //asdf.innerHTML = fadeTimers[object.sourceIndex];
  }

function fadeclick(object) {
  if (fadeClick[object.sourceIndex]) {
    fadeClick[object.sourceIndex]=0;
    fade(object, 0);
  }
  else {
    fadeClick[object.sourceIndex]=1;
    fade(object, 100);
  }
}

function show(object,cur) {
        document.getElementById(cur).style.display = 'none';
        document.getElementById(object).style.display = 'block';
}



/**
* This function does a redirect to a specified url.
* IE works perfectly just using window.location.href buy Firefox fails.  This is why... Its because Firefox for some reason
* does not fire immediately and needs a small delay in order to work.  This script has a 1 second delay which works
* 100% in IE and firefox.
* 
* Usage example:
*   <input type='button' name='cancel' value='Cancel' onclick="do_redirect("http://domain.com"); />         
*/
function do_redirect(URL)
{
    varHowLong = "1000";
    varURL = URL;
    
    self.setTimeout("self.location.href=varURL;", varHowLong);
    return false;
}


//START - Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com
var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")
//END - Disable right click script III- By Renigade (renigade@mediaone.net)
