// JavaScript Document

function bookmarksite(title, url){
	if (document.all)
		window.external.AddFavorite(url, title);
	else if (window.sidebar)
		window.sidebar.addPanel(title, url, "");
	divClose();
}

function createCookie(name,value,days){
	if (days){
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function getCookie(name){
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++){
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);}
	return null;
}

function eraseCookie(name){
	createCookie(name,"",-1);
}

function initDiv(){
	if (getCookie('add_bookmark') != "1"){
		dsDiv.style.display = "block";
		start = dsDiv.offsetHeight;
		dsDiv.style.top = 0-start;
		scrollDiv(0,1);}	
}
var searchtimer;
var start = 0;
function scrollDiv(start,inc){
  if(parseInt(dsDiv.style.top) < start){
		dsDiv.style.top = parseInt(dsDiv.style.top)+inc;
		searchtimer = window.setTimeout ("scrollDiv("+start+","+inc+");", 10);}
	else{
		clearTimeout(searchtimer);}
}

function divClose(){
	scrollDiv(start,-1);
	createCookie('add_bookmark',1,'120');
}