/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
//divImages = new Array("zindel1","zindel2","zindel3","zindel4");
i=1;
function toogleImage(){
	//alert("-----");
	Effect.toggle('zindel'+i.toString(), 'appear'); //,{delay: 0.5 }
	i=i==6?1:i+1;
	Effect.toggle('zindel'+i.toString(), 'appear'); //,{ duration: 2.0 }
}
function tooglePicture(pictureGroupID){
	//alert(pictureGroupID);
	firstChild=$(pictureGroupID).firstDescendant();
	lastChild=$(pictureGroupID).childElements().last();
	//alert(firstChild + " ---- " + lastChild + "--- " + firstChild.id + " ---- " + lastChild.id);
	$(pictureGroupID).childElements().each(function(picture){
		//alert(picture.style.display + "  ---  " + picture.id);
		if(picture.style.display!="none"){
			Effect.toggle(picture.id, 'appear');
			nextPictureID=picture.id==lastChild.id?firstChild.id:picture.next(0).id;
			//alert(nextPictureID + " - " + picture.id + " - " + lastChild.id + " - " + picture.next(0) + " - " + picture.next(0).id);
			//alert(nextPictureID);
			Effect.toggle(nextPictureID, 'appear');
		}
	});
}
function toogleList(objeto, evento){
	if($(objeto.rel).style.display == "none"){
	        Effect.BlindDown(objeto.rel, { duration: 1.0 });
		if(categoryOnList!="") Effect.BlindUp(categoryOnList, { duration: 1.0 });
		categoryOnList = objeto.rel;
	}else{
		categoryOnList = "";
		Effect.BlindUp(objeto.rel, {duration: 1.0 });
	}
}
document.observe("dom:loaded", function(){
    new Effect.Opacity('zindel1', { from: 0, to: 1 });
    new Effect.Opacity('zindel2', { from: 1, to: 0 });
    new Effect.Opacity('zindel3', { from: 1, to: 0 });
	new Effect.Opacity('zindel4', { from: 1, to: 0 });
	new Effect.Opacity('zindel5', { from: 1, to: 0 });
	new Effect.Opacity('zindel6', { from: 1, to: 0 });
    setInterval("toogleImage()","6000");
});
document.observe("dom:loaded", function(){
    /*new Effect.Opacity('zindel1', { from: 0, to: 1 });
    new Effect.Opacity('zindel2', { from: 1, to: 0 });
    new Effect.Opacity('zindel3', { from: 1, to: 0 });
	new Effect.Opacity('zindel4', { from: 1, to: 0 });
    setInterval("toogleImage()","5000");*/
    $$("div.photoSlide").each(function(div){
        new Effect.Opacity(div.firstDescendant().id, { from: 0, to: 1 })
	setInterval("tooglePicture('"+div.id+"')","4000");
    });
});
/*
		/// Id div .photo-slide
    //<div style="z-index: 9; display: none;" id="zindel2" class="zindel2"><!--<img src="files/image/zindel2.jpg"></img>--></div>
	//Effect.toggle(div.firstDescendant().id, 'appear');
       //setInterval("tooglePhoto('"+id+"')","5000");

	//alert(div.className + " ---- "+ div.id  + "---"  + $(div.id).firstDescendant() + "  ----  " + div.firstDescendant() + " ----- " + div.firstDescendant().id);
	//alert(div.firstDescendant().id);
	
		/*div.childElements().each(function(foto){
		//alert(foto.id);
		if(div.firstDescendant().id==foto.id)	
			new Effect.Opacity(foto.id, { from: 0, to: 1 });
			//alert("-----");
		}else{
			new Effect.Opacity(foto.id, { from: 1, to: 0 });
		}
	});
	//new Effect.Opacity(foto.id, { from: 0, to: 1 });
	//div.firstDescendant().style.display = "block";
*/

