/*
 * getObj(name)
 *
 * sets object and style
 */
function getObj(name)
{
  if (document.getElementById){
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
	this.obj = getObjNN4(document,name);
	this.style = this.obj;
  }
}

/*
 * hides element
 * @param string objectName
 */
function hideIt(objectName)
{
	objToHide = new getObj(objectName);
	objToHide.style.display = 'none';
}


/**
 * shows element. it allows to choose the way elemtns would be displayed
 * block, inline, table, etc.
 * @param string objectName
 * @param string displayStyle
 */
function showElement(objectName, displayStyle)
{
	objToShow = new getObj(objectName);
	objToShow.style.display = displayStyle;
}


/**
 * open image in new window
 * @param string url
 */
function w(url) 
{
	url = document.getElementsByTagName('base')[0].href + 'javascripts/img-window.php?url=' + url;
	//alert(url);
	var win = window.open(url,'','width=310,height=400,left=200,top=150,scrollbars=no,location=no,resizable=yes');

	if (win) {
		return false;
	}
	return true;
}

/**
 * change window width/height
 * @param int width
 * @param int height
 */
function resizeWindow(width, height) {
	//self.resizeTo(width + 50, height + 80);
	window.resizeTo(width + 16, height + 55);
}
