// JavaScript Document

no_of_images=6;

function rotate_image() {
	imageId = 'header_right';
	num=Math.ceil(Math.random()*no_of_images);
	document.getElementById(imageId).src="../../images/header_right_" + num + ".jpg";
	image = document.getElementById(imageId);
	setOpacity(image, 0);
	image.style.visibility = 'visible';
	fadeIn(imageId,0);
}


function setOpacity(obj, opacity) {
  opacity = (opacity == 100)?99.999:opacity;
  
  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";
  
  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;
  
  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;
  
  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
  
}

function fadeIn(objId,opacity) {
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (opacity <= 100) {
      setOpacity(obj, opacity);
      opacity += 10;
      window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 50);
    }
  }
}
function show_squareL1(img) {
	document.getElementById(img).src="../../images/one.gif";
	
}
function hide_squareL1(img) {
	document.getElementById(img).src="../../images/shim.gif";
	
}
function show_squareL2(img) {
	document.getElementById(img).src="../../images/two.gif";
	
}
function hide_squareL2(img) {
	document.getElementById(img).src="../../images/shim.gif";
	
}
function show_squareL3(img) {
	document.getElementById(img).src="../../images/three.gif";
	
}
function hide_squareL3(img) {
	document.getElementById(img).src="../../images/shim.gif";
	
}