//FOR ALL POPUPS
function popUp(url,nWidth,nHeight,sResize, sMenu, sWindowName) {

   if (sWindowName == "") {
       sWindowName = "popupwin";
   }

   if (nWidth == "news") {
       nWidth=500;
       nHeight=600;
       sResize="yes";
       sMenu="no";

   } 

   if (nWidth == "press") {
       nWidth=580;
       nHeight=600;
       sResize="yes";
       sMenu="no";

   } else if (nWidth == "alternativewin") {
       nWidth=476;
       nHeight=362;
       sResize="yes";
       sMenu="no";

   } else if (nWidth == "videowin") {
       nWidth=420;
       nHeight=440;
       sResize="yes";
       sMenu="no";

   } else {
       if (nHeight == "") {
           nHeight=400;          }
       if (nWidth == "") {
           nWidth=553;          }
       if (sResize == "" || sResize == "no") {
           sResize = "no";          }
       if (sMenu == "" || sMenu == "no") {
           sMenu = "no";          }
   }              window.open(url,sWindowName,'toolbar='+sMenu+',location='+sMenu+',directories=no,status='+sMenu+',menubar='+sMenu+',scrollbars='+sResize+',resizable='+sResize+',copyhistory=no,width='+nWidth+',height='+nHeight);

}



//FOR "expansion/contraction" EFFECT OF BIO TEXT ON "CLINICAL PROOF" PAGE
function showHideExtended(elID,anchorEl) {
	var obj1 = document.getElementById('showHideExtendedDiv_'+elID);
	var obj2 = document.getElementById('showHideExtendedButtonOpen_'+elID);
	if (obj1) {
		if (obj1.style.display == 'inline') {
			// close
			obj1.style.display = 'none';
			obj2.style.display = 'inline';
			location.href = '#'+anchorEl;
		} else {
			// open
			obj1.style.display = 'inline';
			obj2.style.display = 'none';
		}
	}
}

function showHide(e1) {
	var obj1 = document.getElementById(e1);
	if (obj1) {
		if (obj1.style.display == 'block') {
			obj1.style.display = 'none';
		} else {
			obj1.style.display = 'block';
		}
	}
}



// FOR TOGGLING VISIBLITITY OF DIVS (USED ON SUPPORT HOME FOR PDF LANGUANGE DROPDOWN)
function swapLayers(id) {
  if (cur_lyr) hideLayer(cur_lyr);
  showLayer(id);
  cur_lyr = id;
}

function showLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.display = "block";
}

function hideLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.display = "none";
}

function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
}






//FOR SENDING MAIL ON "CONTACT US" PAGE
function smail(maila) {
    if( maila=='Pharmacy')
        mailw = window.open("/us/poppages/misc/sendmailLocator.aspx","mailw","width=528, height=490, titlebar=no, menubar=no, tollbar=no, location=no, scrollbars=no,status=no, left=300, top=300");
    else
	    	mailw = window.open("/us/poppages/misc/sendmail.aspx?to="+maila,"mailw","width=528, height=490, titlebar=no, menubar=no, tollbar=no, location=no, scrollbars=no,status=no, left=300, top=300");
}

function addLoadEvent(func)
 { 
	var oldonload = window.onload; 
	if (typeof window.onload != 'function')
	{ 
	    window.onload = func; 
	}
	else
	{ 
	    window.onload = function()
		{ 
		      if (oldonload)
			{ 
	        		oldonload(); 
	      		} 
	      		func(); 
	    	} 
	  } 
} 
function validateAgreement()
{
if (!document.forms.testimonial.agree.checked)
			{alert('Please indicate that you are in agreement with our terms and conditions by checking the checkbox provided.')
			document.forms.testimonial.agree.focus()
			return false
		};
if (document.forms.testimonial.agree.checked)
{document.forms.testimonial.submit()}
}