/*
	Object			: Javascript document - 24/32 bit PNG graphics transparency for IE6...
	Developer		: Philippe Marechal
	Date			: 12 july 08
	Notes			: Dependent on "Prototype JavaScript framework (1.6.0)". Works on *img elements* and on *background images of 		
					  elements. PNG's can be used as backgrounds. However, image tiling will not work.
 					  Background PNG's used in :hover's might need another application of the method
	Example Usages	: $('yourPNG').pngHack(); or $$('div#fixMe','img#andMe','img.andUsTo').invoke('pngHack');
*/
if((typeof Prototype=='undefined')||(typeof Element=='undefined')||(typeof Element.Methods=='undefined'))
	throw("pngHack requires the Prototype JS framework >= 1.6.0.3");

// Done by adding the pngHack method to prototype's Element class...
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...  */
var 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];}}
 		}
	}
});

var clickmessage="All graphics Copyright © 2008 ImmoDirectory / www.lions-rentals.com";
function disableclick(e){
if (document.all){if (event.button==2||event.button==3){if (event.srcElement.tagName=="IMG"){alert(clickmessage);return false;}}}
else if (document.layers){if (e.which == 3){alert(clickmessage);return false;}}
else if (document.getElementById)if(e.which==3&&e.target.tagName=="IMG")setTimeout("alert(clickmessage)",0)}
function associateimages(){for(i=0;i<document.images.length;i++)document.images[i].onmousedown=disableclick;}
if (document.all){document.onmousedown=disableclick;
for(var i_tem=0;i_tem<document.images.length;i_tem++)document.images[i_tem].galleryimg='no'
}else if (document.getElementById)document.onmouseup=disableclick;else if(document.layers)associateimages();


