$('close1').onclick = function() {
	Effect.Fade('window1');
	$('darkback').style.display='none';
	Element.setOpacity('darkback','0');
}

function XHR(defaulturl) {
	this.type='GET';
	this.url=defaulturl;
	this.async=true;
	try { this.requete = new ActiveXObject("Microsoft.XMLHTTP"); }
	catch(e) { this.requete = new XMLHttpRequest(); }

	this.make = function(myasync) {
		this.requete.open(this.type,this.url,myasync);
		this.requete.send(null);
		return this.requete;
		
	}
	
	this.setType = function(ntype) { this.type=type; }
	this.setUrl = function(nurl) { this.url=nurl; }
	this.setAsync = function(nasync) { this.async = nasync; }
	this.getRequest = function() { return this.requete; }
	this.getType = function() { return this.type; }
	this.getUrl = function() { return this.url; }
	this.getAsync = function() { return this.async; }
}

function Navig() {}
Navig.cat = function(v) {
	$('darkback').style.height=document.documentElement.scrollHeight+'px';
	$('darkback').style.left='0px';
	$('darkback').style.width=document.documentElement.scrollWidth+'px';
	Element.setOpacity('darkback','0.8');
	$('darkback').style.display='block';
	Effect.Appear('window1');
	xhr = new XHR('photo.php');
	$('view1').innerHTML = xhr.make(false).responseText;
}

Navig.subcat = function(v) {
	xhr = new XHR(v+'.php');
	$('view1').innerHTML = xhr.make(false).responseText;
}
Navig.subsubcat = function(v) {
	xhr = new XHR(v);
	$('view1').innerHTML = xhr.make(false).responseText;
}

Navig.viewphoto = function(v,v2) {
	$('view1').innerHTML='<img src="'+v+'" alt="" style="" id="myphoto" />';
	$('view1').innerHTML+='<br /><a class="photo" href="#" onclick="Navig.subcat(\''+v2+'\');">Précédent</a>';
	if (navigator.appName=='Microsoft Internet Explorer') {
		if ($('myphoto').scrollWidth>540) {
			$('myphoto').style.width=540;
		}
	}
}
