    function Work() {
		this.data=null;
		this.current=null;
		this.run = function() {
		        var scrolltop = this.getTop();
		        var pageheight = this.getHeight();
		        var y =  scrolltop * 40 / pageheight;
			y += this.info.translate;
	    
	    		y = -1 * y;
		        try {
		        document.getElementsByTagName('body').item(0).style.backgroundPosition=this.info.pos + y + "px";
			} catch(e) { }
		        if(this.pid)
		            clearTimeout(this.pid);
		        this.pid = setTimeout("w.hilight()", 55);

        	}
        	this.pid=null;
		this.info={};


    }    
	
	Work.prototype = new function() {
	
    
	
	function findPos (obj) {
	        var curtop = 0;
	    
	        if(obj.y)
	            curtop = obj.y;
	        else if (obj.offsetParent) {
	            var orig=obj;
	            do {
	                curtop += obj.offsetTop;
	    
	    
	            } while (obj = obj.offsetParent);
	        }
	        return curtop;
	    }
	
	if(/MSIE/i.test(navigator.userAgent)) {

		this.getTop = function() {
			return document.documentElement.scrollTop;
		}
		this.getHeight = function() {
			return document.documentElement.clientHeight;
		}
	} else {
		this.getTop = function() {
			return window.pageYOffset;
		}
		this.getHeight = function() {
			return window.innerHeight;
		}
	}
	
    this.hilight = function(){
    	
		if(!this.data) {
			this.data = new Array();

		
			var content = document.getElementById("content").firstChild;//.getElementsByTagName("div");
			var indx=0;
			while(content) {
				if(content.nodeName == 'DIV') {
					var post = content;
					if(post.className.indexOf('post') > -1) {
						var y = findPos(post);
						this.data.push( { y: y, h: y+post.offsetHeight, post: post});
					}
				}
				content = content.nextSibling;
			}
		}
    	
	        var scrolltop = this.getTop();
	        var pageheight = this.getHeight();
	        var cut = scrolltop + (pageheight / 3);


		for(var i = 0; i < this.data.length; i++) {
			if(this.data[i].y < cut && this.data[i].h > cut) {
				if(this.current == this.data[i].post)
					return;
				this.data[i].post.className += " show";
				if(this.current)
					this.current.className = this.current.className.replace(/\s*show/g, '');
				this.current = this.data[i].post;
				return;
			}
		}
	}
	
	
	}
	
	var w = new Work();

	Event.observe(window, 'scroll', function() { w.run(); });

	
	
	function back() {
		var i = Math.random() * 6;
		//i=1.5;
		if(i > 5.0) {
document.getElementsByTagName('body').item(0).className="two";
			w.info.pos="10px ";
			w.info.translate=-100;
		} else if(i > 4.0) {
document.getElementsByTagName('body').item(0).className="three";
			w.info.pos="-100px ";
			w.info.translate=-100;
		}else if(i > 3.0) {
document.getElementsByTagName('body').item(0).className="four";
			w.info.pos="-20px ";
			w.info.translate=-180;
		}else if(i > 2.0) {
document.getElementsByTagName('body').item(0).className="five";
			w.info.pos="80px ";
			w.info.translate=-50;
		}else if(i > 1.0) {
document.getElementsByTagName('body').item(0).className="six";
			w.info.pos="20px ";
			w.info.translate=-100;
		} else {
document.getElementsByTagName('body').item(0).className="one";
			w.info.pos="-30px ";
			w.info.translate=0;
		}
		
		/*if(/MSIE/i.test(navigator.userAgent)) {
			try {
				var header = document.getElementById('header');
				header.style.marginTop = '5px';
				header.style.marginLeft = '-30px';
			} catch(e) {}
		}*/
	}
	
	Event.observe(window, 'load', function() { w.run(); back(); });
