/*if (window.createPopup && document.compatMode && document.compatMode=="CSS1Compat")
{
  document.onreadystatechange = onresize = function fixIE6AbsPos()
  {
    if (!document.body) return;
    if (document.body.style.margin != "0px") document.body.style.margin = 0;
    onresize = null;
    document.body.style.height = 0;
    setTimeout(function(){ document.body.style.height = document.documentElement.scrollHeight+'px'; }, 1);
    setTimeout(function(){ onresize = fixIE6AbsPos; }, 100);
  }
}
*/

var newWindow;
var newNewsWindow;
var newGuestWindow;
var newDistWindow;

/*
Gradual-Highlight Image Script II-
By J. Mark Birenbaum (birenbau@ugrad.cs.ualberta.ca)
*/

nereidFadeObjects = new Object();
nereidFadeTimers = new Object();

/* object - image to be faded (actual object, not name);
 * destop - destination transparency level (ie 80, for mostly solid)
 * rate   - time in milliseconds between trasparency changes (best under 100)
 * delta  - amount of change each time (ie 5, for 5% change in transparency)
 */

function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
    if (object != "[object]"){  //do this so I can take a string too
        setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
        return;
    }

    clearTimeout(nereidFadeTimers[object.sourceIndex]);

    diff = destOp-object.filters.alpha.opacity;
    direction = 1;
    if (object.filters.alpha.opacity > destOp){
        direction = -1;
    }
    delta=Math.min(direction*diff,delta);
    object.filters.alpha.opacity+=direction*delta;

    if (object.filters.alpha.opacity != destOp){
        nereidFadeObjects[object.sourceIndex]=object;
        nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
    }
}

function openWindow(newURL, newTitle, newWidth, newHeight) {
var baseURL = 'http://www.whiskygnuen.dk/showpicture.html?';
baseURL += escape(newURL);
baseURL += "&" + escape(newTitle);

if(newWindow && !newWindow.closed) {
newWindow.close();
}

newWindow = window.open(baseURL, 'pictureWindow','width=' + newWidth + ',height=' + newHeight + ',toolbar=no');
}



function openNews(newURL, newTitle, newWidth, newHeight) {
var baseURL = 'http://www.whiskygnuen.dk/news.php?';
baseURL += newURL;

  if(newNewsWindow && !newNewsWindow.closed) {
    newNewsWindow.focus();
  } else {
    newNewsWindow = window.open(baseURL, 'newsWindow','width=' + newWidth + ',height=' + newHeight + ',toolbar=no');
  }
}

function openDistilleri(newURL, newTitle, newWidth, newHeight) {
var baseURL = 'http://www.whiskygnuen.dk/distilleri.php?';
baseURL += newURL;

  if(newDistWindow && !newDistWindow.closed) {
    newDistWindow.focus();
  } else {
    newDistWindow = window.open(baseURL, 'newsWindow','width=' + newWidth + ',height=' + newHeight + ',toolbar=no');
  }
}

function openGuestMessage(newWidth, newHeight) {
var baseURL = 'http://www.whiskygnuen.dk/guestmessage.php';


  if(newGuestWindow && !newGuestWindow.closed) {
    newGuestWindow.focus();
  } else {
    newGuestWindow = window.open(baseURL, 'guestWindow','width=' + newWidth + ',height=' + newHeight + ',toolbar=no');
  }
}

function overTD() {td = window.event.srcElement; while(td.tagName.toUpperCase() != 'TD' ) {td = td.parentElement;}td.style.cursor="hand";}
function outOfTD(){td = window.event.srcElement;while (td.tagName.toUpperCase() !='TD') {td = td.parentElement;}}
function overTR() {tr = window.event.srcElement;if( tr.tagName.toUpperCase() == 'TABLE' ){return;}  while(tr.tagName.toUpperCase() != 'TR' ) {tr = tr.parentElement;}tr.style.background = "CCCC99";}
function outOfTR(){tr = window.event.srcElement;if (tr.tagName.toUpperCase() == 'TABLE') {return;}while(tr.tagName.toUpperCase() !='TR') {tr = tr.parentElement;}tr.style.background ="F5F5DC";}
function overTR1() {tr = window.event.srcElement;if( tr.tagName.toUpperCase() == 'TABLE' ){return;}  while(tr.tagName.toUpperCase() != 'TR' ) {tr = tr.parentElement;}tr.style.background = "99CCFF";tr.style.color = "black";}
function outOfTR1(){tr = window.event.srcElement;if (tr.tagName.toUpperCase() == 'TABLE') {return;}while(tr.tagName.toUpperCase() !='TR') {tr = tr.parentElement;}tr.style.background ="EEEEEA";tr.style.color = "darkgray";}
