window.addEvent('domready', function(){
	var tpshowmsg 		= document.getElementById('tpshowcase_warning');
	var cdetail			= document.getElementById('tpshowcase_thumbdetail');
	if(tpshowmsg){
		var size	= $('tpshowcase_warning').getSize();
		var sizex	= (screen.width - size['size']['x'])/2;
		var	wint	= ((screen.height - size['size']['y'])/2)-200;
		$('tpshowcase_warning').setStyle("left", (sizex/2) + "px");
		$('tpshowcase_warning').setStyle("top", wint + "px");
		$('tpshowcase_warning').addEvent('click', function(event){
			$('tpshowcase_warning').setHTML('');
			$('tpshowcase_warning').setStyle('display','none');
		});
	}
	
	if(cdetail){
		var a = $('tpshowcase_thumbdetail').getSize();
		if(window.ie){
			$$('#tpshowcase_thumbdetail .thumbinfo').setStyle('width',(a['size']['x']-63)+'px');
			$$('#tpshowcase_thumbdetail .thumbinfo').setStyle('margin-left','1px');
		}else{
			$$('#tpshowcase_thumbdetail .thumbinfo').setStyle('width',(a['size']['x']-42)+'px');
		}
	}
});
function getVotes(){
	$$('.tpshowcasevote_right').addEvent('click', function(event){
		var a	= this.getProperty('id');
		var val	= a.replace('votes-','');
		var url	= 'index.php?option=com_tpshowcase&view=vote&tmpl=component&print=1&id='+val;
		var ajax= new Ajax(url, {method: 'get', update: $('tpshowcasevote_tot'+val), evalScripts: true, onComplete: setStat(val)});
		ajax.request();
	});
}

function getVotesUser(msg){
	$$('.tpshowcasevote_right').addEvent('click', function(event){
		var win		= window.getSize();
		$('tpshowcase_warning').setStyle('display','');
		$('tpshowcase_warning').setStyle('top',(win['scroll']['y']+200)+'px');
		$$('#tpshowcase_warning').setHTML(msg);
	});
}

function setStat(val){
	$('votes-'+val).removeClass('tpshowcasevote_right');
	$('votes-'+val).addClass('tpshowcasevote_rightgrey');
	var win		= window.getSize();
	$('tpshowcase_warning').setStyle('top',(win['scroll']['y']+200)+'px');
}
function setOver(param, num){ $$('.'+param).setStyle('display',''); $$('.infos2'+num).setStyle('display','none'); }
function setOut(param, num){ $$('.'+param).setStyle('display','none'); $$('.infos2'+num).setStyle('display','block'); }