var widget = {
	init: function() {
		this.bind();
	},
	bind: function() {
		$("a#share_button").click(function(){
			$("div#widget_code").show();
			return false;
		});

		$("a#close_popup").click(function(){
			$("div#widget_code").hide();
			return false;
		});

		$("div#widget_code textarea").focus(function() {
			$("div#widget_code textarea").select();
		});
	}
};

var resize = {
	init: function() {
		var height = $(window).height();
		var width = $(window).width();
		
		if(height >= 770 || width >= 1280) {
			$("div#wrapper").css("background","url('/images/body/background_big.jpg') no-repeat center top");
		  $("div#wrapper").height(height + 150);
		}else{
			$("div#wrapper").css("background","url('/images/body/background_big.jpg') no-repeat center top");
			$("div#wrapper").height(900);
		}

		this.bind();
	},
	bind: function() {
		$(window).resize(function() {
			var height = $(window).height();
			var width = $(window).width();

			if(height > 770 || width > 1280) {
				$("div#wrapper").css("background","url('/images/body/background_big.jpg') no-repeat center top")
				$("body").css("background","url('/images/whole/background.jpg') center top;")
				$("div#wrapper").height(height + 150);
			}
			else
				$("div#wrapper").height(900);
		});
	}
}

$(function() {
	widget.init();
	//resize.init();
});

$(document).ready(function() {
    $('.slideshow').cycle({
        fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
        cleartypeNoBg: true
    });
});
