lastScrollY=0;
function heartBeat(){
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-lastScrollY);

if(percent>0)percent=Math.ceil(percent);
	else percent=Math.floor(percent);
	document.getElementById("full").style._top=parseInt(document.getElementById("full").style.bottom)+percent+"px";
	lastScrollY=lastScrollY+percent;
	document.getElementById("full").style.display = "block";
	}


suspendcode="<div  id=\"full\"><a href='#mid' class=\"gotop\"><img src='js/gotop.gif' border=0 /></a></div>"
document.write(suspendcode);

window.setInterval("heartBeat()",1);



function switchImage(imageId, imageUrl, linkId, linkUrl, preview, title, alt) {
	if(imageId && imageUrl) {
		var image = $(imageId);
		image.src = imageUrl;

		if(title) {
			image.title = title;
		}
		if(alt) {
			image.alt = alt;
		}
	}

	if(linkId && linkUrl) {
		var link = $(linkId);
		link.href = linkUrl;
	}
}

//Tabs
function setTab(name,cursel,n){
for(i=1;i<=n;i++){
var menu=document.getElementById(name+i);
var con=document.getElementById("con"+name+i);
menu.className=i==cursel?"current":"";
con.style.display=i==cursel?"block":"none";
}
}

/*PageTop*/
function(){
	$.fn.ScrollTo = function(speed, callback) {
	var top = $(this).offset().top;
	if ('BODY' == $(this).attr('tagName')) {// for IE6
	top = 0;
	}
	//	$($.browser.safari ? 'body' : 'html')
	$('html, body').animate({scrollTop: top}, speed, 'swing', callback);
	};
	
	$(".gotop").click(function(){
		var scrolltargetval = $(this).attr('href')			
		if (scrolltargetval.length == 1){
			var scrolltarget = 'body'
		}
		else {
			var scrolltarget = scrolltargetval
		}
		$(scrolltarget).ScrollTo(800);
		return false;
		})
};

