function getObject(objectName)
{	
  var objItem;
  
  if (document.all)
    objItem = document.all[objectName];
  else
  {
    objItem = document.getElementById(objectName);
    if (objItem==null)
      objItem= document.getElementsByName(objectName)[0];
    if (document.getElementsByName(objectName).length>1)
      objItem=document.getElementsByName(objectName);	
  }
  if(objItem == null) return false;
  return objItem;
}

function getName (object)
{
  return (object.name) ? object.name : object.id;
}

function set_screen()
{
	main_text_obj = getObject("main_text");
	sidebox_obj = getObject("sidebox");
	docbody_obj = getObject("docbody");
	credit_obj =getObject("credit");
	
	main_text_total_h = main_text_obj.offsetHeight + main_text_obj.offsetTop;
	docbody_total_h = docbody_obj.offsetHeight;
	
	use_h = Math.max(main_text_total_h, docbody_total_h);
	
	sidebox_obj.style.height = use_h;
	credit_obj.style.top = use_h - (credit_obj.offsetHeight + 10);
}

function view_pic(filename) {
	
	pic_url = parse_bigpic(filename);
	
	//return;

	launch(pic_url);
}


function launch(url) {

  self.name = "opener";
  remote = open("popup.html?" + url, "remote", "resizable,width=200,height=200,left=50,top=50");
  
}

function parse_bigpic(filename)
{
	path = filename.substring(0,filename.lastIndexOf("/"));
	file = filename.substring(filename.lastIndexOf("/"), filename.length);
	
	//alert(path + "\n" + file)
	
	bigpic = path + "/big" + file;
	
	return bigpic;
}