var imgObj;
function checkImg(theURL,winName){
if (typeof(imgObj) == "object"){
if ((imgObj.width != 0) && (imgObj.height != 0))
OpenFullSizeWindow(theURL,winName, ",width=" + (imgObj.width+20) + ",height=" + (imgObj.height+30));
else
setTimeout("checkImg('" + theURL + "','" + winName + "')", 100)
}
}

function OpenFullSizeWindow(theURL,winName,features) {
var aNewWin, sBaseCmd;
sBaseCmd = "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,";
if (features == null || features == ""){
imgObj = new Image();
imgObj.src = theURL;
checkImg(theURL, winName)
}
else{
aNewWin = window.open(theURL,winName, sBaseCmd + features);
aNewWin.focus();
}
}

function photowin(url)
{newWindow=window.open(url,"NewWindow","width=656,height=496,menubar=0,toolbar=0,location=0,directories=0,scrollbars=0,status=0")}

function photowin2(url)
{newWindow=window.open(url,"NewWindow","width=656,height=800,menubar=0,toolbar=0,location=0,directories=0,scrollbars=0,status=0")}
