

/*  UNICA CODES

	
	//define Unica vars
	var unica_imod_accountId =501;
	var unica_ni_script=1;
	var NTPT_IDCOOKIE_DOMAIN='.tysabri.com';
	var NTPT_GLBLEXTRA='tysabri.com';
	var NTPT_IMGSRC = 'http://pt200225.unica.com/ntpagetag.gif';
	var NTPT_HTTPSIMGSRC = 'https://pt200225.unica.com/ntpagetag.gif';
	

 end UNICA CODES */	



var Popup=null;
var NS4 = (document.layers) ? true : false;

function checkEnter(event)
{
	var code = 0;
	if (NS4)
		code = event.which;
	else
		code = event.keyCode;
	if (code==13){
		submitSearch();
	}
}

function submitSearch()
{
	var url ="<ptl:createPortalPageChangeURL pageName='search' doRedirect='false'/>";
	var intxt = document.bannersearch.search.value;
	var tempurl = url+"&param="+intxt
	if(intxt==""){
		alert("Please enter the search term.");
	}else{
		self.location=tempurl;
	}
}

function submitOnEnter(event, myObject){

    var code = 0;
    if (NS4)
        code = event.which;
    else
        code = event.keyCode;
    if (code==13){

        for (var i=0; i<document.forms.length; i++) {
            for (var j=0; j<document.forms[i].elements.length; j++)
            {
                 if (document.forms[i].elements[j] == myObject) {
                    document.forms[i].submit();
                    return true;
                 }
             }
        }
    }

    return false;
}

function leaveSite(obj){
	var tempLink = obj.href;
    if (tempLink.indexOf("extSite=") != -1) {
        tempLink = tempLink.substr(tempLink.indexOf("extSite="), tempLink.length);
        //alert(tempLink);        
    }
    // The order of these if statments matters!
	if (tempLink.indexOf("www.biogenidec.com")>-1){
		return confirm("You have clicked on a link that will take you out of this website");
	} else if (tempLink.indexOf("www.msleadersofhope.com")>-1){
		return confirm("You have clicked on a link that will take you out of this website");
	} else if (tempLink.indexOf("www.touchprogram.com")>-1){
		return confirm("You have clicked on a link that will take you out of this website");
	} else if(tempLink.indexOf("boss.streamos.com")>-1){
		return true;
	} else if(tempLink.indexOf("www.avonex.com")>-1){
		return confirm("You have clicked on a link that will take you out of the TYSABRI.com website");
	} else if(tempLink.indexOf("www.msactivesource.com")>-1){
		return confirm("You have clicked on a link that will take you out of the TYSABRI.com website");
	} else if(tempLink.indexOf("avonex/home")>-1){
		return confirm("You have clicked on a link that will take you out of the TYSABRI.com website");
	} else if(tempLink.indexOf("msas/home")>-1){
		return confirm("You have clicked on a link that will take you out of the TYSABRI.com website");
	} else{
		return confirm("You are leaving TYSABRI.com. This link will take you to a website that is outside the control of Biogen Idec. We provide links as a public service and for informational purposes only. We do not make or imply any endorsement of external web sites.");
	}
}

/**
 * Strange name because Weblogic has its own openPopup method.
 **/
function openDefaultPopup(destination) {
    openPopup(645, 450, destination, 'yes', 'yes');
}

function openPopup(width,height,destination,scrollbars)
{
	openPopup(width,height,destination,scrollbars,"no");
}

function openPopup(width,height,destination,scrollbars,menu)
{
	LeftPosition=(screen.availWidth)?(screen.availWidth-width)/2:50;
	TopPosition=(screen.availHeight)?(screen.availHeight-height)/2:50;
	settings='width='+width+',height='+height+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scrollbars+',location=no,directories=no,status=no,menubar='+menu+',toolbar=yes,resizable=yes';
	Popup = window.open(destination,'popup',settings);
	Popup.focus();
}

/* *
 * Simple method used in a anchor to hide from spiders.
 * */
function hideLink(link){
    window.location = link;
}

function quicklinksgoto(form)
{
	var index = form.QuickLinks.selectedIndex;
	if (form.QuickLinks.options[index].value != "0")
	{
		location=form.QuickLinks.options[index].value;
	}
	//document.QuickLinks.submit();
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_nbGroup(event, grpName) { //v3.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : args[i+1];
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    if ((nbArr = document[grpName]) != null)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = args[i+1];
      nbArr[nbArr.length] = img;
  } }
}