function hideimg() {
	document.getElementById("largescreenshot").style.display="none";
}
function showimg (url,iwidth,iheight) {
url = "/" + url;
shadow(1);
document.getElementById("scrprd").style.display="block";
document.getElementById("scrprd").innerHTML="<a href=\"javascript:showimg_off()\"><img src=\"" + url +"\" border=\"0\" alt=\"click to close\" width=\""+ iwidth +"\" height=\""+ iheight +"\"></a><br/><div class=\"rowtablet\"><input type=\"button\" class=\"button\" value=\"close\" onclick=\"showimg_off()\"></div>";

document.getElementById("scrprd").style.left=((document.body.clientWidth - document.getElementById("scrprd").offsetWidth)/2) + "px";
document.getElementById("scrprd").style.top = document.documentElement.scrollTop + "px";


//window.open(url,'_blank',toolbar='no', status='no', menubar='no', location='no');
//window.open(url,'_blank');

/*
	if (!document.getElementById("largescreenshot")) {
		document.body.innerHTML = document.body.innerHTML + 
		"<div align='center' id='largescreenshot' style='position:fixed;top:0;left:0;height:400px;width:100%;border: solid 1px #000;'>" + 
		"<a href='javascript:hideimg();'>"+
		"<img id='sshot' src='"+ url +"' style='border-width:0px;'>" +
		"</a></div>";
	} else {
		document.getElementById("sshot").src = url;	
		document.getElementById("largescreenshot").style.display="";
	}
*/
}

function showimg_off() {
document.getElementById("scrprd").style.display="none";
shadow(0);
}







function opacity_image(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}



function show_screenshot_preview(id) { // for index page previews
	changeOpac(0,'image_'+id);
	document.getElementById('image_'+id).style.display="block";
	opacity_image('image_'+id, 0, 100, 300);
	var pitch = 105; if (navigator.appName=="Microsoft Internet Explorer") { pitch = 0; }
	document.getElementById('image_'+id).style.left = (document.getElementById('image_'+id).offsetLeft + pitch + "px");
	//document.getElementById('image_'+id).style.left = document.getElementById('image_'+id).offsetLeft + "px";
	//alert(document.getElementById('image_'+id).offsetLeft);
}

function hide_screenshot_preview(id) {
	document.getElementById('image_'+id).style.left = '';
	document.getElementById('image_'+id).style.display='none';
}




function shadow(isTurn) {
	if (isTurn) {
		changeOpac(0,'shadow');
		changeOpac(0,'imgshadow');
		document.getElementById("shadow").style.display = "block";
		document.getElementById("shadow").style.height = document.body.clientHeight + "px";
		opacity_image('shadow', 0, 70, 300);
		opacity_image('imgshadow', 0, 70, 300);
		//document.body.style.overflow="hidden";
		
	} else {
		opacity_image('shadow', 70, 0, 300);
		opacity_image('imgshadow', 70, 0, 300);
		setTimeout('document.getElementById("shadow").style.display="none";',300);
		//document.body.style.overflow="visible";
		
	}
}