// BULLET ROLLOVERS
// ADD CLASS="IMGOVER" TO IMAGE SRC TAG
// EXAMPLE: <img src="../includes/images/splash/circle_arrow.gif" width="25" height="25" border="0" alt=""  class="imgover" />
 
function initRollovers() {
 if (!document.getElementById) return
 
 var aPreLoad = new Array();
 var sTempSrc;
 var aImages = document.getElementsByTagName('img');
 
 for (var i = 0; i < aImages.length; i++) {  
  if (aImages[i].className == 'imgover') {
   var src = aImages[i].getAttribute('src');
   var ftype = src.substring(src.lastIndexOf('.'), src.length);
   var hsrc = src.replace(ftype, '_o'+ftype);
 
   aImages[i].setAttribute('hsrc', hsrc);
   
   aPreLoad[i] = new Image();
   aPreLoad[i].src = hsrc;
   
   aImages[i].onmouseover = function() {
    sTempSrc = this.getAttribute('src');
    this.setAttribute('src', this.getAttribute('hsrc'));
   } 
   
   aImages[i].onmouseout = function() {
    if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_o'+ftype, ftype);
    this.setAttribute('src', sTempSrc);
   }
  }
 }
}
 
function Test1(imgname,mtype)
{
   Imageobj = document[imgname];
   var src = Imageobj.src;
   var ftype = src.substring(src.lastIndexOf('.'), src.length);
   var hsrc = src.replace(ftype, '_o'+ftype);
   if (mtype == 1)
   {
      Imageobj.src = hsrc; 
   }
   else
   {
       sTempSrc = src.replace('_o'+ftype, ftype);
       Imageobj.src = sTempSrc;
   }
}
 
window.onload = initRollovers;

function openWindow(URL) {
	newWindow=window.open(URL,"newWindow","width=500,height=444,status=no,scrollbars=yes,resizable=yes,location=0,menubar=1,toolbar=no");
	newWindow.focus();
}

function display_link(sPath) {
	window.alert("You are about to link to another site.  Alkermes, Inc. assumes no responsibility for its content.");
	newWindowA = window.open((sPath),"newWindowA","top=2,left=2,width=592,height=400,resizable,scrollbars,location,titlebar,toolbar,statusbar,menubar");
}
function openPDF(URL) {
	PDFWindow=window.open(URL,"PDFWindow","width=600,height=425,status=no,scrollbars=yes,resizable=yes,location=0,menubar=0,toolbar=no");
	PDFWindow.focus();
}
function OpenWin(URL)
{
	newWindow=window.open(URL,"WinOpen","width=572,height=605,scrollbars=1,resizable=no");
	newWindow.focus();
}
function OpenTest(URL)
{
	newWindow=window.open(URL,"WinOpen","width=572,height=633,scrollbars=1,resizable=no");
	newWindow.focus();
}
function display_noprompt(sPath) {
	newWindowA = window.open((sPath),"newWindowA","top=2,left=2,width=592,height=400,resizable,scrollbars,location,titlebar,toolbar,statusbar,menubar");
	newWindowA.focus();
}


function OpenWin2(URL)
{
	window.open(URL,"WinOpen","width=580,height=612,scrollbars=1,resizable=no");
}
 
 
 function PostBackEnter(e) //e is event object passed from function invocation
{ 
	var characterCode; //literal character code will be stored in this variable

	if(e && e.which) //if which property of event object is supported (NN4)
	{
		e = e;
		characterCode = e.which; //character code is contained in NN4's which property
	}else
	{
		e = event;
		characterCode = e.keyCode; //character code is contained in IE's keyCode property
	}

	if(characterCode == 13) //if generated character code is equal to ascii 13 (if enter key)
	{							
		return true;
	}else
	{					
		return false;
	}

}

function FormFieldFocus()
{
	focusedFormControl = '';

//	if (document.getElementsByTagName) onload = function () {
		var e, i = 0;
		while (e = document.getElementsByTagName ('INPUT')[i++]) {			
			if (e.type == 'text' || e.type == 'radio' || e.type == 'checkbox' || e.type == 'password')
			{ 		
				
					e.onfocus = function () {focusedFormControl = this;}		
			}
		}
		
		while (e = document.getElementsByTagName ('TEXTAREA')[i++]) {			
					e.onfocus = function () {focusedFormControl = '';}	
			
		}
//	}

}

function openCallOut(URL) {
	newWindow=window.open(URL,"newWindow","width=724,height=339,status=no,scrollbars=no,resizable=yes,location=0,menubar=0,toolbar=no");
	newWindow.focus();
}


function PatCallOut()
{
openCallOut('/callout/callOut.aspx')
}

function HCPCallOut()
{
openCallOut('/callout/callOut.aspx')
}
