function bookmarkMe(url, title){
	if (window.sidebar) window.sidebar.addPanel(title, url, "");
	else if(window.opera && window.print) {
		var elem = document.createElement('a');
		elem.setAttribute('href',url);
		elem.setAttribute('title',title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	}
	else if(document.all) window.external.AddFavorite(url, title);
}


function openForm(id) {
	$('#' + id).toggle();
}

function confirmAction(message) {
	confirmation = window.confirm(message);
	if (confirmation) {
		return true;
	}
	else {
		return false;
	}
}

function closeHero() {
	$('#hero').fadeOut(500);
	var x = $.cookie('heroCounter');
	x = 10;
	$.cookie('heroCounter', x);
}


function loadDiggWithDelay() {
	
}

function hideErrors() {
	$('#popupErrors .errors').fadeOut(200, function() {
		$('#popupErrors .shadow').fadeOut(300, function() {
			$('#popupErrors').hide();
		});
	});
}

$(document).ready(function() {
	var x = $.cookie('heroCounter');
	if (x > 0) {
		x--;
	}
	else x = 0;
	$.cookie('heroCounter', x);
	
	$.smoothAnchors("normal", "swing", false);
	hideErrors();

	$("#pass").jpassword({flat: true, length: 6});
	
	wgTables.setAllOddEven();
	wgTables.setAllRollOver();
	
	jQuery.each($('#page img'), function() {
		var newImg = new Image();
		newImg.src = $(this).attr('src');
		var width = newImg.width;
		if (width > 733) $(this).css({'width': '733px'});
	});
	
	$.initPlaceholders();

});
