
/*(function($) {
  $.extend({

    
  })
})(jQuery);

*/

jQuery.fn.addCorners = function(type){
    $(this).append('<div class="'+type+' topleft"></div><div class="'+type+' toprigth"></div><div class="'+type+' bottomrigth"></div><div class="'+type+' bottomleft"></div>');
    return $(this);
}

$(document).ready(function(){
  if (!css3browser()){
    if ($('#blue-panel').length)
      $('#blue-panel').addCorners('bluecorner');
    if ($('#blue-panel ul').length){
     $('#blue-panel ul').addCorners('blue-white');
    }
    if ($('#head ul.top-menu').length)
      $('#head ul.top-menu').addCorners('top-menucorner');
    if ($('#footer').length)      
      $('#footer').addCorners('bluecorner');

    if ($('.left-menu-wrapper').length)      
       $('.left-menu-wrapper').addCorners('grey-corner-border');
  }
  
  $('h1').dblclick(function(){
    $('body *').css('unicode-bidi','bidi-override')
    if ($('#all').css('direction')=='rtl'){
      $('body *').css('direction','ltr');      
    } else {
      $('body *').css('direction','rtl');      
    }
  });
  
  float_footer();  
  window.onresize = function(){
    float_footer();      
  }
  
  
});
function float_footer(){
  if (!$.browser.msie){
    h = $('body').get(0).clientHeight - $('#head').get(0).clientHeight - $('#footer').get(0).clientHeight;  
    if ( h > $('#middle-wrapper').get(0).clientHeight){
      $('#middle-wrapper').css('height',h-15)
    };  
  } else {
    h = $('body').get(0).clientHeight - $('#head').height() - $('#footer').height();  
    if ( h > $('#middle-wrapper').height()){
      $('#middle-wrapper').css('height',h-15)
    };  
  }
/*  ww = $('#blue-panel ul').width()+30;
  wb = $('#blue-panel').width()+30;
  mar = (parseInt((wb - ww)/2-70));
  $('#blue-panel .logo').css('margin-left', mar);*/

  

}
function css3browser(){
  if ($.browser.mozilla || $.browser.safari || ($.browser.opera && $.browser.version >10.6)|| ($.browser.msie && $.browser.version >8.99)){
    return true;
  }
  return false;  
}
