// JavaScript Document
//
      var baseText = null;
	  var pagePath = "";
      function showPopup(w,h)
	  {		  
		var popUp = document.getElementById("popupcontent");
		popUp.style.top = (document.documentElement.scrollHeight-405)+"px"; //(popUp.style.y - 150)+"px"; //((screen.height/2)+150)+"px";
		popUp.style.left = ((screen.width/2)+122)+"px"; //document.getElementById("shareb").x+"px"; //"200px";
		popUp.style.width = w + "px";
		popUp.style.height = h + "px";
		if (baseText == null)
		//baseText = popUp.innerHTML;
      //popUp.innerHTML = "<iframe frameborder='0' scrolling='no' width='240' height='326' src=\"sb.html\"></iframe>"+"<div id=\"statusbar\"><button onclick=\"hidePopup();\">x</div>";
	  popUp.innerHTML = "<iframe frameborder='0' scrolling='no' width='240' height='345' src=\"sb.html\"></iframe>";

      //var sbar = document.getElementById("statusbar");
     // sbar.style.marginTop = (parseInt(h)) + "px";
	      popUp.style.visibility = "visible";
      }
	  
      function hidePopup()
	  {
		  var popUp = document.getElementById("popupcontent");
		  popUp.style.visibility = "hidden";
	}

	function getPagePath()
	{		
		pagePath = window.location.href;		
		//alert("pagepath "+pagePath);
	}

//function getSBPath(url)
function getSBPath(url, sbSelect)
{
	//url = pagePath;
	//alert("url "+url);
	var sbType = sbSelect.toString();
	//window.alert("url "+url+" | sbType "+sbType);
	switch(sbType)
	{
		case "facebook": 
			var path="http://www.facebook.com/share.php?u="+url+"&amp;t=WITS Interactive";
			window.open(path, "_blank");
		break;
		
		case "gBuzz": 
			//var path="http://www.google.com/reader/link?url="+url+"&amp;title=WITS Interactive&amp;srcURL=http://www.witsindia.com/&amp;srcTitle=WITS Interactive&amp;snippet=%3D%3Cimg%20%20style%3D%22border%3A1px%20solid%20gray%3B%22%20title%3D%22Wits%20Interactive%22%20src%3D%22icon%2Dimages%2FgBuzz%2Epng%22%20alt%3D%22%22%20width%3D%22282%22%20height%3D%22157%22%20%2F%3E";
				var path="http://www.google.com/reader/link?url="+url+"&title=WITS Interactive&srcURL=http://www.witsindia.com/&srcTitle=WITS Interactive&snippet=<img title='WITS Interactive' src='http://www.witsindia.com/images/homepg/wits_logo.jpg' alt='' width='213' height='53'/>";
			window.open(path, "_blank");
		break;
		
		case "twitter": 
			var path="http://twitter.com/home?status=WITS Interactive-"+url;
			window.open(path, "_blank");
		break;
		
		case "studiVZ": 
			var path="http://www.studivz.net/Suggest/Selection/?u="+url+"&desc=WITS Interactive&prov=";
			window.open(path, "_blank");
		break;
		
		case "yigg": 
			var path="http://yigg.de/neu?exturl="+url+"&amp;exttitle=WITS Interactive";
			window.open(path, "_blank");
		break;
		
		case "myspace": 
			var path="http://www.myspace.com/Modules/PostTo/Pages/?u="+url+"&amp;t=WITS Interactive";
			window.open(path, "_blank");
		break;
		
		case "delicious": 
			var path="http://delicious.com/post?url="+url+"&amp;notes=";
			window.open(path, "_blank");
		break;
		
		case "oneview": 
			var path="http://www.oneview.de/quickadd/neu/addBookmark.jsf?URL="+url+"&title=WITS Interactive";
			window.open(path, "_blank");
		break;
		
		case "stumble": 
			var path="http://www.stumbleupon.com/submit?url="+url;
			window.open(path, "_blank");
		break;
		
		case "google": 
			var path="http://www.google.com/bookmarks/mark?op=add&bkmk="+url+"&title=WITS Interactive&annotation=";
			window.open(path, "_blank");
	//https://www.google.com/bookmarks/mark?op=add&bkmk=http%3A%2F%2Fwww.ehow.com%2Fhow_2172112_save-bookmarks-google.html&title=How+to+Save+Bookmarks+in+Google+|+eHow.com&annotation=
		break;
		
		case "yahoo": 
			var path="http://bookmarks.yahoo.com/toolbar/savebm?u="+url+"&amp;t=WITS Interactive&opener=bm&amp;ei=UTF-8&amp;d=";
			window.open(path, "_blank");
		break;
		
		case "live": 
			//var path="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url="+url;
			var path = "https://favorites.live.com/quickadd.aspx?url="+url+"&title=WITS Interactive";
			window.open(path, "_blank");
			
		break;
		
		case "mrwong": 
			//var path="http://www.mister-wong.com/addurl/?bm_url="+url+"&amp;bm_description=WITS Interactive";
			var path="http://www.mister-wong.com/index.php?action=addurl&bm_url="+url+"&bm_description=WITS Interactive&bm_notice=";
			window.open(path, "_blank");
//http://www.mister-wong.com/index.php?action=addurl&bm_url=http%3A%2F%2Fwww.ehow.com%2Fhow_2172112_save-bookmarks-google.html&bm_description=How+to+Save+Bookmarks+in+Google+|+eHow.com&bm_notice=
		break;
		
		case "diigo": 
			var path="http://www.diigo.com/post?url="+url;
			window.open(path, "_blank");
		break;
		
		case "digg": 
			var path="http://digg.com/submit?phase=2&amp;url="+url+"&amp;bodytext=";
			window.open(path, "_blank");
		break;
		
		case "reddit": 
			var path="http://reddit.com/submit?url="+url;
			window.open(path, "_blank");
		break;
		
		case "linkarena": 
			var path="http://linkarena.com/bookmarks/addlink/?url="+url;
			window.open(path, "_blank");
		break;
		
		case "folkd": 
			var path="http://www.folkd.com/submit/"+url;
			window.open(path, "_blank");
		break;
		
		case "linkedin": 
			var path="http://www.linkedin.com/shareArticle?mini=true&url="+url+"&title=WITS Interactive&ro=false&summary=&source=";
			window.open(path, "_blank");
			
			//http://www.linkedin.com/shareArticle?mini=true&url=http%3A%2F%2Fwww.ehow.com%2Fhow_2172112_save-bookmarks-google.html&title=How+to+Save+Bookmarks+in+Google+|+eHow.com&ro=false&summary=&source=
			break;
		
		default:
		break;
	}
}
