window.size = function(){
	var w = 0;
	var h = 0;
	if(!window.innerWidth){
	   //strict mode
		if(!(document.documentElement.clientWidth == 0)){
			w = document.documentElement.clientWidth;
			h = document.documentElement.clientHeight;
		}
		//quirks mode
		else{
			w = document.body.clientWidth;
			h = document.body.clientHeight;
		}
	}
	else{
	   w = window.innerWidth;
	   h = window.innerHeight;
	}
	return {width:w,height:h};
}
$(document).ready(function(){
	$(".mooShow").mouseover(function(){
		children = $(this).children();
		coords=$(children[0]).position();
		if((coords["left"]+parseInt($(children[1]).css("width"))) > window.size().width){
			coords["left"]=(window.size().width-(parseInt($(children[1]).css("width"))+50))+"px";
		}
		var itop=coords["top"]+10;
		$(children[1]).attr("style","left:"+coords["left"]+";top:"+itop+"px;display:block;");
	});
	$(".mooShow").mouseleave(function(){
		children = $(this).children();
		$(children[1]).css("display","none");
	});
	
});
