//Dont remove the link for hscripts.com in share image

var color1 = "#ffffee";
var color2 = "#edf8d7";
var mouseocolor = "#FFFFFF";
var sitename = "Your Site Name";

window.onerror = null;
var bName = navigator.appName;
var bVer = parseInt(navigator.appVersion);
var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
var menuActive = 0;
var menuOn = 0;
var onLayer;
var timeOn = null;
var colnow = color1;

var url = encodeURIComponent(window.location);
var title = encodeURIComponent(document.title);

//set the bookmark link, where you want(topright,topleft,bottomright,bottomleft)  
var corner = "bottomright";
function bookmark(title,url){
	if(window.sidebar) 
          window.sidebar.addPanel(title,url,"");
	else if(window.opera && window.print){
          var elem = document.createElement('a');
          elem.setAttribute('href',url);
          elem.setAttribute('title',title);
          elem.setAttribute('rel','sidebar');
          elem.click();
	}
	else if(os == "ie")
          window.external.AddFavorite(url,title);
}

document.write('<div id=ddd style="z-index: 1000; position: absolute; visibility: visible; padding: 2px; left:5px; top: 5px; border: 0px solid green;"><img src="http://hscripts.com/images/share.gif" border="0" usemap="#Map" style=\'border: 0px solid gray;\' width=130><map name="Map" id="Map"><area shape="circle" coords="15,10,9" href="http://hscripts.com" /></map><br><div style="background-color: #d3d3d3;" width=130><a onclick=wopmove("twitter") rel="nofollow" target="_blank" style="font-size:14px; text-decoration: none; cursor: pointer;" title="Twitter"><img src="http://twitter.com/favicon.ico" alt="twitter" border=0"></a><a target="_blank" rel="nofollow" style="font-size:14px; padding-left: 3px; text-decoration: none; cursor: pointer;" onclick=wopmove("orkut") title="Orkut"><img src="http://img2.orkut.com/favicon.ico" alt="orkut" border=0"></a><a  rel="nofollow" style="font-size:14px; padding-left: 3px; text-decoration: none; cursor: pointer;"  onclick=wopmove("facebook") title="facebook"><img src="http://facebook.com/favicon.ico" alt="Bookmark" border=0"></a><a rel="nofollow" style="font-size:14px; text-decoration: none; cursor: pointer; padding-left: 3px; cursor: pointer;" onclick=wopmove("google") title="google"><img src="http://google.com/favicon.ico"></a><a rel="nofollow" style="font-size:14px; padding-left: 3px; text-decoration: none; cursor: pointer;" onclick=wopmove("delicious") title="delicious"><img src="http://delicious.com/favicon.ico" alt="Bookmark" border=0"></a><a rel="nofollow" style="font-size:14px; cursor: pointer; padding-left: 3px; text-decoration: none;" onclick=wopmove("digg") title="Digg"><img src="http://hiox.org/images/digg.gif" alt="Bookmark" border=0"></a><a rel="nofollow" target="_blank" style="font-size:14px; padding-left: 3px; text-decoration: none; cursor: pointer;" onclick=wopmove("stumbleupon") title="Stumble upon"><img src="http://stumbleupon.com/favicon.ico" alt="stumble upon" border=0"></a></div></div>');
document.write('<form method=post id=login name=xx></form>');
var os;
if(document.layers)
 os = "n4";
else if(document.getElementById&&!document.all)
 os = "n6";
else if(document.all)
 os = "ie";

//Function to scroll the bookmark images throughout the page
function run()
{
var dda = document.getElementById('ddd');
 if(os == "ie"){
   pwidth = window.document.body.offsetWidth;
   pheight = window.document.body.offsetHeight;
   stop = document.body.scrollTop;
   sleft = document.body.scrollLeft;
   setTimeout('run()',5);
 }else{
   pwidth = window.innerWidth;
   pheight = window.innerHeight;
   stop = window.pageYOffset;
   sleft = window.pageXOffset;
   document.getElementById('ddd').style.position = 'fixed';
}

  if(corner == "topleft"){
    dda.style.top = (stop+15)+"px";
    dda.style.left = (sleft+15)+"px";
  }else if(corner == "topright"){
    dda.style.top = (stop)+"px";
    dda.style.left = (sleft+pwidth-70)+"px";  
  }else if(corner == "bottomleft"){
    dda.style.top = (stop+pheight-43)+"px";
    dda.style.left = (sleft+15)+"px";
  }else if(corner == "bottomright"){
    dda.style.top = (stop+pheight-70)+"px";
    dda.style.left = (sleft+pwidth-240)+"px";  
  }
 // setTimeout('run()',5);
}
function wopmove(id)
{
 var formObj = document.getElementById('login');
 formObj.target = "_blank";
 formObj.action = "http://zxc9.com/seo.php?type="+id+"&title="+title+"&url="+url;
 formObj.submit();
  	//window.location = "http://zxc9.com/seo.php?type="+id+"&title="+title+"&url="+url;*/
}
document.onload = run();
function showLayer(layerName,aa){
	var x =document.getElementById(aa);
	var tt =findPosX(x);
	var ww =findPosY(x)+18;
	
	//alert(tt+"---"+ww);

	if (timeOn != null) {
	clearTimeout(timeOn);
	hideLayer(onLayer);
	}
	if (IE4) {
	var layers = eval('document.all["'+layerName+'"].style');
	layers.left = tt;
	layers.top = ww;
	eval('document.all["'+layerName+'"].style.visibility="visible"');
	}
	else {
		if(document.getElementById){
		var elementRef = document.getElementById(layerName);
		if((elementRef.style)&& (elementRef.style.visibility!=null)){
		elementRef.style.visibility = 'visible';
		elementRef.style.left = tt;
		elementRef.style.top = ww;
		}
		}
	}
	onLayer = layerName
}

function hideLayer(layerName){
	if (menuActive == 0)
	{
		if (IE4){
		eval('document.all["'+layerName+'"].style.visibility="hidden"');
		}
		else{
			if(document.getElementById){
				var elementRef = document.getElementById(layerName);
				if((elementRef.style)&& (elementRef.style.visibility!=null)){
					elementRef.style.visibility = 'hidden';
				}
			}
		}
	}
}

function btnTimer() {
	timeOn = setTimeout("btnOut()",600)
}

function btnOut(layerName){
	if (menuActive == 0){
	hideLayer(onLayer)
	}
}

var item;
function menuOver(itemName){
	item=itemName;
	itemName.style.backgroundColor = mouseocolor; //background color change on mouse over
	clearTimeout(timeOn);
	menuActive = 1
}

function menuOut(itemName,iid){
	if(iid == 1)
		colnow = color1;
	else
		colnow = color2;

	if(item)
		itemName.style.backgroundColor = colnow;
	menuActive = 0
	timeOn = setTimeout("hideLayer(onLayer)", 100)
}

function findPosX(obj)
{
var curleft = 0;
if (obj.offsetParent)
{
while (obj.offsetParent)
{
curleft += obj.offsetLeft
obj = obj.offsetParent;
}
}
else if (obj.x)
curleft += obj.x;
return curleft;
}

function findPosY(obj)
{
var curtop = 0;
if (obj.offsetParent)
{
while (obj.offsetParent)
{
curtop += obj.offsetTop
obj = obj.offsetParent;
}
}
else if (obj.y)
curtop += obj.y;
return curtop;
}
