//Modified controls.js to make the main navigation respond to clicks and still be able to drop d

$(document).ready(function(){

//########################################################################################################
//close button

$("#close a").click(function(){

	$("#newmenu a").css('color', 'white');
	$("#newmenu a.currentsaved").removeClass('currentsaved').addClass('current');
	$("#subcontainer").animate({height: '0px'}, 500, function() {// Animation complete.
	});
		return false;
});

//########################################################################################################

//about main navi mouseover

$("#a-about").mouseenter(function(){

	$("#newmenu a").css('color', 'white');
	$(this).css('color', '#1ab6e7');
	$("#subcontainer").animate({height: '150px'}, 500, function() 
	{// Animation complete.
		$("#newsubmenu").animate(
			{
				left: '0px'
			
			}, 500, function() {// Animation complete.

  });

return false;
  });

  return false;

});




//########################################################################################################
//spinal care main navi mouseover

$("#a-spinalcare").mouseenter(function(){

	$("#newmenu a").css('color', 'white');

	$(this).css('color', '#1ab6e7');

	$("#subcontainer").animate({height: '150px'}, 500, function() {// Animation complete.
$("#newsubmenu").animate({

	left: '-940px',
	

	}, 500, function() {// Animation complete.

  });

return false;
  });

  return false;

});




//########################################################################################################
//orthopedic main navi mouseover

$("#a-orthopedics").mouseenter(function(){

	$("#newmenu a").css('color', 'white');

	$(this).css('color', '#1ab6e7');

	$("#subcontainer").animate({height: '150px'}, 500, function() {// Animation complete.
$("#newsubmenu").animate({

	left: '-1880px',

	}, 500, function() {// Animation complete.

  });

return false;
  });

  return false;

});






//########################################################################################################
//pain management main navi mouseover

$("#a-painmanagement").mouseenter(function(){

	$("#newmenu a").css('color', 'white');

	$(this).css('color', '#1ab6e7');

	$("#subcontainer").animate({height: '150px'}, 500, function() {// Animation complete.
$("#newsubmenu").animate({

	left: '-2820px',

	}, 500, function() {// Animation complete.

  });

return false;
  });

  return false;

});


//########################################################################################################
//Performance Center main navi mouseover

$("#a-performancecenter").mouseenter(function(){

	$("#newmenu a").css('color', 'white');

	$(this).css('color', '#1ab6e7');

	$("#subcontainer").animate({height: '150px'}, 500, function() {// Animation complete.
$("#newsubmenu").animate({

	left: '-3760px',
	

	}, 500, function() {// Animation complete.

  });

return false;
  });

  return false;

});




//########################################################################################################
//Surgical Center main navi mouseover

$("#a-surgicalcenter").mouseenter(function(){

	$("#newmenu a").css('color', 'white');

	$(this).css('color', '#1ab6e7');

	$("#subcontainer").animate({height: '150px'}, 500, function() {// Animation complete.
$("#newsubmenu").animate({

	left: '-4700px',
	

	}, 500, function() {// Animation complete.

  });

return false;
  });

  return false;

});


//########################################################################################################
//Patient Information main navi mouseover

$("#a-patientinformation").mouseenter(function(){

	$("#newmenu a").css('color', 'white');

	$(this).css('color', '#1ab6e7');

	$("#subcontainer").animate({height: '150px'}, 500, function() {// Animation complete.
$("#newsubmenu").animate({

	left: '-5640px',
	

	}, 500, function() {// Animation complete.

  });

return false;
  });

  return false;

});



var int = 0;



	/*$(".submenu").each(function(index){

	

	

	var pat= $(".submenu:eq("+int+") > li").size(); 

	//alert(this.id + "has" + pat + "items. and " + subs + "subs..."+int);

	

	if (pat > 3  ){

	

	$(this).makeacolumnlists({cols:3,colWidth:0,equalHeight:false,startN:1});

 		

	int++;

	}

	else{

	int++;	

	}

	

	

	});

*/



	if($.browser.msie && $.browser.version=="6.0") {

	$("#subcontainer").hide();

	}

   		

 			$(".submenu").makeacolumnlists({cols:3,colWidth:0,equalHeight:false,startN:1});



 		

 		

 		$("#u-about li a:first").append(" Overview");

 		$("#u-spinalcare li a:first").append(" Overview");

 		$("#u-orthopedics li a:first").append(" Overview");

 		$("#u-painmanagement li a:first").append(" Overview");

 		$("#u-performancecenter li a:first").append(" Overview");

 		$("#u-surgicalcenter li a:first").append(" Overview");

 		$("#u-patientinformation li a:first").append(" Overview");

 		

 		$('.submenu li a').prepend('|  ');

 		$('.third li a').prepend('-  ');

	});






