function preloadImages( imageRoot )
{
  if (document.images) 
  {
  preloadPics( imageRoot+'/footer/',
        'jetstyle',  'jetstyle-'
  );

  preloadPics( imageRoot+'/siteicons/',
        'home',  'home-',
        'search',  'search-',
        'sitemap',  'sitemap-'
  );

/*
  preloadPics( imageRoot+'/wrapper/',
        'letter',  'letter_',  'letter__',
        'external',  'external_',  'external__',
        'zoom',  'zoom_',  'zoom__',
        'home',  'home_',  'home__',
        'ajax-loader-arrows'
  );
  */
  
  
  }

  preloadFlag = true;
}
/*
function popup_image(url,width,height, top, left){
	if(name==null) name='_blank';
	format = "top="+top+",left="+left+", height="+height+", width="+width+",status=yes,toolbar=no";
	var t = window.open(url,'_blank', format);
}
*/
function popup_image(popup_href, img_width, img_height)
{

  var paddingTop=0;
  var paddingBottom=0;
  var paddingLeft=0;
  var paddingRight=0;
  if (typeof screen.availWidth != 'undefined' && typeof screen.availHeight != 'undefined')
  {
    if (typeof screen.availLeft != 'undefined' && typeof screen.availHeight != 'undefined')
    {
      var left = Math.max(0, Math.ceil(screen.availLeft + (screen.availWidth - img_width - paddingLeft - paddingRight) / 2));
      var top = Math.max(0, Math.ceil(screen.availTop + (screen.availHeight - img_height - paddingTop - paddingBottom) / 2));
    }
    else
    {
      var left = Math.max(0, Math.ceil((screen.availWidth - img_width - paddingLeft - paddingRight) / 2));
      var top = Math.max(0, Math.ceil((screen.availHeight - img_height - paddingTop - paddingBottom) / 2));
    }
  }
  else
  {
    var left = 0;
    var top = 0;
  }

  var preview = window.open(popup_href, 'preview', 'width='+img_width+',height='+img_height+',top='+top+',left='+left+',resizable=0,toolbar=0,directories=0,location=0,menubar=0,personalbar=0,scrollbars=0,status=0');
  preview.focus(); 
  return false;
}

function setOpacity( id, opacity ){
      obj = findObj(id);
      obj.style['opacity'] = opacity;
      obj.style['-moz-opacity']= opacity;
      if (opacity==1)
        obj.style.filter='';
      else
        obj.style.filter='Alpha(Opacity='+(opacity*100)+')';
           
      //alert(obj.style['filter']);
}
