function openWindow(fln, w, h){
 windowName = 'wn' + w + h;
 PU(fln, w, h,windowName,false,false,false,false,false);
 return true;
}

function PU (url,x,y,name,sb,rs,st,lt,tb) {
 var win = null;
 var scrollbarstext = 'scrollbars = no,'; if (sb){scrollbarstext = 'scrollbars = yes,'}
 var resizabletext = 'resizable = no,'; if (rs){resizabletext = 'resizable = yes,'}
 var statustext = 'status = no,'; 	if (st){statustext = 'status = yes,'}
 var locationtext = 'location = no,'; 	if (lt){locationtext = 'location = yes,'}
 var toolbartext = 'toolbar = no,'; 	if (tb){toolbartext = 'toolbar = yes,'}
 var features = '';
 features = scrollbarstext+resizabletext+statustext;
 features = features + locationtext+toolbartext;
 features = features + 'width = '+x+',height = '+y;
 win = window.open(url, name, features);
 //win.document.onload = resizer;
 return true;
}

//you can set these variables
//var totalTime = 3000;//in milliseconds
//var startOpacity = 99.9999; // starting point for fade 
//var stopOpacity = 0; //end point for fade
//var numberOfSteps = 90; //number of steps

//other variables
//var speed; //in milliseconds
//var opacity; //starting point
//var step; //interval for each one
//var div;
//var startOpacity;

//function startFade(elName){
// opacity = startOpacity;
// step = (stopOpacity - startOpacity) / numberOfSteps;
// speed = totalTime / numberOfSteps;
// div = document.getElementById(elName);
// repeatFade();
// return true;
//}


//function repeatFade() {
// opacity += step;
// var last = false;
// if(Math.abs(stopOpacity - opacity) < Math.abs(step)) { 
//  opacity = stopOpacity;
//  last = true;
// }
// if(opacity >= 0 && opacity <= 100) {
//  div.style.filter = "alpha(opacity="+Math.round(opacity)+")";// IE/Winfilter: alpha(opacity=50)
//  div.style.KHTMLOpacity = opacity/100;// Safari<1.2, Konqueror
//  div.style.MozOpacity = opacity/100;// Older Mozilla and Firefox
//  div.style.opacity = opacity/100;// Safari 1.2, newer Firefox and Mozilla, CSS3
//  if(last == false) {
//   window.setTimeout("repeatFade()", speed);
//  }
//  else {
//   if(opacity < 10) {
//    div.style.display = "none";
//   }
//  }
// }
//}

jQuery(document).ready(
  function(){
        jQuery("#fadingImage").fadeOut();
 }
);


function SimpleSwap(el,which){
 var newsrc = el.getAttribute(which || "standardImage");
 el.src = newsrc;
}

function SimpleSwapSetup(){
 var div = document.getElementById("menuImages"); 
 var x = div.getElementsByTagName("img");
 for (var i=0;i<x.length;i++){
  if(x[i].getAttribute("src")) {
   if(x[i].id != "currentMenuImage") {
    var standardImage = x[i].getAttribute("src");
    var length = standardImage.length;
    var overImage = standardImage.substr(0, length - 4) + "O" + standardImage.substr(length - 4, 4);
    x[i].preloader = new Image();
    x[i].preloader.src = overImage;
    x[i].onmouseover = new Function("SimpleSwap(this,'overImage');");
    x[i].onmouseout = new Function("SimpleSwap(this);");
    x[i].setAttribute("overImage",overImage);
    x[i].setAttribute("standardImage",standardImage);
   }
  }
 }
}

