
function Share() 
{ 
//
}
function goShare(where, what) {
    window.open( where + "&" + what , '_blank', 'menubar=no,location=no,status=0,width=760,height=500,resizable=yes' );
    return false;
}

function goShareSpaces(where) {
    window.open(where, '_blank', 'menubar=yes,location=yes,status=1,width=1000,height=600,resizable=yes' );
    return false;
}

function launchEmailPageJE(sQueryString, sPagePath, sPageName, sChannelName)
{
	thePageName = URLencode(sPageName);
	theChannelName = URLencode(sChannelName);
	thePagePath = URLencode(sPagePath);
	
	sQueryString += "&pageName="+thePageName+"&channelName="+theChannelName+"&pagePath="+thePagePath;
	window.open('http://partners.sympatico.msn.ca/Bell.Sympatico.CMS/EmailAFriendJE.aspx'+sQueryString, 'EmailThisPage', 'toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,history=no,resizable=no,width=450,height=460,left=0,top=0');
}

function addRemoveThisItem(what, textbox)
{   
    //alert("addRemoveThisItems is add/removing " + what + " in " + textbox);
    what = "," + what;
    var list = document.getElementById(textbox).value;
    
    if (list.indexOf(what) >= 0)
    {
        //alert("found " + what);
        list = remove(list, what);

        //list = list.slice(list.indexOf(what),(what.length+list.indexOf(what)));
    }
    else
    {
        list += what;
    }
    
    //alert("now, the tools list says " + list);
    document.getElementById(textbox).value = list;
    
}  


function remove(s, t) {
  /*
  **  Remove all occurrences of a token in a string
  **    s  string to be processed
  **    t  token to be removed
  **  returns new string
  */
  //alert("removing " + t + " from " + s + ".");
  i = s.indexOf(t);
  r = "";
  if (i == -1) return s;
  r += s.substring(0,i) + remove(s.substring(i + t.length), t);
  //alert("returning " + r);
  return r;
  }
