
//common class declaration
function slideshow(instanceName){
	
	this.reset_buttons = function(){
		for(i=1; i<=sw.val_by_name("slideshow"+this.id, "num_of_frames"); i++){
		$("#slideshow"+this.id+" #goto"+i).removeClass("active");
		}
	}
	
	this.onclick = function(frame){
	$("#slideshow"+this.id).cycle((frame-1));
	this.reset_buttons();
	$("#slideshow"+this.id+" #goto"+i+frame).addClass("active");
	}


	this.onBefore = function(curr,next,opts){
	}
	
	
	this.onAfter = function(curr,next,opts){
	//eval("this.id="+instanceName+".id;");
	//eval(instanceName+".reset_buttons();");
	//$('#slideshowTitle').html($(this).find('img').attr('alt'));
	 var title = $(".foreground #t"+(parseInt(opts.currSlide)+1)).html();
	$('#slideshowTitle').html(title);
	
	//
	var marginRight=$(".foreground #x"+(parseInt(opts.currSlide)+1)).val();
	var marginTop=parseInt($(".foreground #y"+(parseInt(opts.currSlide)+1)).val());
	$('#slideshowTitle').css('padding-right', marginRight+"px");
	$('#loc10').css('top', (-1+marginTop)+"px");
	//
	//var wrapH=$('#slideshowTitle').height();
	//var imgH=$('#slideshowTitle img').height();

	//$('#slideshowTitle img').css('margin-top', parseInt(wrapH-imgH)+"px");
	}

}



$(document).ready(function() {

	$("#loc40 li").mouseover(function() {
	var num= $(this).index();
	var descr = $("#descr"+(num+1)).html();
	$('#ssOverlay .middle').html(descr);
	$("#ssOverlay").removeClass('unv');
	
	var h=parseInt($("#ssOverlay .middle").height());
	var t=123-parseInt(h/2);
	$("#ssOverlay .middle").css('top', t);
	});
	
	$("#loc40 li").mouseout(function() {
	$("#ssOverlay").addClass('unv')
	});

});

