var itarget = 'pic_0';
var itxt ='';
var is1 = '';
var is2 = '';
var is3 = '';


function OpenWindow(PageName, Width, Height, ResizableOption ){ 
	window.open(PageName,"win1","toolbar=no,directories=no,resize="+ResizableOption+",menubar=no,location=no,scrollbars=yes,width="+Width+",height="+Height+",maximize=null,top=70,left=80");

 }
 
function EnlargeImage(imgpath){
	if(imgpath==''){
		document.getElementById("EnlargeImage").style.display='none';
	}else{
		document.getElementById("EnlargeImage").innerHTML = '<img src="'+imgpath+'" border=0 id=pic_0  >';
		document.getElementById("EnlargeImage").style.display='inline';
		
	}
}


// setopacity for IE and FF (IE between 0 and 100 FF from 0 to 1)
//
function SetOpacity(elem, opacityAsInt)
//
{
var opacityAsDecimal = opacityAsInt;

   if (opacityAsInt > 100)
      opacityAsInt = opacityAsDecimal = 100; 
     else if (opacityAsInt < 0)
         opacityAsInt = opacityAsDecimal = 0; 
     
    opacityAsDecimal /= 100;
   if (opacityAsInt < 1)
        opacityAsInt = 1; // IE7 bug
    
    elem.style.opacity = (opacityAsDecimal);
    elem.style.filter  = "alpha(opacity=" + opacityAsInt + ")";
}

//

function FadeOpacity(elemId, fromOpacity, toOpacity, time, fps, itarget, itxt)
{ 
    var steps = Math.ceil(fps * (time / 1000));
   // var steps = 3;
    var delta = (toOpacity - fromOpacity) / steps;

    FadeOpacityStep(elemId, 0, steps, fromOpacity, delta, (time / steps), itarget, itxt);

}

//


function FadeOpacityStep(elemId, stepNum, steps, fromOpacity, delta, timePerStep, itarget, itxt)
{ 
			SetOpacity(document.getElementById(elemId), Math.round(parseInt(fromOpacity) + (delta * stepNum)));
		
		
			if (stepNum < steps)
				setTimeout("FadeOpacityStep('" + elemId + "', " + (stepNum+1) 
						 + ", " + steps + ", " + fromOpacity + ", "
						+ delta + ", " + timePerStep + ", '" + itarget + "', '" + itxt + "');", timePerStep);
		
		else 
		{
		if (itarget=='stop') {
		
		//document.getElementById('id_txt').innerHTML =itxt; 
		document.getElementById(elemId).title = itxt.substring(0,itxt.indexOf(' - '));
		
		return;
		
		
		}
		
		
		document.getElementById(elemId).src=document.getElementById(itarget).src
		FadeOpacity('pic_0', 0, 100, 500, 20, 'stop', itxt);
		
		
		}
}