$(document).ready(function() {

 $('#nav li').hover(function(){
 var currentId = $(this).attr('id');
 //alert('#nav ' + currentId + ' div');
  $('#nav #' + currentId + ' div').addClass("rightcurve");
  }, function() {
  var currentId = $(this).attr('id');
  $('#nav #' + currentId + ' div').removeClass("rightcurve");
  });
 prepareImageSwap(document.body);

 var findIt = $('body').find('homemiddlepanel');
 if($('#homemiddlepanel').length > 0){
  var innerShell = $('#homemiddlepanel').height();
 } else {
  var innerShell = $('#middlepanel').height();
 }

 var leftpanel = $('#leftpanel').height();
 
 var bver = $.browser.version;
 var bname = $.browser.msie;
 if(bver <= 6.0 && bname == true) {
  var resizeShell = leftpanel + 150;
  var resizeMiddle = leftpanel + 59;
 } else {
  var resizeShell = leftpanel + 134;
  //var resizeShell = leftpanel + 226;
  var resizeMiddle = leftpanel + 54;
 }

 if(leftpanel > innerShell){
  $('#innershell').css('height', resizeShell+'px');
}

if($('#insidecontent').height() > 530) {
 $('#insidecontent').css('padding','0 0 50px 0');
} else if ($('#middlepanel').height() > 820) {
 $('#insidecontent').css('padding','0px');
} else if ($('#insidecontent').height() < leftpanel) {
   $('#featureproduct').css({'position':'absolute','bottom':'0px'});
   $('#healthcheck').css({'position':'absolute','bottom':'0px','right':'0px'});
}

 /*
 if($('#middlepanel').height() > 540) {
  if(bver <= 6.0 && bname == true) {
   $('#featureproduct').css({'position':'absolute','bottom':'91px'});
   $('#healthcheck').css({'position':'absolute','bottom':'91px','right':'0px'});
  }
 } else {
  if(bver <= 6.0 && bname == true) {
   $('#middlepanel').css('height', resizeShell+'px');
   $('#featureproduct').css({'position':'absolute','bottom':'91px'});
   $('#healthcheck').css({'position':'absolute','bottom':'91px','right':'0px'});
  }
 }*/



// Set Background of First Sliding Box
   $('.slidecontent:first').css('display','none');
//  $('div em:first').css('visibility','hidden');

// Sliding
  $('#insidecontent:eq(0)> div.slidecontent:gt(0)').hide();
  $('#insidecontent:eq(0)> a.expandcontent').click(function() {
  var currentId = $(this).attr('id');
  $('.clickbox').css('visibility','visible');
  $('#click'+currentId).css('visibility','hidden');
  $(this).next('div:hidden').slideDown('fast').siblings('div:visible').slideUp('fast');
 });

});
