
function viewVideo(pages){
		// height="376" width="410"
	if(document.all)
		window.open(pages,"ok","toolbar=no,location=no, status=no,scrollbars=yes,menubar=no,directories=no,copyhistory=no,resizable=no,width=336,height=265,top=200,left=300");
	else
		window.open(pages,"ok","toolbar=no,location=no, status=no,scrollbars=yes,menubar=no,directories=no,copyhistory=no,resizable=no,width=320,height=260,top=200,left=300");
}

//The following code get from http://www.hightech-board.de/showthread.php?t=614
//Customized by blackhorse
var img;
var fenster;
var toHandle;
var xProcess=0;
function openImage(vLink){
	var sLink = (typeof(vLink.href) == 'undefined') ? vLink : vLink.href;
	if (sLink == ''){return false;}
	showimg(sLink);
	if (typeof(vLink.href) != 'undefined'){return false;}
}

function openImageX(vLink){
	var sLink = (typeof(vLink.href) == 'undefined') ? vLink : vLink.href;
	if (sLink == ''){return false;}
	xProcess=1;
	showimg(sLink);	
	if (typeof(vLink.href) != 'undefined'){return false;}
}

function showimg(src){
	if(fenster){fenster.close();}
	img = new Image();
	img.src = src;
	waitUntilLoaded();
}

function waitUntilLoaded(){
	if(img.complete){
		clearTimeout(toHandle);
		window.status='co';
		openwindow();
	}else{
		toHandle=setTimeout("waitUntilLoaded();",100);
	}
}

function openwindow(){
	var h = img.height;
	var w = img.width;	
	fenster = window.open("","fenster","height="+h+", width="+w);
	fenster.moveTo((screen.width - w)/2,(screen.height - h-50)/2);
	fenster.document.write(img_doc(img.src));
}

function img_doc(src){
	var html = "";
	html = html + "<html><head><title>Thumbnail view</title></head>";
	html = html + "<body style=\"margin: 0;\" bgcolor=\"#000000\">";
	html = html + "<a href=\"javascript:window.close()\"><img src=\""+src+"\" border=\"0\"></a>";
	html = html + "</body></html>";

	return html;
}
