	function cropAddLoadEvent(func, resizeornot) {
	  var oldonload = window.onload;
	  if (typeof window.onload != 'function') {
	    window.onload = func;
	  } else {
	    window.onload = function() {
	      if (oldonload) {
	        oldonload();
	      }
	      func();
	    }
	  }
	}

	function crop(cropimg, reloadornot) {
		h = cropimg.height;
		w = cropimg.width;
		
		cropimg.parentNode.parentNode.id=(new Date()).getTime()+Math.floor(Math.random()*1000);
		
		if (h<150 || w<150) {
			cropimg.src = '';
			cropimg.alt = '';
			if (reloadornot != false) {
				randomimage(cropimg.parentNode.parentNode.id);
			} else {
				var element = document.getElementById(cropimg.parentNode.parentNode.id);
				element.parentNode.remove(0);
			}
			return true;
		}
		
		offsetleft = 0;
		offsettop = 0;
		height = '';
		width = '';
		if (h > w) {
			width = '135px';
			offsettop = Math.round((-1)*(h/w*150-150)/2);
		} else {
			height = '135px';
			offsetleft = Math.round((-1)*(w/h*150-150)/2);
		}		
		
		cropimg.style.height = height;
		cropimg.style.width = width;
		cropimg.style.marginLeft = offsetleft + 'px';
		cropimg.style.marginTop = offsettop + 'px';
		// cropimg.onload = setTimeout(randomimage(cropimg.parentNode.parentNode.id), 15000);
	}
	
  function cropover(cropimg) {
		cropimg.parentNode.parentNode.parentNode.style.borderColor='#333';
	}
	
	function cropout(cropimg) {
		cropimg.parentNode.parentNode.parentNode.style.borderColor='#CCC';
	}