﻿jQuery(document).ready(function(){
	ieHover('#nav > li');
	slideBlock();
})
function ieHover(_selector, _class){
	if(_class == null) _class = 'hover';
	if (jQuery.browser.msie && jQuery.browser.version < 7) {
		jQuery(_selector).each(function(){
			jQuery(this).mouseenter(function(){
				jQuery(this).addClass(_class)
			}).mouseleave(function(){
				jQuery(this).removeClass(_class)
			})
		})
	}
}
function slideBlock(){
	$('div.slide-block').each(function(){
		var hold=$(this);
		var opener=hold.find('span.clients,span.home,span.projects');
		var slider=$('#twocolumns');
		hold.css({ right: -slider.width() });
		opener.bind('click', function(){
			hold.stop().animate({ right: 0 }, { queue: false, duration: 500 });
			opener.animate({ opacity: 0 }, { queue: false, duration: 100 });
			setTimeout(function(){
				opener.hide().css({ opacity: 0 });
			}, 250)
		})
		hold.bind('mouseleave', function(){
			hold.stop().animate({ right: -slider.width() }, { queue: false, duration: 500 });
			opener.show().animate({ opacity: 1 }, { queue: false, duration: 1000, complete: function(){ opener.removeAttr('style') } });
		})
	})
}
