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 preloader(imgarray) {
     // counter
     var i = 0;
     // create object
     imageObj = new Image();

     // set image list
//      images = new Array();
//      images[0]="image1.jpg"
//      images[1]="image2.jpg"
//      images[2]="image3.jpg"
//      images[3]="image4.jpg"

     // start preloading
     for(i=0; i<=imgarray.length; i++) {
          imageObj.src=images[i];
     }
}
