// this function repositions a menu to the speicified offset from center
function repositionMenu(menu, offset)
{
	// the new left position should be the center of the window + the offset
	var newLeft = getWindowWidth() / 2 + offset;

	// setting the left position in netscape is a little different than IE
	menu.container.style ? menu.container.style.left = newLeft + "px" : menu.container.left = newLeft;
}
 
// this function calculates the window's width - different for IE and netscape
function getWindowWidth()
{
	return window.innerWidth ? window.innerWidth : document.body.offsetWidth;
}
		
//ypSlideOutMenu.writeCSS();

jQuery(document).ready(function(){

	/* Slide-out menu control */
	jQuery("a[@rel].slideoutMenuLink").mouseover(
		function()
		{
			if( jQuery("#"+this.rel+"Container").html() != null )
			{
				ypSlideOutMenu.showMenu(this.rel);
			}
		}
	);
	
	jQuery("a[@rel].slideoutMenuLink").mouseout(
		function()
		{
			if( jQuery("#"+this.rel+"Container").html() != null )
			{
				ypSlideOutMenu.hideMenu(this.rel);
			}
		}
	);
	
	/*
	$.ajax({
		url:'index_blog_preview.inc.php?b='+this.rel,
		type:'GET',
		dataType:'html',
		timeout:10000,
		error: function(){
			jQuery('#X3BlogsContent').html('I couldn\'nt get that blog. Try again later.');
			jQuery(".blogMenu").removeClass('loadingBlog');
		},
		success: function(blog){
			jQuery('#X3BlogsContent').html(blog);
			jQuery(".blogMenu").removeClass('loadingBlog');
		}
	});
	*/
	
});