function popupImg() {
	var url=this.href;
	var dim=this.getAttribute('dimensions').split(',');
	
	var popup=window.open(url,'name','height='+(parseInt(dim[1])+20)+',width='+(parseInt(dim[0])+20)+',top=200,left=400,status=no,dependent=yes,scrollbars=no');
	if (window.focus) 
		{ popup.focus(); }
		return false;
}

function zoomy() {
	var a=document.getElementsByTagName('a');
	for(var i=0;i<a.length;i++) {
		if(a[i].type=='popup') {
			a[i].onclick=popupImg;
		}
	}
}

function onlyNum(e) {
   var unicode=e.charCode? e.charCode : e.keyCode
   if (unicode>33 && unicode<40)
      {
      return true;
      }
   if (unicode!=8 && unicode!=9 && unicode!=13)
      { 
      if (unicode<48 || unicode>57)
         {
         return false;
         }
      }
}


function orefresh() {
	 opener.location.reload();
	self.close();
}

function sclose() {
	self.close();
}

function equalize() {
			var atop = document.getElementById('top').offsetHeight;
			var amenu = document.getElementById('mwrapper').offsetHeight;
			var acontent = document.getElementById('rightpanel').offsetHeight;
			var adiff = (amenu-acontent);
			if (adiff<acontent) {
				adiff = 20 + 'px';
			} else {
				document.getElementById('fiametta_spacer').style.height = 20 + 'px';
				document.getElementById('fiametta_spacer').style.marginTop = (amenu+205) + 'px';
			}
}

function preload(images) {
    if (document.images) {
        var i = 0;
        var imageArray = new Array();
        imageArray = images.split(',');
        var imageObj = new Image();
        for(i=0; i<=imageArray.length-1; i++) {
            //document.write('<img src="' + imageArray[i] + '" />');
            imageObj.src=images[i];
        }
    }
}

