function fitPicture() {	var x,y;	var imgWidth = document.images[0].width;	var imgHeight = document.images[0].height;	if (self.innerHeight) { // all except Explorer		x = self.innerWidth;		y = self.innerHeight;	} else if (document.documentElement && document.documentElement.clientHeight) {// Explorer 6 Strict Mode		x = document.documentElement.clientWidth;		y = document.documentElement.clientHeight;	} else if (document.body) { // other Explorers		x = document.body.clientWidth;		y = document.body.clientHeight;	}	var newWidth = imgWidth - x ;	var newHeight = imgHeight - y;	window.resizeBy(newWidth, newHeight);	//Reposition window	newX = parseInt((window.screen.availWidth-imgWidth)/2);	newY = parseInt((window.screen.availHeight-imgHeight)/2);	if (newX > 0 && newX > 0) {		window.moveTo(newX,newY);	}	self.focus();}function newWin(l) {	window["popup"+wCount] = window.open("","popup"+window["wCount"],"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=400,height=400");	window["popup"+wCount].document.write('<html><head><title>' + l.innerHTML + '</title><script type="text/javascript" src="popup.js"></script></head><body style="padding:0;margin:0;" onclick="window.close();"><img src="' + l.href + '" onload="fitPicture();" /></body></html>');}window.onload = function() {	window["wCount"] = 0;	if (document.getElementById("designs")) {		var popLinks = document.getElementById("designs").getElementsByTagName("a");		for (var x=0; x<popLinks.length; x++) {			if (popLinks[x].href.indexOf('.jpg') > -1) {				popLinks[x].onclick = function() {					newWin(this);					window[wCount]++;					return false;				};			}		}	}}