(function(){

var special = jQuery.event.special,
uid1 = 'D' + (+new Date()),
uid2 = 'D' + (+new Date() + 1);

special.scrollstart = {
setup: function() {

var timer,
handler =  function(evt) {

var _self = this,
_args = arguments;

if (timer) {
clearTimeout(timer);
} else {
evt.type = 'scrollstart';
jQuery.event.handle.apply(_self, _args);
}

timer = setTimeout( function(){
timer = null;
}, special.scrollstop.latency);

};

jQuery(this).bind('scroll', handler).data(uid1, handler);

},
teardown: function(){
jQuery(this).unbind( 'scroll', jQuery(this).data(uid1) );
}
};

special.scrollstop = {
latency: 300,
setup: function() {

var timer,
handler = function(evt) {

var _self = this,
_args = arguments;

if (timer) {
clearTimeout(timer);
}

timer = setTimeout( function(){

timer = null;
evt.type = 'scrollstop';
jQuery.event.handle.apply(_self, _args);

}, special.scrollstop.latency);

};

jQuery(this).bind('scroll', handler).data(uid2, handler);

},
teardown: function() {
jQuery(this).unbind( 'scroll', jQuery(this).data(uid2) );
}
};

})();



(function(){
jQuery(window).bind('scrollstop', function(e){


var pageheight = $(".page_body").height();
var screenHeight = document.documentElement.clientHeight; 

if( self.pageYoffset ) { scrolledY = self.pageYoffset; } 
else if( document.documentElement && document.documentElement.scrollTop ) {scrolledY = document.documentElement.scrollTop; } 
else if( document.body ) { scrolledY = document.body.scrollTop; } 

var adswidth = 615;
var max=pageheight-adswidth-90;
var posy=scrolledY; 
var stop=scrolledY+adswidth+90; 

if( stop>=pageheight ) {  $('#message_box').animate({ top:max },{queue: false, duration: 500})  } 
else {$('#message_box').animate({ top:posy },{queue: false, duration: 500});   }

});
})();


$(document).ready(function(){ 

$(".act5").bind("mouseenter", function(){ 	$(".sub_menu").css({ "visibility": "visible" });  });
$(".m5").bind("mouseenter", function(){ 	$(".sub_menu").css({ "visibility": "visible" });   });
$(".m5").bind("mouseenter", function(){   $('.m5').addClass('act5');  });

$(".sub_menu").bind("mouseleave", function(){ $(".sub_menu").css({ "visibility": "hidden" });   $('.m5').removeClass('act5').addClass('m5'); });
$(".br2").bind("mouseenter", function(){    $(".sub_menu").css({ "visibility": "hidden" });   $('.m5').removeClass('act5').addClass('m5');  });  
$(".m1").bind("mouseenter", function(){    $(".sub_menu").css({ "visibility": "hidden" });   $('.m5').removeClass('act5').addClass('m5');  });  
$(".act1").bind("mouseenter", function(){    $(".sub_menu").css({ "visibility": "hidden" });   $('.m5').removeClass('act5').addClass('m5');  });  
$(".m3").bind("mouseenter", function(){    $(".sub_menu").css({ "visibility": "hidden" });   $('.m5').removeClass('act5').addClass('m5');  });  
$(".act3").bind("mouseenter", function(){    $(".sub_menu").css({ "visibility": "hidden" });   $('.m5').removeClass('act5').addClass('m5');  });  
});

$(function() { $("a[rel*=external]").attr( "target", "_blank" ); });
$(function() { $("a[rel*=nofollow]").attr( "target", "_blank" ); });



