window.MovieDesc = {
	height : null,
	fx : null,
	box : null,
	close_height : 0,
	duration : 200,
	
	toggle : function(button){

		button = $(button);
		var t = this;

		var height = t.box.getStyle('height').toInt();

		if(height != t.close_height) {
			button.removeClass('hide');
			var caption = button.innerHTML;
			button.innerHTML = button.rel;
			button.rel = caption;
			t.fx.stop();
			t.fx.start(height, t.close_height); //margin-top is set to 10px immediately
		}
		else {
			button.addClass('hide');
			var caption = button.innerHTML;
			button.innerHTML = button.rel;
			button.rel = caption;
			t.fx.stop();
			t.fx.start(t.close_height, t.height); //margin-top is set to 10px immediately
		}
		return false;
	},
	init : function() {

		this.box = $('_vdescriptionBox');
		this.height = this.box.getStyle('height').toInt();
		this.box.setStyle('height', this.close_height);
		this.box.setStyle('visibility', 'visible');
		this.fx = new Fx.Style(this.box, 'height', {duration:this.duration});
	}
}

window.PlayerResize = {

	minWidth : 606,
	minHeight : 374,

	maxWidth : 800,
	maxHeight : 482,

	box2MinWidth : null,
	box2MaxWidth : 938,

	duration : 200,

	fx : null,
	fx2 : null,
	fx3 : null,

	box : null,
	box2 : null,

	toggle : function(e){

		var button = $(e);
		var t = this;

		var curWidth = t.box.getStyle('width').toInt();

		if(curWidth == t.minWidth) {

			t.box.addClass('swf_wide');

			t.fx.stop();
			t.fx2.stop();
			t.fx3.stop();
			t.fx.start(curWidth, t.maxWidth); 
			t.fx2.start(t.minHeight, t.maxHeight); 
			t.fx3.start(t.box2MinWidth, t.box2MaxWidth); 

			button.addClass('play_normal');
			button.removeClass('play_wide');

			var title = button.title;
			button.title = button.rel;
			button.rel = title;

			Cookie.set('player_size', 'big', {duration: 30, path: '/'});
		}
		else {
			t.box.removeClass('swf_wide');

			t.fx.stop();
			t.fx2.stop();
			t.fx.start(curWidth, t.minWidth); 
			t.fx2.start(t.maxHeight, t.minHeight); 

			t.fx3.start(t.box2MaxWidth, t.box2MinWidth); 

			button.addClass('play_wide');
			button.removeClass('play_normal');

			var title = button.title;
			button.title = button.rel;
			button.rel = title;

			Cookie.set('player_size', 'small', {duration: 30, path: '/'});
		}
	},

	init : function() {
		
		this.box = $('div_player_swf_box');
		this.box2 = $('div_player_body');
		this.box2MinWidth = this.box2.getStyle('width').toInt();
		//this.box_swf = $('div_player_swf');
		this.fx = new Fx.Style(this.box, 'width', {duration:this.duration});
		this.fx2 = new Fx.Style(this.box, 'height', {duration:this.duration});
		this.fx3 = new Fx.Style(this.box2, 'width', {duration:this.duration});

		if (Cookie.get('player_size') == 'big') {
			window.PlayerResize.toggle('player_resize_button');
		}
		
	}
}
function ButtonsCorrection(obj, action) {
	obj = $(obj);
	lastImage = obj.getParent().getLast().getLast();
	if(lastImage!=null) {
		if(action=="over") {
			lastImage.removeClass("go");
		}
		else if(action=="out") {
			lastImage.addClass("go");
		}
	}
}