	$(document).ready(function(){
		//$("div#bannerImages div").hide();
		var startobj= $("#feature-1");
		overLi("#576B8A", startobj);
		$("li.hoverli").hover(function(){
			//pass current element
			overLi("#576B8A", this);
		}, function(){
			//offLi("#AEBFD7", this);
		});
		
		//size of the feature box is 310x223px...
		//$("#bannerImages img").load(function(){featureImageAdjust(this,310,223);});
		//imgLoad($("#bannerImages img")[0],function(){featureImageAdjust(this,310,223);});
	});
	$(window).load(function(){
		//size of the feature box is 310x223px...
		//$("#bannerImages img").load(function(){featureImageAdjust(this,310,223);});
		for(var i= 0;i<$("#bannerImages img").length;i++){
			featureImageAdjust($("#bannerImages img")[i],310,223);
		}
		//imgLoad($("#bannerImages img")[0],function(){featureImageAdjust(this,310,223);});
	})
	function imgLoad(img, completeCallback, errorCallback){
		if(img!=null && completeCallback!=null){
			var loadWatch = setInterval(watch, 100);
			function watch(){
				if(img.complete){
					clearInterval(loadWatch);
					completeCallback(img);
				}
			}
		}else{
			if(typeof errorCallback=="function") errorCallback();
		}
	}
	function featureImageAdjust(image,box_w,box_h){		
		//alert("hello IE?");
		if(!box_w || !box_h) var box_h = 0;
		var div= 0;
		if(image.width > 50){
			var orig_w= image.width;
			var orig_h= image.height;
			if(box_h == 0){
				image.width = "100%";
			}else{
				div= (orig_w > orig_h)? orig_h / box_h : orig_w / box_w;
				var new_w= Math.ceil(orig_w / div);
				var new_h= Math.ceil(orig_h / div);
				$(image).css({"width" : new_w+"px","height" : new_h+"px"});
				//image.width= new_w;
				//image.height= new_h;
				var h_marg= Math.ceil((box_w - new_w) / 2);
				var v_marg= Math.ceil((box_h - new_h) / 2);
				if(h_marg != 1) $(image).css("margin-left",h_marg+"px");
				if(v_marg != 1) $(image).css("margin-top",v_marg+"px");
			}
			//alert(orig_w+","+orig_h+" -> "+new_w+","+new_h+" div= "+div);
		}
	}