function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;
    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}
//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}
function shiftOpacity(id, millisec) {
    //if an element is invisible, make it visible, else make it ivisible
    if(document.getElementById(id).style.opacity == 0) {
        opacity(id, 0, 100, millisec);
    } else {
        opacity(id, 100, 0, millisec);
    }
}



function blendimage2(divid, imageid, imagefile, millisec) {

    document.getElementById("flashmovie").style.display = "none";
    document.getElementById("blenddiv").style.display = "block";
    document.getElementById("blendimage").style.display = "block";

	
	var speed = Math.round(millisec / 100);
	var timer = 0;
	
	//set the current image as background
	document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")";
	
	//make image transparent
	changeOpac(0, imageid);
	
	//make new image
	document.getElementById(imageid).src = imagefile;

	//fade in image
	for(i = 0; i <= 100; i++) {
		setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
		timer++;
	}
}



function ChangeImageMV(imageid,imgsrc)
{
//alert(imageid);
//alert(imgsrc);
hide();
document.getElementById(imageid).src = imgsrc;
}
function ChangeImageMT()
{
   document.getElementById('imgid').src = 'images/ls_banner/2506PLSBANLife-Sciences-proteomics.jpg';
}
function hide()
{
    //document.getElementById("flashmovie").style.display = "none";
    //document.getElementById("blenddiv").style.display = "block";
    //document.getElementById("blendimage").style.display = "block";
   
}
 function assignJavascriptBio()
{

	blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-Biopharm.jpg', 100)
       
 }

function assignJavascriptLab()
    { 
     blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-Lab.jpg', 100)

    }

	
function assignJavascriptMedical()
{ 
 blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-Medical.jpg', 100)

}
	
function assignJavascriptOEM()
    {
        blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-OEM.jpg', 100)
   }



function assignJavascriptAnimalHealth()
   {
        blendimage2('blenddiv','blendimage','/images/ls_banner/AnimalHealthWebBanner2.jpg', 100)
   }


function hideAll()
{
    //document.getElementById("flashmovie").style.display = "none";
    document.getElementById("blendimage").style.display = "none"; 
}

function assignJavascriptActive()
{
    //hideAll();

    //For BioPharmaLinks

     var blendtime = 100;
	if (document.getElementById('28488') != null)
	{
	document.getElementById('28488').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBAN-API.jpg', blendtime); }
	}
	  //document.getElementById('47366').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-Biopharm.jpg', blendtime); }
	  
	if (document.getElementById('47366') != null)
	{
	  
    document.getElementById('47366').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBAN-Pharmaceutical-QC.jpg', blendtime); }
    }
    
    if (document.getElementById('28486') != null)
    	{
	
    document.getElementById('28486').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-Biopharm.jpg', blendtime); }
    }
    if (document.getElementById('28487') != null)
    	{
	
    document.getElementById('28487').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBAN-Plasma-Fractionation.jpg', blendtime); }
    }
    if (document.getElementById('28489') != null)
    	{
	
    document.getElementById('28489').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-Biopharm.jpg', blendtime); }
    }
    
    if (document.getElementById('36526') != null)
        	{
	
    document.getElementById('36526').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-Biopharm.jpg', blendtime); }
    }
    if (document.getElementById('47367') != null)
        	{
	
    document.getElementById('47367').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBAN-Chromatography-B.jpg', blendtime); }
    }
    if (document.getElementById('47369') != null)
        	{
	
    document.getElementById('47369').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBAN-Clarification-Prefiltration.jpg', blendtime); }
    }
    if (document.getElementById('47371') != null)
        	{
	
    document.getElementById('47371').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-Biopharm.jpg', blendtime); }
    }
    if (document.getElementById('47372') != null)
        	{
	
    document.getElementById('47372').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBAN-Sterile-FIltration-Bioburden.jpg', blendtime); }
    }
    if (document.getElementById('47373') != null)
        	{
	
    document.getElementById('47373').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBAN-Tangential-Flow-Filtration-B.jpg', blendtime); }
    }
    if (document.getElementById('47374') != null)
        	{
	
    document.getElementById('47374').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBAN-Venting-Gas-Filtration-B.jpg', blendtime); }
    }
    if (document.getElementById('47376') != null)
        	{
	
    document.getElementById('47376').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBAN-Viral-Clearance.jpg', blendtime); }
    }


    // ForLabLinks
  

    
if (document.getElementById('1039') != null)
        	{

    document.getElementById('1039').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-ASP.jpg', blendtime); }
}

if (document.getElementById('38513') != null)
        	{
document.getElementById('38513').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-LChromatography.jpg', blendtime); }

} 
if (document.getElementById('1060') != null)
        	{

document.getElementById('1060').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-DrugS.jpg', blendtime); }
}
if (document.getElementById('8049') != null)
        	{

document.getElementById('8049').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-AirQC.jpg', blendtime); }
}
if (document.getElementById('7618') != null)
        	{

document.getElementById('7618').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-EQCWater.jpg', blendtime); }
}
if (document.getElementById('933') != null)
        	{

document.getElementById('933').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-Genomics.jpg', blendtime); }
}
if (document.getElementById('44517') != null)
        	{

document.getElementById('44517').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-Lab-Water.jpg', blendtime); }
}
if (document.getElementById('7489') != null)
        	{

document.getElementById('7489').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-Microbiological.jpg', blendtime); }
}
if (document.getElementById('1003') != null)
        	{

    document.getElementById('1003').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-Proteomics.jpg', blendtime); }
}
if (document.getElementById('1079') != null)
        	{

document.getElementById('1079').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-SciencesL-Sterile-Filtration.jpg', blendtime); }
}
if (document.getElementById('7063') != null)
        	{

document.getElementById('7063').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-Lab-TFF.jpg', blendtime); }
}

if (document.getElementById('1118') != null)
        	{
document.getElementById('1118').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-Lab-Venting.jpg', blendtime); }
}


    //For Medical

if (document.getElementById('6928') != null)
        	{
    document.getElementById('6928').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-anesthesia.jpg', blendtime); }
}
if (document.getElementById('47309') != null)
        	{

document.getElementById('47309').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-Blood-Banking.jpg', blendtime); }
}
if (document.getElementById('38352') != null)
        	{

document.getElementById('38352').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-cell-separation.jpg', blendtime); }
}
if (document.getElementById('38385') != null)
        	{

document.getElementById('38385').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-Cord-Blood.jpg', blendtime); }
}
if (document.getElementById('6923') != null)
        	{

document.getElementById('6923').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-Infusion.jpg', blendtime); }
}
if (document.getElementById('48362') != null)
        	{

document.getElementById('48362').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-Pharmacy.jpg', blendtime); }
}

if (document.getElementById('47391') != null)
        	{
document.getElementById('47391').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-SmokeFilt.jpg', blendtime); }
}
if (document.getElementById('52205') != null)
        	{

document.getElementById('52205').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-water-filtration.jpg', blendtime); }
}    
if (document.getElementById('44611') != null)
        	{

    document.getElementById('44611').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-water-filtration.jpg', blendtime); }
}    
  
    
    //For OEM

if (document.getElementById('38386') != null)
        	{
    document.getElementById('38386').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-blood-collection.jpg', blendtime); }
}
if (document.getElementById('32908') != null)
        	{
document.getElementById('32908').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-Diagnostics.jpg', blendtime); }
}
if (document.getElementById('32909') != null)
        	{
document.getElementById('32909').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-Medical-Liquid.jpg', blendtime); }
}
if (document.getElementById('32913') != null)
        	{
document.getElementById('32913').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-LS-Research.jpg', blendtime); }
}
if (document.getElementById('47605') != null)
        	{
document.getElementById('47605').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-Medical-Liquid.jpg', blendtime); }
}

if (document.getElementById('32910') != null)
        	{
document.getElementById('32910').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/2506PLSBANLife-Sciences-OEM-Venting.jpg', blendtime); }
}   
//For Animal Health 


if (document.getElementById('52744') != null)
        	{

    document.getElementById('52744').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/AnimalHealthWebBanner2.jpg', blendtime); }
}
if (document.getElementById('52691') != null)
        	{

document.getElementById('52691').onmouseover = function() { blendimage2('blenddiv','blendimage','/images/ls_banner/AnimalHealthWebBanner2.jpg', blendtime); }
}



}





function currentOpac(id, opacEnd, millisec) {
    //standard opacity is 100
    var currentOpac = 100;
    
    //if the element has an opacity set, get it
    if(document.getElementById(id).style.opacity < 100) {
        currentOpac = document.getElementById(id).style.opacity * 100;
    }
    //call for the function that changes the opacity
    opacity(id, currentOpac, opacEnd, millisec)
}
function displayFlash()
{
document.getElementById("flashmovie").style.display = "block";
//changeOpac(0,"blendimage");
//changeOpac(0,"blenddiv");

//document.getElementById("blenddiv").style.display = "none";
document.getElementById("blenddiv").style.display = "none";
}
