window.onload = setMashovim;

function setMashovim()
{
	var objBody = document.getElementsByTagName("body").item(0);
	
	// create "mashovim" div and hardcode some functional styles (aesthetic styles are in CSS file)
	var objMashovim = document.createElement("div");
	objMashovim.setAttribute('id','mashovim');
	objMashovim.setAttribute('onmouseover','tagOver()');
	objMashovim.setAttribute('onmouseout','tagOut()');
	objMashovim.style.position = 'fixed';
	objMashovim.style.bottom = '1px';
	objMashovim.style.right = '-199px';
	objMashovim.style.width = '100px';
	objMashovim.style.height = '100px';
	objMashovim.style.zIndex = '90';
	objMashovim.innerHTML = '<a href="http://www.mashovim.net/site/5/" target="_blank"><img src="http://www.mashovim.net/imgs/mashovim.gif" alt="אתר המשובים של ישראל" style="border:none; width:300px; height:100px;"></a>';
	objBody.insertBefore(objMashovim, objBody.firstChild);
}

var tagtimerOver;
var tagtimerOut;
function tagOver()
{
	clearTimeout(tagtimerOut);
	var obj = document.getElementById("mashovim");
	var right = parseInt(obj.style.right);
	if(right<1)
	{
		obj.style.right = right+2+"px";
		tagtimerOver = setTimeout("tagOver()", 1);
	}
}

function tagOut()
{
	clearTimeout(tagtimerOver);
	var obj = document.getElementById("mashovim");
	var right = parseInt(obj.style.right);
	if(right>-199)
	{
		obj.style.right = right-1+"px";
		tagtimerOut = setTimeout("tagOut()", 1);
	}
}
