function newsletter_unsubscribe() {
	document.getElementById('zemUnSubscribe').checked = true;
	document.getElementsByName('zem_contact_submit')[0].click();
}

$(function() {
	bind_handler_to_newsletter_inputbox();
	add_loginbutton_animation();
	make_corners_rounded();
	$(window).load(function(){
		if($.browser.msie)
			adjust_layout_ie();
		else
			adjust_layout();
	});
});

function adjust_layout() {
	var content_area_height = $('div#content').height() + 5;
	// First column
	var whosonline_must_height = content_area_height - $('div#bestphoto').outerHeight() - $('div#poll').outerHeight() - $('div#friends_partners').outerHeight() - 25;
	$('div#whosonline').height(whosonline_must_height);
	// Second column
	var bill_must_height = content_area_height - $('div#latest_news').height() - 34;
	$('div#billboard').height(bill_must_height);
	// Third column
	var shopnews_must_height = content_area_height - $('div#feature_news').height() - $('div#short_news').height() - 44;
	$('div#shop_news').height(shopnews_must_height);
	// Fourth column
	$('div#side_banners').height(content_area_height - 5);
	show_bestphoto();
}

function adjust_layout_ie() {
	var content_area_height = $('div#content').height() - 90;
	// First column
	var whosonline_must_height = content_area_height - $('div#bestphoto').height() - $('div#poll').height() - $('div#friends_partners').height() - 40;
	$('div#whosonline').height(whosonline_must_height);
	// Second column
	var bill_must_height = content_area_height - $('div#latest_news').height() - 20;
	$('div#billboard').height(bill_must_height);
	// Third column
	var shopnews_must_height = content_area_height - $('div#feature_news').height() - $('div#short_news').height() - 30;
	$('div#shop_news').height(shopnews_must_height);
	// Fourth column
	$('div#side_banners').height(content_area_height);
	show_bestphoto();
}

function show_bestphoto() {
	$('#pic_bestphoto').fadeOut(1, function(){ $(this).css("visibility", "visible"); $(this).fadeIn(1500); });
}

function bind_handler_to_newsletter_inputbox() {
	$("input#zemSubscriberEmail").focus(function(){
		if(this.value == 'e-mail')
			this.value = '';
	});
	$("input#zemSubscriberEmail").blur(function(){
		if(this.value == 'e-mail' || this.value == '')
			this.value = 'e-mail';
	});
}

function add_loginbutton_animation() {
	$("img#login_button").mouseover(function(){
		$(this).fadeTo(300, 0.65, function(){ $(this).fadeTo(300, 1); });
	});
}