
function increaseRating(el, sModule, iId, iRank){

	//if($(el).hasClass('on')) {
		
		rating = $(el).attr('rel');
		$('span.stars a').each( function(key, value){
			$(this).removeClass('on');
			return(key != rating-1);
		});
	//}
	//else {
		
		rating = $(el).attr('rel');
		$('span.stars a').each( function(key, value){
			$(this).addClass('on');
			return(key != rating-1);
		});
		
	//}
	
	rank_it( sModule, iId, iRank );
};

function showCommentsForm(el){
	
	idValue = $(el).attr('id');
	$(el).parent().parent().children('.commentsForm.hidden').slideToggle();
	$(el).parent().parent().children('.commentsForm.hidden').children('.idParentUser').val(idValue);
	
}

function showVideo(el,play){
	
	var rel = $(el).attr('rel'); 
	var title = $(el).children().attr('title');
	var desc = $(el).children().attr('alt');
	var link = $(el).children().attr('longdesc');
	
	if(  typeof play != 'undefined' ){
		play = 0;
	}
	else{
		play = 1;
	}
	
	newObj = $('.ad-gallery .hiddenEmbed').children('embed').clone();
	newObjSrc = newObj.attr('src').replace('<codeVideo>',rel).replace('<videoAutoplay>', play);
	
	newObj = newObj.attr({src: newObjSrc});
	
	$('.ad-image-wrapper.videoEm').html(newObj);
	
	if( typeof link != 'undefined'){
		text = "<p class='ad-image-description'><strong class='ad-description-title'><a href='" + link + "'>" + title + "</a></strong><span>" + desc + "</span></p>";
	}
	else {
		text = "<p class='ad-image-description'><strong class='ad-description-title'>" + title + "</strong><span>" + desc + "</span></p>";
	}
	$('.ad-image-wrapper.videoEm').append(text);
	
}
