function setModalSizes(colSuffix) {
  if ( navigator.appName == "Microsoft Internet Explorer") {
    ie=1; mz=0;
  }
  else {
    mz=1; ie=0;
  }
  windowsWidth = document.body.offsetWidth;
  windowsHeight = document.body.offsetHeight;
  if (document.getElementById("scModalBG"+colSuffix)) {
  	document.getElementById("scModalBG"+colSuffix).style.width = windowsWidth+"px";
  	document.getElementById("scModalBG"+colSuffix).style.height = windowsHeight+"px";
  }
}
//-----------------------------------------------------------------------------------------------------------
function openZoomify(projectId, contentId, picId, again, colSuffix)  { 
//alert (window.pageYOffsetwindow.pageYOffset);
	dojo.addOnLoad(function(){
		loadContent('browse.php?projectId='+projectId+'&contentId='+contentId+'&picId='+picId+'&colSuffix='+colSuffix, 'scModalMain'+colSuffix, null);
	});
	if (!again) {
		if (ie == 1) { 
			offset = document.body.scrollTop;
		}
		else {
			offset = window.pageYOffset;
		}
		containerOffset = 400;
		document.getElementById("scModalContainer"+colSuffix).style.top = (offset+containerOffset)+"px";
	}
//alert (document.getElementById("scModalContainer").style.top);
	document.getElementById("flashcontent").style.visibility = 'hidden';
	document.getElementById("keyvisual").style.visibility = 'hidden';
	if (document.getElementById("videolink") != null) document.getElementById("videolink").style.visibility = 'hidden';
	zoomifyFadeIn(colSuffix);
//	setTimeout("zoomifyFadeIn()",1250);
} 
//-----------------------------------------------------------------------------------------------------------
function zoomifyFadeIn(colSuffix)  { 
	Effect.Appear('scModalBG'+colSuffix, { to: 0.85 });
	Effect.Appear('scModalContainer'+colSuffix, { to: 1.0 });
	return false;
} 
//-----------------------------------------------------------------------------------------------------------
//function closeZoomify(projectId, contentId, picId, colSuffix)  {
function closeZoomify(colSuffix)  { 
	Effect.Fade('scModalContainer'+colSuffix, { to: 0.0 });
	Effect.Fade('scModalBG'+colSuffix, { to: 0.0 });
	document.getElementById("flashcontent").style.visibility = 'visible';
	document.getElementById("keyvisual").style.visibility = 'visible';
	if (document.getElementById("videolink") != null) document.getElementById("videolink").style.visibility = 'visible';
	return false;
} 
//-----------------------------------------------------------------------------------------------------------
function loadContent(contentUrl, targetDiv, formToSend) {
  var xhrConfig = {
    url:contentUrl,
    handleAs:"text",
    timeout:5000,
    preventCache:true,

    load: function(response, ioArgs) {
      dojo.byId(targetDiv).innerHTML = response;
      return response;
    },

    error: function(response, ioArgs) {
      //console.error("HTTP status code: ", ioArgs.xhr.status);
      return response;
    }
  };
  // make sure that the form exists
  if (document.forms[formToSend]) {
    xhrConfig.form = formToSend;
  }

  // do the server call
  dojo.xhrGet(xhrConfig);
}


