/*function showLink(pid,anchor) {
	document.getElementById('ftLink').value = "http://test.podhoster.com?index4.php?pid=" + pid; 
	while (!anchor.offsetTop) {
	anchor = anchor.offsetParent;
	}
	var obj =document.getElementById('ftLink-box');
	document.getElementById('ftLink-box').style.top = (parseInt(anchor.offsetTop)) - 115 + "px";
	document.getElementById('ftLink-box').style.left = 160 + "px";	
	document.getElementById('ftLink-box').style.display = 'block';
}  */

function showLink(URL,pid,anchorname) {
	var anchor = document.getElementById(anchorname);
	var link = "http://"+URL+"?pid=" + pid; 
	var share = "<div id='ftLink-box'><div class='Link-boxinner'><div class='ftLink-boxheader'>Link<a class='ftLink-boxHideButton' href='javascript:void(0)' onclick=\"closelink(document.getElementById('"+anchorname+"'));\">Close</a></div>URL:<input type='text' id='Link' name='link' readonly value='"+link+"' size='40'></div></div>";
	anchor.innerHTML = share;
	var obj = document.getElementById('ftLink-box');
	while (!anchor.offsetTop) {
	anchor = anchor.offsetParent;
	}
	obj.style.top = (parseInt(anchor.offsetTop)) - 115 + "px";
	obj.style.left = (parseInt(anchor.offsetLeft)) + 60 + "px";	
	obj.style.display = 'block';
} 

function showShare(URL,title,anchorname) {
	var articleURL = URL;
	var anchor = document.getElementById(anchorname);
	var docTitle=title;
	var linkface='http://www.facebook.com/sharer.php?u='; 
	var linkdeli='http://del.icio.us/post?v=4&noui&jump=close&url='; 
	var linkredd='http://reddit.com/submit?url='; 
	var linkdigg='http://digg.com/submit?url='; 
	var linkstumble='http://www.stumbleupon.com/submit?url=';
	var linkmixx='http://www.mixx.com/submit?page_url=';
	var linkpropel='http://www.propeller.com/submit/?U=';
	var linklinkedin='http://www.linkedin.com/shareArticle?mini=true&url=';
	var linktwitter='http://twitter.com/home?status=';
	var linkyahoo='http://buzz.yahoo.com/buzz?guid=';
	var sharedeli='<li id="delicious1"> <a target="new"  title="Post this story to Delicious" href="'+linkdeli+articleURL+'&title='+docTitle+'"><span class="linktext">Delicious</span></a> </li>'; 
	var shareredd='<li id="reddit1"> <a target="new"  title="Post this story to reddit" href="'+linkredd+articleURL+'&title='+docTitle+'"><span class="linktext">reddit</span></a> </li>'; 
	var sharedigg='<li id="digg1"> <a target="new"  title="Post this story to Digg" href="'+linkdigg+articleURL+'&title='+docTitle+'"><span class="linktext">Digg</span></a> </li>'; 
	var sharestumble='<li id="stumbleupon1"> <a target="new"  title="Post this story to StumbleUpon" href="'+linkstumble+articleURL+'&title='+docTitle+'"><span class="linktext">stumbleupon</span></a> </li>';
	var sharebuzz ='<li id="yahooBuzz1"><span id="yahooBuzzBadge"></span></li>';
	var shareface='<li id="facebook1"> <a target="new"  title="Post this story to Facebook" href="'+linkface+articleURL+'&t='+docTitle+'"><span class="linktext">Facebook</span></a> </li>';
	var sharemixx='<li id="mixx1"> <a target="new"  title="Post this story to Mixx" href="'+linkmixx+articleURL+'&title='+docTitle+'"><span class="linktext">Mixx</span></a> </li>';
	var sharepropel='<li id="propeller1"> <a target="new"  title="Post this story to Propeller" href="'+linkpropel+articleURL+'&title='+docTitle+'"><span class="linktext">Propeller</span></a> </li>';
	var sharelinkedin='<li id="linkedin1"> <a target="new"  title="Post this story to LinkedIn" href="'+linklinkedin+articleURL+'&title='+docTitle+'"><span class="linktext">LinkedIn</span></a> </li>';
	var sharetwitter='<li id="twitter1"> <a target="new"  title="Post this story to Twitter" href="'+linktwitter+docTitle+'+-+'+articleURL+'"><span class="linktext">Twitter</span></a> </li>';
	var shareyahoo = '<li id="yahoobuzz1"> <a target="new" title="Post this story to Yahoo Buzz" href="'+linkyahoo+articleURL+'"><span class="linktext">Yahoo!&nbsp;Buzz</span></a> </li>';
	var sharecontent = '<ul id="shareslist" style="margin-top:0;">'+sharedeli+sharedigg+shareface+sharelinkedin+sharemixx+'</ul><br>';
	sharecontent +='<ul id="shareslist" style="margin-top:0;">'+sharepropel+shareredd+sharestumble+sharetwitter+shareyahoo+'</ul>';
	var share = "<div id='ftShare-box'><div class='Share-boxinner'><div class='ftShare-boxheader'>Share<a class='ftShare-boxHideButton' href='javascript:void(0)' onclick=\"closelink(document.getElementById('"+anchorname+"'));\">Close</a></div>"+sharecontent+"</div></div>";
//	document.getElementById('ftShare-box').innerHTML = share;
	anchor.innerHTML = share;
	while (!anchor.offsetTop) {
	anchor = anchor.offsetParent;
	}
	var obj =document.getElementById('ftShare-box');
	document.getElementById('ftShare-box').style.top = (parseInt(anchor.offsetTop)) - 160 + "px";
	document.getElementById('ftShare-box').style.left = (parseInt(anchor.offsetLeft)) - 50 + "px";	
	document.getElementById('ftShare-box').style.display = 'block';
} 

function closelink(anchor) {
	anchor.innerHTML = "";
}
