var siteObj=Class.create();

siteObj.prototype={
	initialize: function(){
		this.lastScrollY = 0;
	},

	addQuickLink:function(ql_top,ql_right)
	{
		var quickLink = document.createElement("div");
		quickLink.setAttribute("id","quickLink");
		var flash_link = document.createElement("div");
		flash_link.setAttribute("id","flash_link");
		quickLink.appendChild(flash_link);
		
		/*
		var topElement = $(wDiv);
		topElement.firstChild.parentNode.insertBefore(quickLink,topElement.firstChild);
		*/
		var topElement = $("ql_wrap");
		//var topElement = document.body;
		topElement.firstChild.parentNode.insertBefore(quickLink,topElement.firstChild);

		$("quickLink").style.position="relative";
		$("quickLink").style.width = "800px";
		$("quickLink").style.margin = "0 auto";
		$("flash_link").style.position = "absolute";
		$("flash_link").style.width = "99px";
		$("flash_link").style.height = "500px";
		$("flash_link").style.top = "10px";
		$("flash_link").style.right = "-99px";
		var so_ql = new SWFObject("../flash/quick_link.swf", "quick_link", "99", "600", "8");
		so_ql.addParam("wmode","transparent");
		so_ql.write("flash_link");
	},
	
	floatDiv:function()
	{
		var diffY;
		
		if (document.documentElement && document.documentElement.scrollTop)
			diffY = document.documentElement.scrollTop;
		else if (document.body)
			diffY = document.body.scrollTop
		else
			{
				//Netscape stuff
			}
	
		percent=.1*(diffY-this.lastScrollY); 
		if(percent>0) percent=Math.ceil(percent); 
		else percent=Math.floor(percent); 
		document.getElementById("flash_link").style.top = parseInt(document.getElementById("flash_link").style.top)+percent+"px";
	
		this.lastScrollY=this.lastScrollY+percent; 
	},
	
	startScroll:function()
	{
		var me = this;
		var s= function()
		{
			me.floatDiv();
		}
		this.scrollTimer = window.setInterval(s,10);
	}
}
var santana=new siteObj();

//Event.observe(window, "load", santana.addQuickLink, false);

Event.observe(window, 'scroll', ddd);
function ddd(){
	var diffY;
	diffY =  window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
	$("quickLink").setStyle({top:diffY+"px"});
}
