// user's functions


function isIE5() { return (navigator.userAgent.indexOf("MSIE 5") > -1); }
function isIE6() { return ((navigator.userAgent.indexOf("MSIE 6") > -1) && (navigator.userAgent.indexOf("Opera") == -1)); }
function isIE() { return (isIE5() || isIE6());}

function fixpng()
{
 for (var i = 0; i < document.images.length; i++)
 {
  var img = document.images[i];
  imgSrc = img.src;
  if (imgSrc.substr(imgSrc.length-3).toLowerCase() == "png")
  {
   var w, h;
   w = img.width, h = img.height;
   img.src = "_mod_files/ce_images/spacer.gif";
   img.width = w, img.height = h;
   img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'" + imgSrc + "\', sizingMethod='scale');";
  }
 }
}

var isIE = isIE();
if (isIE) window.attachEvent("onload", fixpng); 


var lastSelectedPhoto = '';

function showIt (idImage, srcImg, id)
{
	if (id) {
        if (lastSelectedPhoto != '') {
		    document.getElementById(lastSelectedPhoto).style.backgroundColor='#90A0C4';
        }
		document.getElementById(id).style.backgroundColor='#ffffff';
		document.getElementById('ann_photo_sel').innerHTML = document.getElementById(id + '_ann').innerHTML;
        lastSelectedPhoto = id;
	}
	document.images[idImage].src = srcImg;
}



	function flip(id) {
	
	document.getElementById(id).style.display="block";


	if (id == 'div1') {
		document.getElementById('div2').style.display="none";

	}
	else {
		document.getElementById('div1').style.display="none";
	}
	}

  function overfoto(elem, id) {

        document.getElementById('ann_photo_sel').style.display = 'none';

        elem.style.backgroundColor='#ffffff';

        document.getElementById('ann_photo').innerHTML = document.getElementById('td_photo_' + id + '_ann').innerHTML;
  }


    function outfoto(elem, id) {
         
         if(lastSelectedPhoto!='td_photo_' + id)
             {elem.style.backgroundColor='#90A0C4';}

         document.getElementById('ann_photo').innerHTML = '';

         document.getElementById('ann_photo_sel').style.display = 'block';

  }