$(document).ready(function() {
	$($("img")[0]).one('load', function() {
		$(".expander").center();
		$('.expander').show();
		var w = $(".active").width();
		var h = $(".active").height();
		var mt = 40; //($(".active").height() / 4 - $(".active").height() / 2);
		var ml = (450 - $(".active").width() / 2)
		$(".active").css("top", (mt + 10) + "px");
		$(".active").css("left", (ml + 10) + "px");
		$(".expander").animate({
			width : w,
			height : h,
			marginTop : "40px",
			marginLeft : (450 - $(".active").width() / 2) + "px",
			paddingTop : "10px",
			paddingBottom : "20px",
			paddingLeft : "10px",
			paddingRight : "10px"
		}, 1200, function() {
			$(".active").fadeTo(500, 1);
		});
		$('#modal-me').click(function() {
			$("#dialog-modal").dialog({
				height : 500,
				width : 600,
				modal : true
			});
		});
	}).each(function() {
		if (this.complete)
			$(this).load();
	});
});
$(document).ready(function() {
	$('#jsddm > li').bind('mouseover', jsddm_open);
	$('#jsddm > li').bind('mouseout', jsddm_timer);
	$('.thumbs').hover(function() {
		$(this).animate({
			opacity : .66
		});
	}, function() {
		$(this).animate({
			opacity : 1.0
		});
	});
});

jQuery.fn.acenter = function() {
	this.css("position", "absolute");
	this.css("top", ($(window).height() - this.height()) / 2
			+ $(window).scrollTop() - 300 + "px");
	this.css("left", ($(window).width() - this.width()) / 2
			+ $(window).scrollLeft() + "px");
	return this;
}
jQuery.fn.center = function() {
	this.css("position", "relative");
	this.css("margin-top", "350px");
	this.css("margin-left", "450px");
}
var timeout = 500;
var closetimer = 0;
var ddmenuitem = 0;

function jsddm_open() {
	jsddm_canceltimer();
	jsddm_close();
	ddmenuitem = $(this).find('ul').eq(0).css('visibility', 'visible');
}

function jsddm_close() {
	if (ddmenuitem)
		ddmenuitem.css('visibility', 'hidden');
}

function jsddm_timer() {
	closetimer = window.setTimeout(jsddm_close, timeout);
}

function jsddm_canceltimer() {
	if (closetimer) {
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

