<!-- 
//Disable right click script 
//visit http://www.rainbow.arch.scriptmania.com/scripts/ 
var message="Sorry, right-click has been disabled"; 
/////////////////////////////////// 
function clickIE() {if (document.all) {(message);return false;}} 
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) { 
if (e.which==2||e.which==3) {(message);return false;}}} 
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;} 
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;} 
document.oncontextmenu=new Function("return false") 
// -->




	$(function () {
		$('#alert').hide();
		$('#yebo').hide();
		$('#comment').hide();
		
		//if is IE
		
		if(!+"\v1"){  // true only in IE
			$('#alert').fadeIn(300)
		}
	});


	$(document).ready(function(){
		
		var timer = setTimeout(toGray, 2000)
		
	    $(window).scroll(function() {

			clearTimeout(timer)
			timer = setTimeout(toGray, 2000)
			
		 	var bodyCenter = $(window).scrollTop() + $(window).height()/2;
			var yeboCenter = $('#yc').offset().top +$('#yc').height()/2
			
			if ( yeboCenter > bodyCenter-100 && yeboCenter < bodyCenter+100 ){
				if (!$('#yebo').is('.showed')){
					$('#yebo').addClass('showed').delay(0).fadeIn(400);
					$('#comment').addClass('showed').delay(300).fadeIn(400);
				}
			}else{
				if ($('#yebo').is('.showed')){
					$('#comment').removeClass('showed').delay(0).fadeOut("fast");
					$('#yebo').removeClass('showed').delay(300).fadeOut("fast");
				}
			}
		
		 	$('#content div').each(function(i) {
		  		var thisCenter = $(this).offset().top + $(this).height()/2;
		  		if ( thisCenter > bodyCenter-100 && thisCenter < bodyCenter+100 ) {
		  			if (!$(this).is('.faded')){
		  				$(this).addClass('faded').animate({ color: "#4b9ba0" });
		  			}
		  		} else {
		  			if ($(this).is('.faded')) {
		  				$(this).removeClass('faded').animate({ color: "#a4a4a4" });
		  			}
		  		}
		 	});
		});

		
		function toGray(){
			$('#content div').each(function(i) {
				if ($(this).is('.faded')) {
			  		$(this).removeClass('faded').animate({ color: "#a4a4a4" });
			  	}
			});
			
		}
		
	});
