var imgObj;
function checkImg(theURL,winName){
  if (typeof(imgObj) == "object"){
    if ((imgObj.width != 0) && (imgObj.height != 0))
      OpenFullSizeWindow(theURL,winName, ",width=" + (imgObj.width+18) + ",height=" + (imgObj.height+25));
    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 urlOpen(URL,id,t,l, w, h) {

var windowprops = "location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=no" +

",left=" + l + ",top=" + t + ",width=" + w + ",height=" + h;
window.open(URL,id,windowprops);
}



function reloadcode(){ 
document.getElementById('safecode').src = '/include/code.asp?' + Math.random();
} 

