if((typeof Prototype=='undefined')||(typeof Element=='undefined')||(typeof Element.Methods=='undefined'))
	throw("pngHack requires the Prototype JS framework >= 1.6.0.3");
Element.addMethods({
	pngHack:function(el){var el=$(el);
		var ie7plus=(Prototype.Browser.IE&&parseFloat(navigator.appVersion.split(';')[1].strip().split(' ')[1])>=7)?true:false;
    	if(!Prototype.Browser.IE||ie7plus)return el;var gif="images/s.gif";
    	if((el.match('img')) && (el.src.include("png"))){
      		var alphaImgSrc=el.src;var sizingMethod="scale";el.src=gif;
    	}else if(el.getStyle("backgroundImage").include("png")){
      		var bgc=el.getStyle("backgroundColor") || "";
      		var alphaImgSrc=el.getStyle("backgroundImage").gsub(/url\(|\)|'|"/,"");
      		var sizingMethod="crop";
      		el.setStyle({background:[bgc,"url(", gif, ") no-repeat"].join("")});
    	}else{return el;}
    el.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='#{al}',sizingMethod='#{sz}')".interpolate({al: alphaImgSrc,sz:sizingMethod});return el;
  }
});
/*Image Preloader class*/
imagePreloader=Class.create({
	initialize:function(){
		if(document.images){
    		if(!document.imageArray)document.imageArray=new Array();
    		var i,j=document.imageArray.length;
    		for(i=0;i<arguments.length;i++){
      			if (arguments[i].indexOf("#")!=0){
        			document.imageArray[j]=new Image;
        			document.imageArray[j++].src=arguments[i];
      			}
   		 	}
 		}
	}
});