
//make uniqID
var vuid=0;
var uid = function(){
	return vuid++ ;
}

//dummy
var popInfo = function(){}

//emulate popup function...
var popWindow = function(u,w,h,popEl){
	e = u.substring(u.lastIndexOf('.')+1).toLowerCase();
	if(!popEl){
		if(e == 'png' || e == 'gif' || e == 'jpg')
			popEl = $("<div class=\"popWindowDiv clear\" style=\"display:block;\"><img src=\""+ u +"\" width=\"" + w + "\" height=\"" + h + "\" border=\"0\" /></div>",{overlay:20});
		else
			popEl = $("<div class=\"popWindowDiv clear\" style=\"display:block;\"><iframe src=\""+ u +"\"  width=\"" + w + "\" height=\"" + h + "\" border=\"0\" frameborder=\"0\"></iframe></div>",{overlay:20});
	}
	popEl.modal({
		onOpen: function (dialog) {
					dialog.overlay.fadeIn('slow', function () {
						dialog.container.slideDown('slow', function () {
							dialog.data.fadeIn('slow'); // See Other Notes below regarding
													   // data display property and
													   // iframe details
						});
					});
				},
		onClose: function (dialog) {
					dialog.data.fadeOut('slow', function () {
					  dialog.container.slideUp('slow', function () {
						dialog.overlay.fadeOut('slow', function () {
						  $.modal.close(); // must call this to have SimpleModal
										   // re-insert the data correctly and
										   // clean up the dialog elements
						});
					  });
					});
				}
	});
	$("#modalContainer").css('height',h).css('width',w).css('margin-left',(w / 2) * -1); 
}



$(document).ready(function(){

	$("#menu ul li").hover(
		 function(){
			 if($(this).children('ul:eq(0)').is(':hidden'))
				 $(this).children('ul:eq(0)').fadeIn('normal');
		 },
		 function(){
			 if($(this).children('ul:eq(0)').is(':visible'))
				 $(this).children('ul:eq(0)').fadeOut('normal');
		 }
	);
	
	$("#menu ul ul").wrapInner('<span class="bottom"></span>');
});
