var RTR_ArticleURL = location.href;
if (location.href.search("\\?") != -1) {
	RTR_ArticleURL = location.href.split("?")[0];
}

var RTR_ArticleTitle = "Tickets3d.com";
if (getMetaTag("title") != "")
	RTR_ArticleTitle = getMetaTag("title");

var RTR_ArticleBlurb = "See, Click, Buy. Simple. Just like that. See Where You Want to Go.<br />Welcome to the easiest, fastest ticket-buying experience on the web! Just click on the map, and see where you want to go.<br/>Tickets3D features VisualBoxOffice software, a revolutionary 3D mapping technology that allows you to see where your seats are, as you buy them. We take the guesswork out of buying the best seats at the best prices. We can show you how the action will look from your section and how much the tickets cost all at the same time. No more roaming back and forth around a site with static, hard- to-understand seating charts. Just See, Click, Buy. Simple.";
if (getMetaTag("description") != "")
	RTR_ArticleBlurb = getMetaTag("description");

function shareDelicious() {
	if (typeof(RTR_ArticleTitle) != 'undefined')
		commonPopup('http://del.icio.us/post?v=4&noui&jump=close&url='+encodeURIComponent(RTR_ArticleURL)+'&title='+encodeURIComponent(RTR_ArticleTitle)+'&notes='+encodeURIComponent(RTR_ArticleBlurb), 540, 500, 1, 'deliciousPopup');
}

function shareTechnorati() {
	if (typeof(RTR_ArticleTitle) != 'undefined')
		commonPopup('http://technorati.com/faves/?add='+encodeURIComponent(RTR_ArticleURL)+'&tags=tickets', 540, 500, 1, 'technoratiPopup');
}

function shareFacebook() {
	if (typeof(RTR_ArticleTitle) != 'undefined')
		commonPopup('http://www.facebook.com/sharer.php?u='+encodeURIComponent(RTR_ArticleURL)+'&t='+encodeURIComponent(RTR_ArticleTitle), 626, 436, 1, 'facebookPopup');
}

function shareNewsvine() {
	if (typeof(RTR_ArticleTitle) != 'undefined')
		commonPopup('http://www.newsvine.com/_wine/save?h='+encodeURIComponent(RTR_ArticleTitle)+'&u='+encodeURIComponent(RTR_ArticleURL)+'&e='+encodeURIComponent(RTR_ArticleBlurb), 650, 445, 1, 'newsvinePopup');
}

function shareYahoo() {
	if (typeof(RTR_ArticleTitle) != 'undefined')
		commonPopup('http://myweb2.search.yahoo.com/myresults/bookmarklet?t='+encodeURIComponent(RTR_ArticleTitle)+'&u='+encodeURIComponent(RTR_ArticleURL)+'&ei=UTF-8'+'&d='+encodeURIComponent(RTR_ArticleBlurb), 620, 540, 1, 'yahooPopup');
}

function shareMixx() {
	if (typeof(RTR_ArticleTitle) != 'undefined')
		commonPopup('http://www.mixx.com/submit/story?title='+encodeURIComponent(RTR_ArticleTitle)+'&page_url='+encodeURIComponent(RTR_ArticleURL)+'&description='+encodeURIComponent(RTR_ArticleBlurb), 1024, 640, 1, 'mixxPopup');
}

function shareDigg() {
	if (typeof(RTR_ArticleTitle) != 'undefined')
		commonPopup('http://digg.com/remote-submit?phase=2&url='+encodeURIComponent(RTR_ArticleURL)+'&title='+encodeURIComponent(RTR_ArticleTitle)+'&bodytext='+encodeURIComponent(RTR_ArticleBlurb), 540, 500, 1, 'diggPopup');
}

function getMetaTags()
{
    var metaTagsArray = new Array;

    var metaTags;
    if (document.all)
        metaTags = document.all.tags("meta");
    else if (document.documentElement)
        metaTags = document.getElementsByTagName("meta");

    for (i=0; i<metaTags.length; i++)
    {
        var metaTagName  = metaTags[i].getAttribute("name");
        var metaTagValue = metaTags[i].getAttribute("content");
        
        metaTagsArray[metaTagName] = metaTagValue;
    }
    
    return metaTagsArray;
}

function getMetaTag(metaname)
{
    var metaTagsArray = new Array;

    var metaTags;
    if (document.all)
        metaTags = document.all.tags("meta");
    else if (document.documentElement)
        metaTags = document.getElementsByTagName("meta");

    for (i=0; i<metaTags.length; i++)
    {
        if (metaTags[i].getAttribute("name") == metaname)
			return metaTags[i].getAttribute("content");        
    }    
    return "";
}

function commonPopup(url, width, height, toolsInd, wname)
{
    var options = "width=" + width + ",height=" + height + ",top=" + ((screen.height - height) / 4).toString() + ",left=" + ((screen.width - width) / 2).toString();

    switch (toolsInd)
    {
        case 1:
            options += ",toolbar=no,status=no,resizable=no,scrollbars=yes";
            break;
        case 2:
            options += ",menubar=yes,toolbar=yes,status=yes,resizable=yes,location=yes,scrollbars=yes";
            break;
        case 3:
            options += ",top=50,left=50,resizable=yes,scrollbars=yes,status=no,menubar=no,toolbar=no,location=yes";
            break;
        default:
            //do nothing
            break;
    }

    if (!wname)
    {
        wname = "seattletixxPopup";
    }

    popupWindow = window.open(url, wname, options);

    if (popupWindow)
    {
        popupWindow.focus();
    }
}

function addBookmark(){
	title = document.title; 
	url = window.location.href;

  if(window.sidebar){ // Firefox
    window.sidebar.addPanel(title, url,'');
  }else if(window.opera){ //Opera
    var a = document.createElement("A");
    a.rel = "sidebar";
    a.target = "_search";
    a.title = title;
    a.href = url;
    a.click();
  } else if(document.all){ //IE
    window.external.AddFavorite(url, title);
  }
}