getXHR: function(){
    return (window.ActiveXObject) ? new ActiveXObject('Microsoft.XMLHTTP') : (
        (window.XMLHttpRequest) ? new XMLHttpRequest() : false
    );
}

//Ajax.implement({
//    isSuccess: function(){
//        return (!this.status && location.protocol == "file:" || 
//                (this.status >= 200) && (this.status < 300));
//    }
//});


function ImagePreload() {
	if (typeof(arguments) != 'undefined') {
		for (i=0; i<arguments.length; i++ ) {
			if (typeof(arguments[i]) == "object") {
				for (k=0; k<arguments[i].length; k++) {
					var oImage = new Image;
					oImage.src = arguments[i][k];
				}
			}
 
			if (typeof(arguments[i]) == "string") {
				var oImage = new Image;
				oImage.src = arguments[i];
			}
		}
	}
}
var preloaded=['images/Art/1-t.jpg','images/Civilization/1-t.jpg','images/Deep/1-t.jpg','images/Earth/1-t.jpg','images/Futurism/1-t.jpg','images/People/1-t.jpg'];

//===============
window.addEvent('domready', function(){
$ES('.cap').setStyle('opacity','0');									
ImagePreload(preloaded);

var intro=new Fx.Styles('wrapper',{duration:2000, tansition: Fx.Transitions.backIn});
$('wrapper').setStyle('opacity',0);
intro.start({
		'opacity':['0','1']
		});	
	
	
$E('.btn1').addEvent('click', function(e) {
	e = new Event(e).stop();
	new Ajax('gr1_ajax.php', {
			 update: $E('.galleryAjax')
	}).request();
});
$E('.btn2').addEvent('click', function(e) {
	e = new Event(e).stop();
	new Ajax('gr2_ajax.php', {
			 update: $E('.galleryAjax')
	}).request();
});
$E('.btn3').addEvent('click', function(e) {
	e = new Event(e).stop();
	new Ajax('gr3_ajax.php', {
			 update: $E('.galleryAjax')
	}).request();
});
$E('.btn4').addEvent('click', function(e) {
	e = new Event(e).stop();
	new Ajax('gr4_ajax.php', {
			 update: $E('.galleryAjax')
	}).request();
});
$E('.btn5').addEvent('click', function(e) {
	e = new Event(e).stop();
	new Ajax('gr5_ajax.php', {
			 update: $E('.galleryAjax')
	}).request();
});
$E('.btn6').addEvent('click', function(e) {
	e = new Event(e).stop();
	new Ajax('gr6_ajax.php', {
			 update: $E('.galleryAjax')
	}).request();
});
//==========================


$$('.btn').each(function(item){
	
	item.addEvent('mouseenter', function(e){
								e=new Event(e).stop();
								
								var cap=this.parentNode.childNodes[0];
								cap.effect('opacity', {duration: 200, transition: Fx.Transitions.Sine.easeOut}).start('0','1');
				});
	item.addEvent('mouseleave', function(e){
								e=new Event(e).stop();
								var cap=this.parentNode.childNodes[0];
								cap.effect('opacity', {duration: 200, transition: Fx.Transitions.Sine.easeOut}).start('1','0');
				});
});
//==========================
});
