var slideshow = new SlideShow('listOfImages', {slideDuration:2});
var currentlyshowing=0
Event.observe(window, 'load', function() {
        $$('.hovercontainer li .cquote').each(function(s, index) {
			s.setStyle({display: 'none'});
			s.addClassName('cquoteappear');
		});
		 $$('.hovercontainer li .cbody').each(function(s, index) {
			s.setStyle({display: 'none'});
			s.addClassName('cbodyappear');
		});
		 $$('.hovercontainer li .cimage').each(function(s, index) {
			s.setStyle({display: 'none'});
			s.addClassName('cimageappear');
		});
    });

document.observe('click',function(event) {
		var e = event.element();
		var defaultValue = e.value;
		if(e.match('input[class="input"]')) {
			e.clear();
		}

		e.observe('blur', function() {
			if(e.value == '' || e.value == defaultValue) {
				e.value = defaultValue;
			}
		});
});

function showit(cid){
	/*if(console){
		console.log(cid, currentlyshowing);
	}*/
	//console.log(cid, currentlyshowing);
	if (cid!=currentlyshowing || (cid!=currentlyshowing && $('listOfImages'))){
		currentlyshowing=cid;
		$('imagecontainer').setStyle({display: 'none'});
		/*if($('quotecontainer')){
			$('quotecontainer').setStyle({display: 'none'});
		}*/
		if($('bodycontainer')){
			$('bodycontainer').setStyle({display: 'none'});
		}
		if($('urlcontainer')){
			$('urlcontainer').setStyle({display: 'none'});
		}
		$('imagecontainer').update($('cimage_'+cid).innerHTML);
		/*if($('quotecontainer')){
			$('quotecontainer').update($('cquote_'+cid).innerHTML);
		}*/
		if($('bodycontainer')){
			$('bodycontainer').update($('cbody_'+cid).innerHTML);
		}
		if($('urlcontainer')){
			$('urlcontainer').update($('cquote_'+cid).innerHTML);
		}

		//updateDom(cid);
		Effect.Appear('imagecontainer');
		/*if($('quotecontainer')){
			Effect.Appear('quotecontainer');
		}*/
		if($('bodycontainer')){
			Effect.Appear('bodycontainer');
		}
		if($('urlcontainer')){
			Effect.Appear('urlcontainer');
		}
	}
}