$.fn.delay = function(time, callback){
    // Empty function:
    jQuery.fx.step.delay = function(){};
    // Return meaningless animation, (will be added to queue)
    return this.animate({delay:1}, time, callback);
}

function getElementsByClassName(node,classname) {
  if (node.getElementsByClassName) { // use native implementation if available
    return node.getElementsByClassName(classname);
  } else {
    return (function getElementsByClass(searchClass,node) {
        if ( node == null )
          node = document;
        var classElements = [],
            els = node.getElementsByTagName("*"),
            elsLen = els.length,
            pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)"), i, j;

        for (i = 0, j = 0; i < elsLen; i++) {
          if ( pattern.test(els[i].className) ) {
              classElements[j] = els[i];
              j++;
          }
        }
        return classElements;
    })(classname, node);
  }
}

	window.onload = function() {
		
		var myWidth = 0, myHeight = 0;
		if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
		}
		
		if (document.getElementById("imageGallery"))
			document.getElementById("imageGallery").style.height = myHeight -60 + "px";
			
		if (document.getElementById("boxFrecciaDestra")) {
			document.getElementById("boxFrecciaDestra").style.left= 0 + "px";
			document.getElementById("boxFrecciaDestra").style.top= 40 + "px";
			document.getElementById("boxFrecciaDestra").style.height= myHeight-100 + "px";
		}
		
		if (document.getElementById("boxFrecciaSinistra")) {
			document.getElementById("boxFrecciaSinistra").style.right= 0 + "px";
			document.getElementById("boxFrecciaSinistra").style.top= 40 + "px";
			document.getElementById("boxFrecciaSinistra").style.height= myHeight-100 + "px";
		}
	}
	
	window.onresize = function() {
		var myWidth = 0, myHeight = 0;
  		if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
		}
	
		if (document.getElementById("imageGallery"))
			document.getElementById("imageGallery").style.height = myHeight -60 + "px";
			
		if (document.getElementById("boxFrecciaDestra")) {
			document.getElementById("boxFrecciaDestra").style.left= 0 + "px";
			document.getElementById("boxFrecciaDestra").style.top= 40 + "px";
			document.getElementById("boxFrecciaDestra").style.height= myHeight-100 + "px";
		}
		
		if (document.getElementById("boxFrecciaSinistra")) {
			document.getElementById("boxFrecciaSinistra").style.right= 0 + "px";
			document.getElementById("boxFrecciaSinistra").style.top= 40 + "px";
			document.getElementById("boxFrecciaSinistra").style.height= myHeight-100 + "px";
		}
	}

