$(document).ready(function() {    
    initBackgroundImage();
    //initGallery();
    initAdditionalContentInbox();
    initAdditionalContentOutbox();
    $('a.fb-photo').unbind().fancybox({
        'speedIn': 600, 
        'speedOut':	200,
        'overlayColor': '#fff',
        'overlayOpacity': .5,
        'overlayShow': true
    });
    try {
        initFSGal();
        $('#photos li a').click(function() {
            $('#wrapper').css({ width: '100%', height: '100%', overflow: 'hidden' });
            $('#new-gallery').show();
            initFSGal();
        });
        $('#gal-close').click(function() {
            $('#wrapper').css({ width: 'auto', height: 'auto', overflow: 'visible' });
            $('#new-gallery').hide();
        });
    } catch(err) {};
});

function initBackgroundImage() {
    var source = ($('img.bg').attr('rel')) ? $('img.bg').attr('rel') : $('img.bg').attr('src');
    if (!$('img.bg').hasClass('exception')) {
        $('img.bg').hide();
        $('#wrapper').css({
            'backgroundImage': 'url(' + source +')',
            'backgroundRepeat': 'no-repeat',
            'backgroundPosition': 'center center'
        });
    } else {
        $('img.bg').attr('src', source);
    }
}

function initGallery() {
    Gallery.init();
    $('#photos li a').click(function() {
        Gallery.show(olmeca['olmeca-1'], $(this).attr('rel'));
        return false;
    });
}

function initAdditionalContentInbox() {
    $('#content a').filter('.a-add').filter('.inbox').each(function() {
        $(this).click(function() {
            if (!$(this).hasClass('a-cur')) {
                $('#content a').filter('.a-add').not(this).each(function() {
                    $('#' + $(this).attr('rel')).hide();
                    $(this).removeClass('a-cur');
                });
                $('#' + $(this).attr('rel')).show();
                $(this).addClass('a-cur');
            } else {
                $('#' + $(this).attr('rel')).hide();
                $(this).removeClass('a-cur');
            }
            return false;
        });
    });
}

function initAdditionalContentOutbox() {
    $('#content a').filter('.a-add').not('.inbox').not('.fb-photo').each(function() {
        var html = '<div class="f-container"><h1>' + $('#content .section h2').html() + '<br>' + $(this).html() + '</h1>' + $('#' + $(this).attr('rel')).html() + '</div>';
        $(this).fancybox({
            'content': html,
            'speedIn': 600, 
            'speedOut':	200,
            'overlayColor': '#fff',
            'overlayOpacity': .5,
            'overlayShow': true
        });
    })
}

var Gallery = (function() {
    var name = '';
    var fHide = false;
    var defaultLogo = '/i/logo.png';
    var data, gallery, images, header, title, footer, preview, pdf, logo;
    var fAnimation = false;
    function clearGallery() {
        images.add(title).add(preview).add(pdf).html('');
        fHide = false;
        pdf.hide();
    }
    function setLogo() {
        if (data.logo) {
            if (logo.attr('src') != data.logo) logo.attr('src', data.logo);
        } else logo.attr('src', defaultLogo);
    }
    function attachImage(bFirst, img, index) {
        if (bFirst) {
            images.append($('<div class="i' + index + '"><img src="' + data.path + img.i + '" alt="' + img.t + '"></div>').addClass('cur'));
        } else {
            images.append($('<div class="i' + index + '"><img src="' + data.path + img.i + '" alt="' + img.t + '"></div>').hide());
        }
    }
    function attachPreview(bFirst, img, index) {
        if (bFirst) {
            preview.append($('<li class="i' + index + '"><img src="' + data.preview_path + img.i + '" alt="' + img.t + '"></li>').addClass('cur'));
        } else {
            preview.append('<li class="i' + index + '"><img src="' + data.preview_path + img.i + '" alt="' + img.t + '"></li>');
        }
    }
    function loadImages() {
        for (var i = 0; i < data.images.length; i++) {
            attachImage(i == 0, data.images[i], i);
            attachPreview(i == 0, data.images[i], i);
        }
    }
    function loadGallery(photoNumber) {
        setLogo();
        loadImages();
        setTitle();
        setPdf();
        show(photoNumber);
    }
    function setTitle() {
        title.html(images.find('.cur').find('img').attr('alt'));
    }
    function setPdf() {
        if (data.pdf) {
            pdf.show().html('<p><a href="' + data.pdf + '"><i></i>Скачать пресс-релиз</a></p>');    
        }        
    }
    function initClose() {
        header.find('a.close').click(function() {
            close();
        });
    }
    function initHide() {
        header.find('a.hide').click(function() {
            header.animate({ top: '-65px' }, { duration: 'normal', queue: false, complete: function() {
                fHide = true;
            }});
            footer.animate({ bottom: '-95px' }, { queue: false, duration: 'normal'});
        });
        $('#gallery .images').not('.header').not('.footer').click(function() {
            if (header.position().top == 0) {
                header.animate({ top: '-65px' }, { duration: 'normal', queue: false, complete: function() {
                    fHide = true;
                }});
                footer.animate({ bottom: '-95px' }, { queue: false, duration: 'normal'});
            } else {
                header.animate({ top: 0 }, { duration: 'normal', queue: false, complete: function() {
                    fHide = true;
                }});
                footer.animate({ bottom: 0 }, { queue: false, duration: 'normal'});
            }
        });
    }
    function initShowInfo() {
        images.click(function() {
            if (fHide) {
                header.animate({ top: 0 }, { duration: 'normal', complete: function() {
                    fHide = false;
                }});
                footer.animate({ bottom: 0 }, { duration: 'normal'})
            }
        });
    }
    function shiftPreview(dir) {
        if (dir > 0) {
            var left = preview.find('li:first').width() + 10;
            preview.find('li:first').animate({ top: 0 }, { duration: 'normal'});
            preview.find('li:nth(1)').animate({ top: '-9px' }, { duration: 'normal'});
            preview.animate({ left: -left + 'px' }, { duration: 'normal', complete: function() {
                preview.append(preview.find('li:first').removeClass('cur'));
                preview.find('li:first').addClass('cur');
                preview.css('left', 0);
            }});
        } else {
            var left = preview.find('li:last').width() + 10;
            preview.css('left', -left + 'px');
            preview.find('li:first').before(preview.find('li:last'));
            preview.find('li:first').animate({ top: '-9px' }, { duration: 'normal'});
            preview.find('li:nth(1)').animate({ top: 0 }, { duration: 'normal'});
            preview.animate({ left: 0 }, { duration: 'normal', complete: function() {
                preview.find('li:nth(1)').removeClass('cur');
                preview.find('li:first').addClass('cur');
                preview.css('left', 0);
            }});
        }
    }
    function goToNextPhoto() {
        if (!fAnimation) {
            fAnimation = true;
            var cur = images.find('.cur');
            var next = (images.find('.cur').next().size() > 0) ? images.find('.cur').next() : images.find('div:first');
            cur.fadeOut('normal');
            next.fadeIn('normal', function() {
                cur.removeClass('cur');
                next.addClass('cur');
                fAnimation = false;
                setTitle();
            });
            shiftPreview(1);            
        }
    }
    function goToPrevPhoto() {
        if (!fAnimation) {
            fAnimation = true;
            var cur = images.find('.cur');
            var prev = (images.find('.cur').prev().size() > 0) ? images.find('.cur').prev() : images.find('div:last');
            cur.fadeOut('normal');
            prev.fadeIn('normal', function() {
                cur.removeClass('cur');
                prev.addClass('cur');
                fAnimation = false;
                setTitle();
            });
            shiftPreview(-1);             
        }
    }
    function getLeft(index) {
        var left = 0;
        for (var i = 0; i < index; i++) {
            left += preview.find('li:nth(' + i + ')').width() + 10;
        }
        return left;
    }
    function showPicture(id) {
        var cur = images.find('.cur');
        var newCur = images.find('.' + id);
        cur.fadeOut('normal');
        newCur.fadeIn('normal', function() {
            cur.removeClass('cur');
            newCur.addClass('cur');
        });
    }
    function initNav() {
        gallery.find('a.next').click(function() {
            goToNextPhoto();
        });
        gallery.find('a.prev').click(function() {
            goToPrevPhoto();
        });
        preview.delegate('li', 'click', function() {
            if (!fAnimation) {
                fAnimation = true;
                var newCur = $(this);
                var index = preview.find('li').index($(this));
                var left = getLeft(index);
                preview.append(preview.find('li:lt(' + index + ')').clone());
                preview.find('.cur').animate({ top: 0 });
                newCur.animate({ top: '-9px' });
                showPicture($(this).attr('class'));
                preview.animate({ left: -left + 'px' }, { duration: 'normal', complete: function() {
                    preview.css('left', 0);
                    preview.find('li:lt(' + index + ')').remove();
                    preview.find('.cur').removeClass('cur');
                    newCur.addClass('cur');
                    fAnimation = false;
                    setTitle();
                }})
            }
        });
    }
    function show(photoNumber) {
        if (photoNumber) {
            fAnimation = true;
            var liClass = 'i' + (parseInt(photoNumber) - 1);
            var newCur = $('#gallery .footer li.' + liClass);
            var index = preview.find('li').index(newCur);
            var left = getLeft(index);
            preview.append(preview.find('li:lt(' + index + ')').clone());
            preview.find('.cur').animate({ top: 0 });
            newCur.animate({ top: '-9px' });
            showPicture(newCur.attr('class'));
            preview.animate({ left: -left + 'px' }, { duration: 'normal', complete: function() {
                preview.css('left', 0);
                preview.find('li:lt(' + index + ')').remove();
                preview.find('.cur').removeClass('cur');
                newCur.addClass('cur');
                fAnimation = false;
                setTitle();
            }})
        } else {
            gallery.show();   
        }
        $('#wrapper').css('min-height', '400px');
    }
    function close() {
        gallery.hide();
        $('#wrapper').css('min-height', '830px');
    }
return {
    init: function() {
        gallery = $('#gallery');
        images = gallery.find('.images');
        header = gallery.find('div.header');
        title = header.find('p.title');
        footer = gallery.find('div.footer');
        preview = footer.find('ul');
        pdf = gallery.find('div.pdf');
        logo = gallery.find('img.logo');
        initClose();
        initHide();
        initShowInfo();
        initNav();
        $('#gallery .footer li:lt(10)').show();
    },
    show: function(oData, sName, photoNumber) {
        data = oData;
        header.css('top', 0);
        footer.css('bottom', 0);
        show(photoNumber);
        name = sName;        
    }   
}})();

jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	},
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	},
	easeInOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});

$defaultViewMode="normal"; //full, normal, original
//cache vars
$outer_container=$("#outer_container");
$thumbScroller=$("#thumbScroller");
$thumbScroller_container=$("#thumbScroller .container");
$thumbScroller_content=$("#thumbScroller .content");
$thumbScroller_thumb=$("#thumbScroller .thumb");
$preloader=$("#preloader");
$toolbar=$("#toolbar");
$toolbar_a=$("#toolbar a");
$bgimg=$("#bgimg");

function initFSGal() {
    $toolbar.data("imageViewMode",$defaultViewMode); //default view mode
	if($defaultViewMode=="full"){
		$toolbar_a.html("<img src='/i/toolbar_n_icon.png' width='50' height='50'  />").attr("onClick", "ImageViewMode('normal');return false").attr("title", "Restore");
	} else {
		$toolbar_a.html("<img src='/i/toolbar_fs_icon.png' width='50' height='50'  />").attr("onClick", "ImageViewMode('full');return false").attr("title", "Maximize");
	}
	//thumbnail scroller
	sliderLeft=$thumbScroller_container.position().left;
	padding=$outer_container.css("paddingRight").replace("px", "");
	sliderWidth=$(window).width()-padding;
	$thumbScroller.css("width",sliderWidth);
	var totalContent=0;
	fadeSpeed=200;
	
	$thumbScroller_content.each(function () {
		var $this=$(this);
		totalContent+=$this.innerWidth();
		$thumbScroller_container.css("width",totalContent);
		$this.children().children().children(".thumb").fadeTo(fadeSpeed, 0.6);
	});

	$thumbScroller.mousemove(function(e){
		if($thumbScroller_container.width()>sliderWidth){
	  		var mouseCoords=(e.pageX - this.offsetLeft);
	  		var mousePercentX=mouseCoords/sliderWidth;
	  		var destX=-(((totalContent-(sliderWidth))-sliderWidth)*(mousePercentX));
	  		var thePosA=mouseCoords-destX;
	  		var thePosB=destX-mouseCoords;
	  		var animSpeed=600; //ease amount
	  		var easeType="easeOutCirc";
	  		if(mouseCoords>destX){
		  		//$thumbScroller_container.css("left",-thePosA); //without easing
		  		$thumbScroller_container.stop().animate({left: -thePosA}, animSpeed,easeType); //with easing
	  		} else if(mouseCoords<destX){
		  		//$thumbScroller_container.css("left",thePosB); //without easing
		  		$thumbScroller_container.stop().animate({left: thePosB}, animSpeed,easeType); //with easing
	  		} else {
				$thumbScroller_container.stop();  
	  		}
		}
	});

	$outer_container.fadeTo(fadeSpeed, 0.8);
	$outer_container.hover(
		function(){ //mouse over
			var $this=$(this);
			$this.stop().fadeTo("slow", 1);
		},
		function(){ //mouse out
			var $this=$(this);
			$this.stop().fadeTo("slow", 0);
		}
	);

	$thumbScroller_thumb.hover(
		function(){ //mouse over
			var $this=$(this);
			$this.stop().fadeTo(fadeSpeed, 1);
		},
		function(){ //mouse out
			var $this=$(this);
			$this.stop().fadeTo(fadeSpeed, 0.6);
		}
	);

	//on window resize scale image and reset thumbnail scroller
	$(window).resize(function() {
		FullScreenBackground("#bgimg",$bgimg.data("newImageW"),$bgimg.data("newImageH"));
		$thumbScroller_container.stop().animate({left: sliderLeft}, 400,"easeOutCirc"); 
		var newWidth=$(window).width()-padding;
		$thumbScroller.css("width",newWidth);
		sliderWidth=newWidth;
	});

	//load 1st image
	var the1stImg = new Image();
	the1stImg.onload = CreateDelegate(the1stImg, theNewImg_onload);
	the1stImg.src = $bgimg.attr("src");    
}


function BackgroundLoad($this,imageWidth,imageHeight){
	$preloader.fadeOut("fast"); //hide preloader
	FullScreenBackground($this,imageWidth,imageHeight); //scale background image
	var imageTitle=$("#img_title").data("imageTitle");
	if(imageTitle){
		$this.attr("alt", imageTitle).attr("title", imageTitle);
		$("#img_title").html(imageTitle);
	} else {
		$("#img_title").html($this.attr("title"));
	}
	$this.fadeIn("slow"); //fadein background image
}

//mouseover toolbar
if($toolbar.css("display")!="none"){
	$toolbar.fadeTo("fast", 0.4);
}
$toolbar.hover(
	function(){ //mouse over
		var $this=$(this);
		$this.stop().fadeTo("fast", 1);
	},
	function(){ //mouse out
		var $this=$(this);
		$this.stop().fadeTo("fast", 0.4);
	}
);

//Clicking on thumbnail changes the background image
$("#outer_container a").click(function(event){
	event.preventDefault();
	$bgimg.css("display","none");
	$preloader.fadeIn("fast"); //show preloader
	var $this=$(this);
	var title_attr=$this.children("img").attr("title"); //get image title attribute
	$("#img_title").data("imageTitle", title_attr); //store image title
	//get new image dimensions
	var theNewImg = new Image();
	theNewImg.onload = CreateDelegate(theNewImg, theNewImg_onload);
	theNewImg.src = this;
	$bgimg.attr("src", "").attr("src", this); //change image source
}); 

//get new image dimensions
function CreateDelegate(contextObject, delegateMethod){
	return function(){
		return delegateMethod.apply(contextObject, arguments);
	}
}

//new image on load
function theNewImg_onload(){
	$bgimg.data("newImageW",this.width).data("newImageH",this.height);
	BackgroundLoad($bgimg,this.width,this.height);
}

//Image scale function
function FullScreenBackground(theItem,imageWidth,imageHeight){
	var winWidth=$(window).width();
	var winHeight=$(window).height();
	if($toolbar.data("imageViewMode")!="original"){ //scale
		var picHeight = imageHeight / imageWidth;
		var picWidth = imageWidth / imageHeight;
		if($toolbar.data("imageViewMode")=="full"){ //fullscreen size image mode
			if ((winHeight / winWidth) < picHeight) {
				$(theItem).attr("width",winWidth);
				$(theItem).attr("height",picHeight*winWidth);
			} else {
				$(theItem).attr("height",winHeight);
				$(theItem).attr("width",picWidth*winHeight);
			};
		} else { //normal size image mode
			if ((winHeight / winWidth) > picHeight) {
				$(theItem).attr("width",winWidth);
				$(theItem).attr("height",picHeight*winWidth);
			} else {
				$(theItem).attr("height",winHeight);
				$(theItem).attr("width",picWidth*winHeight);
			};
		}
		$(theItem).css("margin-left",(winWidth-$(theItem).width())/2);
		$(theItem).css("margin-top",(winHeight-$(theItem).height())/2);
	} else { //no scale
		$(theItem).attr("width",imageWidth);
		$(theItem).attr("height",imageHeight);
		$(theItem).css("margin-left",(winWidth-imageWidth)/2);
		$(theItem).css("margin-top",(winHeight-imageHeight)/2);
	}
}

//Image view mode function - fullscreen or normal size
function ImageViewMode(theMode){
	$toolbar.data("imageViewMode", theMode);
	FullScreenBackground($bgimg,$bgimg.data("newImageW"),$bgimg.data("newImageH"));
	if(theMode=="full"){
		$toolbar_a.html("<img src='/i/toolbar_n_icon.png' width='50' height='50'  />").attr("onClick", "ImageViewMode('normal');return false").attr("title", "Restore");
	} else {
		$toolbar_a.html("<img src='/i/toolbar_fs_icon.png' width='50' height='50'  />").attr("onClick", "ImageViewMode('full');return false").attr("title", "Maximize");
	}
}
