$(document).ready(function(){
 
  //  Login field magick:
  $('#username-field').focus(function() {
    if ($('#username-field').attr('value') == 'email')
    {$('#username-field').attr('value','')}
  });
  $('#username-field').blur(function() {
    if ($('#username-field').attr('value') == '')
    {$('#username-field').attr('value','email')}
  });

  // Password field magick:  
  $("<input id='password-dummy' type='text' name='password-dummy' title='Password' value='password' class='login_field' tabindex='1' />").insertAfter("#password-field"); 
  $('#username-field').focus(function() {
    $('#password-dummy').hide(); $('#password-field').show();  
  }); 
  $('#password-dummy').focus(function() {
    $('#password-dummy').hide(); $('#password-field').show();  
  });  

  $('#password-field').blur(function() {
    if ($('#password-field').attr('value') == '') {
      $('#password-dummy').show(); $('#password-field').hide();  
    }
  });
  $('#username-field').blur(function() {
    if ($('#username-field').attr('value') == '') {
      $('#password-dummy').show(); $('#password-field').hide();  
    }
  });

 $('#password-field').hide();
  
  
  // Detect if user is currently logged in to medinsight & update login area accordingly:
  url = "http://www.epocrates.com/medinsight/qr_profile/authenticated"
  $.get(url, function(data){login_area_toggle(data);});

});


// toggle login / navigation
function login_area_toggle(response){
  if (response == 'true') {
    // User is logged in. Hide login & show nav links:
    $('#login_form').remove(); 
    $('#medinsight_nav').show();
  } else {
    // User is not logged in. Show login & hide nav links:
    $('#login_form').show(); 
    $('#medinsight_nav').remove();    
  }
}

//DISJOINTED ROLLOVERS USING BUTTON NAVIGATION AND IMAGES FADING IN AND OUT
$(document).ready(function(){
  //disjointed rollover function starting point
  $("div#salesthumbs div").mouseenter(function(){
     //make a variable and assign the hovered id to it
     var elid = $(this).attr('class');
     //change text class
     $("div#saleslist div#" + elid + "-link").addClass("over");
   });
});

$(document).ready(function(){
  //disjointed rollover function starting point
  $("div#salesthumbs div").mouseleave(function(){
     //make a variable and assign the hovered id to it
     var elid = $(this).attr('class');
     //change text class
     $("div#saleslist div#" + elid + "-link").removeClass("over");
   });
});

//DISJOINTED ROLLOVERS USING BUTTON NAVIGATION AND IMAGES FADING IN AND OUT
$(document).ready(function(){
  //disjointed rollover function starting point
  $("div#saleslist div").mouseenter(function(){
     //make a variable and assign the hovered id to it
     var elid = $(this).attr('class');
     //change text class
     $("div#salesthumbs div a#" + elid).addClass("hovercolor");
   });
});

$(document).ready(function(){
  //disjointed rollover function starting point
  $("div#saleslist div").mouseleave(function(){
     //make a variable and assign the hovered id to it
     var elid = $(this).attr('class');
     //change text class
     $("div#salesthumbs div a#" + elid).removeClass("hovercolor");
   });
});



//DISJOINTED ROLLOVERS USING BUTTON NAVIGATION AND IMAGES FADING IN AND OUT
$(document).ready(function(){
  //disjointed rollover function starting point
  $("div#serv_thumbs div").mouseenter(function(){
     //make a variable and assign the hovered id to it
     var elid = $(this).attr('class');
     //change text class
     $("div#serv_list div#" + elid + "-link").addClass("over");
   });
});

$(document).ready(function(){
  //disjointed rollover function starting point
  $("div#serv_thumbs div").mouseleave(function(){
     //make a variable and assign the hovered id to it
     var elid = $(this).attr('class');
     //change text class
     $("div#serv_list div#" + elid + "-link").removeClass("over");
   });
});

//DISJOINTED ROLLOVERS USING BUTTON NAVIGATION AND IMAGES FADING IN AND OUT
$(document).ready(function(){
  //disjointed rollover function starting point
  $("div#serv_list div").mouseenter(function(){
     //make a variable and assign the hovered id to it
     var elid = $(this).attr('class');
     //change text class
     $("div#serv_thumbs div a#" + elid).addClass("hovercolor");
   });
});

$(document).ready(function(){
  //disjointed rollover function starting point
  $("div#serv_list div").mouseleave(function(){
     //make a variable and assign the hovered id to it
     var elid = $(this).attr('class');
     //change text class
     $("div#serv_thumbs div a#" + elid).removeClass("hovercolor");
   });
});


$(document).ready(function() {
  $('table.stripe>tbody>tr:even').addClass("lite"); 
  $('table.stripe>tbody>tr:odd').addClass("dark"); 
});


// zebra stripe confernece DIVs
window.onload = function(){
  $("div.items:odd").addClass("sched_bg");
};





