// add a semitransparent, offset closebutton
hs.graphicsDir = '/js/hs/graphics/';
hs.addEventListener(window, 'load', function() {
	hs.createElement('div', {
		id: 'closebutton',
		className: 'highslide-overlay closebutton',
		title: hs.lang.closeTitle || 'Close (esc)',
		onclick: function() {
			return hs.close(this);
		}
	}, null, hs.container)
});
hs.align = 'center';
hs.cacheAjax = false;
hs.registerOverlay({
	overlayId: 'closebutton',

	fade: 2 // fading the semi-transparent overlay looks bad in IE
});

	hs.dimmingOpacity = 0.50;
	hs.wrapperClassName = 'borderless';
   	hs.onDimmerClick = function() {
    return false;
   };
function init()
{
		$("#login").validate({
			submitHandler: function(form) {
				jQuery(form).ajaxSubmit({
					target: "#result",
				  success: function(t) {
					init();					
				  }
					
				});
			}
		});
}
hs.Expander.prototype.onAfterClose  = function (sender) 
{
	id   = $("#id_player_" + sender["maincontentId"]).val();
	
	$("#"+ id).html("");
	$("#player").empty();
	$("#player").remove();
	
}

hs.Expander.prototype.onAfterExpand = function (sender) {
if($("#flow").val()==1)
{
	
	width  = $("#width_movie_"+ sender["maincontentId"]).val()*0.95;
	height = $("#height_movie_"+ sender["maincontentId"]).val()*0.85;
	file   = $("#file_movie_" +  sender["maincontentId"]).val();

	id   = $("#id_player_" + sender["maincontentId"]).val();
	flowplayer(id, {src:"/flash/flowplayer.swf", width:width, height:height},{ 
		clip:{ 
			url: '/images/pics/'+ file, 
	
			// these two configuration variables does the trick 
			autoPlay: true,  
			autoBuffering: true  
		 },
		plugins: {
			
		   controls: {
			  sliderColor: '#FF0099',
			  progressColor: '#FF0099',
			  backgroundColor: '#000000'
		   }
		}
	});
}

}

