simple jquery navigation

simple jquery navigation

I'm trying to create, which is probably very simple jquery (but I'm new at this), a nav system for my website, and I can't seem to get it to work.

I have a set of 3 links, which control 3 divs. When you click a link, I want it to check if that div is already open. If not, fadeTo the currently opened div, and then slide open, or animate open that div controled in the link. I was trying something like this. It worked initially, but once I tried to make it more complicated it stopped functioning... what can I do to fix it? I'm sure its very simple...

$("#print").width("100%"); // the default open div

               
$("#printopen").click(function(){ // link that opens #print Div
if($('#print').css("width") == "0px"){  { // prevents function if div is already open
$("#web, #contact").fadeTo("fast", 0.0).css("width") == "0px"; // close currently opened div (and the other one too, because I have no idea how to make it so it knows the currently open div)
$("#print").animate({width:"100%"},350); // animate open
}
});


I have the same $("#printopen") function repeated for the other 2 divs...

is there any way to simplify this function and make it work?