// Flash Version Detector  v1.2.1
// documentation: http://www.dithered.com/javascript/flash_detect/index.html
// license: http://creativecommons.org/licenses/by/1.0/
// code by Chris Nott (chris[at]dithered[dot]com)
// with VBScript code from Alastair Hamilton (now somewhat modified)

/*Added by Wipro for Primary Navigation Links*/
function activePrmLink() {
	var winLoc = window.location.href;
	var folderName = "html/"; // word appears before section folder name in URL
	var folderLgt = folderName.length;
	var index = winLoc.indexOf(folderName);
	var lastIndex = winLoc.lastIndexOf("/");
	var getVal = winLoc.slice(index+folderLgt, lastIndex);
	var docElement = document.getElementById(getVal).firstChild;
	docElement.style.backgroundImage = "url(/images/activeLink-arrow.gif)";
	docElement.style.backgroundRepeat = "no-repeat";
	docElement.style.backgroundPosition = "left center";
	docElement.style.color = "#f55a1c";
	/* added for header images */
	var lstIndexDot = winLoc.lastIndexOf(".");
	var lstIndexSlash = winLoc.lastIndexOf("/");
	var getValPage = winLoc.slice(lstIndexSlash+1, lstIndexDot);
	var imageName = 'url(/images/header-'+getVal+'.jpg)';
	var imageNameSub = 'url(/images/header-'+getValPage+'.jpg)';
	var gvsLngt = getValPage.slice(0,5);
	if (gvsLngt != "index") {
			document.getElementById('flash-pict').style.backgroundImage = imageName;	}
	else {
			document.getElementById('flash-pict').style.backgroundImage = url();
	}
	if (getVal == "medicines" ){
		if (gvsLngt != "index") {
			document.getElementById('flash-pict').style.backgroundImage = imageNameSub;
		}
		else {
			document.getElementById('flash-pict').style.backgroundImage = url();
		}
	}
}
/*Added by Wipro for Left Navigation Links*/
function activeLeftLink(param, menuID1, menuID2, menuID3 ) {
	var linkID = param;
	if (linkID.length == "9") {
		// for Second level
		var docElemtLink = document.getElementById(linkID);
		//The following if/else logic has been added to solve the problem with external links: they should not be highlighted when clicked and active
		//sice they link to an external page
		if(docElemtLink.className == "externalLinkUnActive")
		{
			docElemtLink.className = "externalLinkActive";

		}
		else {	
			docElemtLink.className = "inActive";
		}
		var subMenu = document.getElementById(menuID1);
		subMenu.className = "displayON";
	}
	
	if (linkID.length == "12") {
		// for second level link
		var docPrntID = param.slice("0", param.lastIndexOf("-"));
		var docPrntLink = document.getElementById(docPrntID);
		docPrntLink.className = "inActive";
		var subMenu = document.getElementById(menuID1);
		subMenu.className = "displayON";
		// for Third level link
		var docElemtLink = document.getElementById(linkID);
		docElemtLink.className = "inActive";
		var subMenu2 = document.getElementById(menuID2);
		subMenu2.className = "displayON";		
	}
	
	
	else if (linkID.length == "15") {
		// for second level link
		var docPrntID1 = param.slice("0", param.indexOf("-"));
		var docPrntLink1 = document.getElementById(docPrntID1);
		docPrntLink1.className = "inActive";
		var subMenu = document.getElementById(menuID1);
		subMenu.className = "displayON";
		// for Third level link
		var docPrntID = param.slice("0", param.lastIndexOf("-"));
		var docPrntLink = document.getElementById(docPrntID);
		docPrntLink.className = "inActive";
		var subMenu = document.getElementById(menuID2);
		subMenu.className = "displayON";
		// for Fourth level link
		var docElemtLink = document.getElementById(linkID);
		docElemtLink.className = "inActive";
		
	}
	else if (linkID.length == "18") {
		// for second level link
		var docPrntID1 = param.slice("0", param.indexOf("-"));
		var docPrntLink1 = document.getElementById(docPrntID1);
		docPrntLink1.className = "inActive";
		var subMenu = document.getElementById(menuID1);
		subMenu.className = "displayON";
		// for Third level link
		var docPrntID = param.slice("0", param.lastIndexOf("-")-3);
		var docPrntLink = document.getElementById(docPrntID);
		docPrntLink.className = "inActive";
		var subMenu = document.getElementById(menuID2);
		subMenu.className = "displayON";
		// for Fourth level link
		var docPrntID = param.slice("0", param.lastIndexOf("-"));
		var docPrntLink = document.getElementById(docPrntID);
		docPrntLink.className = "inActive";
		var subMenu = document.getElementById(menuID3);
		subMenu.className = "displayON";
		// for Fifth level link
		var docElemtLink = document.getElementById(linkID);
		docElemtLink.className = "inActive";
		
	}
	
}

<!-- Showing and hidding data values -- !>

function isDefined(property) {
  return (typeof property != 'undefined');
}

var flashVersion = 0;
function getFlashVersion() {
var latestFlashVersion = 8;
   var agent = navigator.userAgent.toLowerCase(); 
	
   // NS3 needs flashVersion to be a local variable
   if (agent.indexOf("mozilla/3") != -1 && agent.indexOf("msie") == -1) {
      flashVersion = 0;
   }
   
	// NS3+, Opera3+, IE5+ Mac (support plugin array):  check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		var flashPlugin = navigator.plugins['Shockwave Flash'];
		if (typeof flashPlugin == 'object') { 
			for (var i = latestFlashVersion; i >= 3; i--) {
            if (flashPlugin.description.indexOf(i + '.') != -1) {
               flashVersion = i;
               break;
            }
         }
		}
	}

	// IE4+ Win32:  attempt to create an ActiveX object using VBScript
	else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1 && agent.indexOf("16bit")==-1) {
	   var doc = '<scr' + 'ipt language="VBScript"\> \n';
      doc += 'On Error Resume Next \n';
      doc += 'Dim obFlash \n';
      doc += 'For i = ' + latestFlashVersion + ' To 3 Step -1 \n';
      doc += '   Set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash." & i) \n';
      doc += '   If IsObject(obFlash) Then \n';
      doc += '      flashVersion = i \n';
      doc += '      Exit For \n';
      doc += '   End If \n';
      doc += 'Next \n';
      doc += '</scr' + 'ipt\> \n';
      document.write(doc);
   }
		
	// WebTV 2.5 supports flash 3
	else if (agent.indexOf("webtv/2.5") != -1) flashVersion = 3;

	// older WebTV supports flash 2
	else if (agent.indexOf("webtv") != -1) flashVersion = 2;

	// Can't detect in all other cases
	else {
		flashVersion = flashVersion_DONTKNOW;
	}

	return flashVersion;
}

flashVersion_DONTKNOW = -1;


var agt= navigator.userAgent.toLowerCase();

var noflashText=new Array() //Heading and text for non flash banners
noflashText[0]="<h1>One in a million</h1>	<p>Researchers may screen more than a million possibilities to find </br>just one promising new drug. </p>" 
noflashText[1]="<h1>An ounce of prevention</h1>	<p>She'll never remember the shots.<br/>He'll never forget the diseases.</p>"
noflashText[2]="<h1>A helping hand</h1>	<p>Every day, we donate more than $1 millionworth of medicines  <br/>to patients in need in the USand around the world.</p>"
noflashText[3]="<h1>Our community</h1>	<p>For more than 20 years, we've given school childrena hands-on <br/> experience into the world of science;it's just one of our many <br/>community programs.</p>"
noflashText[4]="<h1>One in a million</h1>	<p>Researchers may screen more than a million possibilities to find </br>just one promising new drug. </p>"

var noflashLink=new Array() //Links for non flash banners
noflashLink[0]="../research/index.html"
noflashLink[1]="../medicines/medicines-vaccines.html"
noflashLink[2]="../healthcare/healthcare-prescription.html"
noflashLink[3]="../community/index.html"
noflashLink[4]="../research/index.html"


function FlashTag(p_Section, p_flash, p_height, p_txtsize, p_txtalt,p_link,p_Newimg){
	if (!p_flash || getFlashVersion() < 5){
		
			if (p_Newimg !=""){
				if (p_height =="258"){
					
					document.write('<div id="txt-top-noflash">'+ noflashText[flashBg-1] +'</div>');
					document.write('<div id="'+ p_txtsize +'"><a href="'+ noflashLink[flashBg-1] +'" class="white"><img src="../../images/arrow-find.gif" alt="" border="0">Find out more</a></div>');
					document.write('<img src="../../images/0' + flashBg + '_01.jpg" border="0" alt="' + noflashText[flashBg-1] + '" width="760" height="'+ p_height+'">'); 
				}
				else{
					document.write('<div id="'+ p_txtsize +'"><a href="'+ p_link +'"><img src="../../common/img/'+ p_Section +'/txt-'+ p_Section +'-small.gif" border="0" alt="'+ p_txtalt +'"></a></div>'); 
					document.write('<img src="../../common/img/'+ p_Section +'/v-'+ p_Newimg +'-small.jpg" border="0" alt="" width="760" height="'+ p_height+'">'); 
				}
			}
			else {
				if (p_height =="258" ){
					document.write('<img src="../../images/banner/0' + flashBg + '_01.jpg" border="0" alt="" width="760" height="'+ p_height+'">');  
				}
				else{
					document.write('<img src="../../common/img/'+ p_Section +'/v-'+ p_Section +'-small.jpg" border="0" alt="" width="760" height="'+ p_height+'">'); 
				}
			}
	}
	else {
		if(agt.indexOf("safari")!=-1)  {
		 
			if (p_height =="258"){
				document.write('<div id="txt-top-noflash">'+ noflashText[flashBg-1] +'</div>');
				document.write('<div id="'+ p_txtsize +'"><a href="'+ noflashLink[flashBg-1] +'" class="white"><img src="../../images/arrow-findout.gif" alt=""> Find out more</a></div>');
				document.write('<img src="../../images/0' + flashBg + '_01.jpg" border="0" alt="' + noflashText[flashBg-1] + '" width="760" height="'+ p_height+'">'); 
			}
			else{
			document.write('<img src="../../common/img/'+ p_Section +'/v-'+ p_Section +'-small.jpg" border="0" alt="" width="760" height="'+ p_height+'">'); 
			}
		}
		else if((agt.indexOf("msie")!=-1) && (navigator.userAgent.indexOf("Mac") != -1)) {
			if (p_height =="257"){
			document.write('<div id="txt-top-noflash">'+ noflashText[flashBg-1] +'</div>');
			document.write('<div id="'+ p_txtsize +'"><a href="'+ noflashLink[flashBg-1] +'" class="white"><img src="../../images/arrow-find.gif" alt=""> Find out more</a></div>');  
			document.write('<img src="../../images/0' + flashBg + '_01.jpg" border="0" alt="' + noflashText[flashBg-1] + '" width="760" height="'+ p_height+'">'); 
			}
			else{
			document.write('<img src="../../common/img/'+ p_Section +'/v-'+ p_Section +'-small.jpg" border="0" alt="" width="760" height="'+ p_height+'">'); 
			}
		}
		else {
			var el=document.getElementById('flashObj'); 
			el.className ="flashBack"+flashBg;
			document.write('<object type="application/x-shockwave-flash" data="../../homePage-us-landingpages.swf?Id='+ (flashBg - 1) +'" width="760" height="259">');
			document.write('<param name="movie" value="../../homePage-us-landingpages.swf?Id='+ (flashBg - 1) +'" />');
			document.write('<param name="allowScriptAccess" value="sameDomain" />');
			document.write('<param name="wmode" value="transparent" />');
			document.write('<embed src="../../homePage-us-landingpages.swf?Id='+ (flashBg - 1) +'" quality="high" wmode="transparent" bgcolor="#ffffff" width="760" height="259" name="homePage" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
			document.write(' </object>');			
		   }
			
	   } 
	 
}



	
/*  TABLE     display: block;*/

var height;
var Category;
function displaySwapShow(p_id, p_class){
	if(document.getElementById(p_id)!='undefined'&&document.getElementById(p_id)!=null){

		document.getElementById(p_id).style.display = 'block'
	
		
		if (height =="280"){
		document.getElementById(p_class).className ="hmenu-table-off";
		}
		else{
			document.getElementById(p_class).className ="menu-table-off";
			
		}

		if (Category =="utilities") {
		 document.getElementById(p_class).className ="menu-contact-table-off";
		}

	}
}	

function displaySwapHidden(p_id, p_class)
{
	if(document.getElementById(p_id)!='undefined'&&document.getElementById(p_id)!=null)
	{
		document.getElementById(p_id).style.display = 'none' 
		if (height =="280"){
		document.getElementById(p_class).className ="hmenu-table";
		}
		else{
		document.getElementById(p_class).className ="menu-table";
		
		}
		if (Category =="utilities") {
		 document.getElementById(p_class).className ="menu-contact-table";
		}	
		
	}
}

function displayShow(p_id) {

		 document.getElementById(p_id).style.display = 'block';
}
function displayHidden(p_id) {

			document.getElementById(p_id).style.display = 'none';
}


				
function swapIt(hide,show) {
    show.style.display = "";
    hide.style.display = "none";
  }


/* END TABLE     display: block;*/	

/*

				Drop down

*/

function dropdown(mySel){
var myWin, myVal;
myVal = mySel.options[mySel.selectedIndex].value;
	if(myVal){
			if(mySel.form.target)myWin = parent[mySel.form.target];
			
			else myWin = window;
			
			if (! myWin) return true;
			myWin.location = myVal;
	   }
return false;
}
function dropdownTarget(mySel){
var myWin, myVal;

myVal = mySel.options[mySel.selectedIndex].value;
	if(myVal){
			if(mySel.form.target)myWin = parent[mySel.form.target];
			
			else myWin = window;
			if (! myWin) return true;
		 	if (myVal.charAt(0)=="/")
				{
					 myWin.location = myVal;
				}
				else
				{

					myWin.open(myVal);
				}
			
			
	   }
return false;
}


/*

				OPEN WINDOW

*/

function DW1(dwURL) {
popupWin = window.open(dwURL, 'DW1', 'scrollbars,resizable=yes,width=700,height=600,left=25,top=25');
window.top.name = 'opener';
}
function DW(dwURL) {
popupWin = window.open(dwURL, 'DW', 'scrollbars,resizable=yes,width=517,height=400,left=25,top=25');
window.top.name = 'opener';
}
function DW2(dwURL) {
popupWin = window.open(dwURL, 'DW', 'scrollbars,resizable=yes,width=433,height=400,left=25,top=25');
window.top.name = 'opener';
}
function DW4(dwURL) {
popupWin = window.open(dwURL, 'DW', 'scrollbars,resizable=yes,width=560,height=370,left=25,top=25');
window.top.name = 'opener';
}
function DW5(dwURL) {
popupWin = window.open(dwURL, 'DW', 'scrollbars,resizable=yes,width=587,height=370,left=25,top=25');
window.top.name = 'opener';
}
function DW6(dwURL) {
popupWin = window.open(dwURL, 'DW', 'scrollbars,resizable=yes,width=587,height=570,left=25,top=25');
window.top.name = 'opener';
}
function DW8(dwURL) {
popupWin = window.open(dwURL, 'DW8', 'resizable=no,width=400,height=590,left=25,top=25');
window.top.name = 'opener';
}
function DW9(dwURL) {
popupWin = window.open(dwURL, 'DW9', 'resizable=no,width=330,height=450,left=25,top=25');
window.top.name = 'opener';
}


function Present(dwURL) {
popupWin = window.open(dwURL, 'DW', 'scrollbars,resizable=yes,width=805,height=450,left=25,top=25');
window.top.name = 'opener';
}
function Present2(dwURL) {
popupWin = window.open(dwURL, 'DW', 'scrollbars,resizable=yes,width=790,height=593,left=25,top=25');
window.top.name = 'opener';
}
function External(dwURL) {
popupWin = window.open(dwURL, 'DW1', 'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=700,height=600,left=25,top=25');
window.top.name = 'opener';
}



//legacy script - used everywhere except careers
function DW1(dwURL) {
popupWin = window.open(dwURL, 'DW1', 'scrollbars,resizable=yes,width=700,height=600,left=25,top=25');
window.top.name = 'opener';
}
//used in careers - updated as it clashed with earlier version of DW1 used in the about section
function DWjoin(dwURL) {
popupWin = window.open(dwURL, 'DWjoin', 'scrollbars,resizable=yes,width=600,height=550,left=25,top=25');
window.top.name = 'opener';
}

function DWUS(dwURL) {
popupWin = window.open(dwURL, 'DWUS', 'scrollbars,resizable=yes,width=575,height=500,left=25,top=25');
window.top.name = 'opener';
}


function MM_jumpMenu(targ,selObj,restore){ //v3.0
var loc = "http://"+selObj.options[selObj.selectedIndex].value;
if(loc.length > 9)
	window.location=loc;
}

function Profile(dwURL) {
popupWin = window.open(dwURL, 'DW', 'scrollbars,resizable=yes,width=667,height=450,left=25,top=25');
window.top.name = 'opener';
}

function Hemscott(dwURL) {
popupWin = window.open(dwURL, 'DW', 'scrollbars,resizable=yes,width=667,height=450,left=25,top=25');
window.top.name = 'opener';
}
//used in the products section mainly
function openProducts(dwURL) {
  products = window.open(dwURL, 'products', 'scrollbars,resizable=yes,width=520,height=400,left=25,top=25');
  window.top.name = 'opener';
}

function Profilebig(dwURL) {
popupWin = window.open(dwURL, 'DW', 'scrollbars,resizable=yes,width=800,height=700,left=25,top=25');
window.top.name = 'opener';
}

function PCbig(dwURL) {
popupWin = window.open(dwURL, 'DW', 'scrollbars,resizable=yes,width=882,height=600,left=25,top=25');
window.top.name = 'opener';
}

function chartinfo(dwURL) {
popupWin = window.open(dwURL, 'DW', 'scrollbars,resizable=yes,width=300,height=200');
window.top.name = 'opener';
}
//Used for flash content in Your Health
function healthflash(dwURL) {
popupWin = window.open(dwURL, 'DW', 'resizable=yes,width=585,height=445,left=25,top=25');
window.top.name = 'opener';
}

function doSearch() {
  document.forms[1].submit();
}
function display_search() {
  if (navigator.appName == "Netscape") { 
    document.write("<input type=text name=Search size=8 maxlength=50>");
  }
  else { 
    document.write("<input type=text name=Search size=14 maxlength=50>");
  }
}

//About us/background/history flash file/ Function written for calling from the flash movie. It turns all divs off besides the one requested.
function displayHideOthers(p_id) {

		 document.getElementById('1700').style.display = 'none';
		 document.getElementById('1800').style.display = 'none';
		 document.getElementById('1850').style.display = 'none';
 		 document.getElementById('1900').style.display = 'none';				 		 
 		 document.getElementById('1950').style.display = 'none';
		 document.getElementById('2000').style.display = 'none';		 
		 document.getElementById(p_id).style.display = 'block';
}


//Community/default page/Function written for calling from the flash movie. It turns all divs off besides the one requested.
function displayPartnership(p_id) {

		 document.getElementById('prog0').style.display = 'none';
		 document.getElementById('prog1').style.display = 'none';
		 document.getElementById('prog2').style.display = 'none';
		 document.getElementById('prog3').style.display = 'none';
 		 document.getElementById('prog4').style.display = 'none';				 		 
 		 document.getElementById('prog5').style.display = 'none';
		 document.getElementById('prog6').style.display = 'none';
		 document.getElementById('prog7').style.display = 'none';
		 document.getElementById('prog8').style.display = 'none';
		 document.getElementById('prog9').style.display = 'none';
 		 document.getElementById('prog10').style.display = 'none';				 		 
 		 document.getElementById('prog11').style.display = 'none';
		 document.getElementById('prog12').style.display = 'none';	
		 document.getElementById(p_id).style.display = 'block';		 

}

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_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_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function createObj(id) {
	var winLoc = window.location.href;
	var folderName = "html/"; // word appears before section folder name in URL
	var folderLgt = folderName.length;
	var index = winLoc.indexOf(folderName);
	var lastIndex = winLoc.lastIndexOf("/");
	var getVal = winLoc.slice(index+folderLgt, lastIndex);
	document.getElementById(id).innerHTML = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='100%' height='100%' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab' id='flashPlayer'> <param name='movie' value='../../video-player/playerforEDS.swf' /> <param name='menu' value='false' /> <param name='quality' value='high' /> <param name='scale' value='noscale' /> <param name='salign' value='rt' /> <param name='bgcolor' value='#ffffff' /> <param name='flashVars' value='xmlPath=../../video-player/data/data-landing-advair.xml' />	<param name='wmode' value='transparent' />	<param name='allowScriptAccess' value='always' /> <embed src='../../video-player/playerforEDS.swf' menu='false' quality='high' scale='noscale' salign='rt' bgcolor='#ffffff' width='100%' height='100%' name='flashPlayer' align='middle' play='true' loop='false' quality='high' allowScriptAccess='always' flashVars='xmlPath=../../video-player/data/data-landing-advair.xml' type='application/x-shockwave-flash' wmode='transparent' swLiveConnect='true' pluginspage='http://www.macromedia.com/go/getflashplayer'> </embed> </object>"
} 

function createObjInner(id) {
	var winLoc = window.location.href;
	var folderName = "html/"; // word appears before section folder name in URL
	var folderLgt = folderName.length;
	var index = winLoc.indexOf(folderName);
	var lastIndex = winLoc.lastIndexOf("/");
	var getVal = winLoc.slice(index+folderLgt, lastIndex);
	var lstIndexDot = winLoc.lastIndexOf(".");
	var lstIndexSlash = winLoc.lastIndexOf("/");
	var getValPage = winLoc.slice(lstIndexSlash+1, lstIndexDot);
	
	if (getValPage == "healthcare-hiv-aids"){
	document.getElementById(id).innerHTML = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='100%' height='100%' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab' id='flashPlayer'> <param name='movie' value='../../video-player/TertiaryPlayer.swf' /> <param name='menu' value='false' /> <param name='SALIGN' value='RT' /> <param name='quality' value='high' /> <param name='scale' value='noscale' /> <param name='salign' value='rt' /> <param name='bgcolor' value='#ffffff' /> <param name='flashVars' value='xmlPath=../../video-player/data/data-community1.xml' />	<param name='wmode' value='transparent' />	<param name='allowScriptAccess' value='always' /> <embed src='../../video-player/TertiaryPlayer.swf' menu='false' quality='high' scale='noscale' salign='rt' bgcolor='#ffffff' width='100%' height='100%' name='flashPlayer' align='middle' play='true' loop='false' quality='high' allowScriptAccess='always' flashVars='xmlPath=../../video-player/data/data-community1.xml' type='application/x-shockwave-flash' wmode='transparent' swLiveConnect='true' pluginspage='http://www.macromedia.com/go/getflashplayer'> </embed> </object>"
	
	}
	else {
	document.getElementById(id).innerHTML = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='100%' height='100%' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab' id='flashPlayer'> <param name='movie' value='../../video-player/TertiaryPlayer.swf' /> <param name='menu' value='false' /> <param name='SALIGN' value='RT' /> <param name='quality' value='high' /> <param name='scale' value='noscale' /> <param name='salign' value='rt' /> <param name='bgcolor' value='#ffffff' /> <param name='flashVars' value='xmlPath=../../video-player/data/data-landing-advair.xml' />	<param name='wmode' value='transparent' />	<param name='allowScriptAccess' value='always' /> <embed src='../../video-player/TertiaryPlayer.swf' menu='false' quality='high' scale='noscale' salign='rt' bgcolor='#ffffff' width='100%' height='100%' name='flashPlayer' align='middle' play='true' loop='false' quality='high' allowScriptAccess='always' flashVars='xmlPath=../../video-player/data/data-landing-advair.xml' type='application/x-shockwave-flash' wmode='transparent' swLiveConnect='true' pluginspage='http://www.macromedia.com/go/getflashplayer'> </embed> </object>"
	}
	
	
}


function createObjVL(id) {
	var winLoc = window.location.href;
	var folderName = "html/"; // word appears before section folder name in URL
	var folderLgt = folderName.length;
	var index = winLoc.indexOf(folderName);
	var lastIndex = winLoc.lastIndexOf("/");
	var getVal = winLoc.slice(index+folderLgt, lastIndex);
	
	var lstIndexDot = winLoc.lastIndexOf(".");
	var lstIndexSlash = winLoc.lastIndexOf("/");
	var getValPage = winLoc.slice(lstIndexSlash+1, lstIndexDot);

	document.getElementById(id).innerHTML = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='100%' height='100%' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab' id='flashPlayer'> <param name='movie' value='../../video-player/playerforEDS.swf' /> <param name='menu' value='false' /> <param name='quality' value='high' /> <param name='scale' value='noscale' /> <param name='salign' value='rt' /> <param name='bgcolor' value='#ffffff' /> <param name='flashVars' value='xmlPath=../../video-player/data/data-landing-"+getVal+"-"+getValPage+".xml' />	<param name='wmode' value='transparent' />	<param name='allowScriptAccess' value='always' /> <embed src='../../video-player/playerforEDS.swf' menu='false' quality='high' scale='noscale' salign='rt' bgcolor='#ffffff' width='100%' height='100%' name='flashPlayer' align='middle' play='true' loop='false' quality='high' allowScriptAccess='always' flashVars='xmlPath=../../video-player/data/data-landing-"+getVal+"-"+getValPage+".xml' type='application/x-shockwave-flash' wmode='transparent' swLiveConnect='true' pluginspage='http://www.macromedia.com/go/getflashplayer'> </embed> </object>"
} 



/*For condition dropdown in Our Medicines and Product section */
function showCondition (obj) {
		var q = obj.options[obj.selectedIndex].value;
		document.getElementById("mainCondition").style.display = "none";
		for (i=2; i<=obj.length; i++){
			d = obj.options[i].value;
			document.getElementById(d).style.display = "none";
			document.getElementById(q).style.display = "block";
		}
		
	
}



	function goToSearchStoresPage()	{
		
		if(document.getElementById('originatingJspName').value == 'indexJsp')	{
			document.getElementById('quicklinks').submit();
		}
		
		if(document.getElementById('originatingJspName').value == 'searchStoresJsp')	{
			document.getElementById('methodName').value='goToSearchStoresPageDefault';
			document.getElementById('searchStoresStrutsHtmlForm').action='GoToSearchStoresPage.do';
			document.getElementById('searchStoresStrutsHtmlForm').submit();		
		}
		
		if(document.getElementById('originatingJspName').value == 'searchResultsJsp')	{
			document.getElementById('methodName').value='goToSearchStoresPageDefault';
			document.getElementById('searchResultsStrutsHtmlForm').action='GoToSearchStoresPage.do';			
			document.getElementById('searchResultsStrutsHtmlForm').submit();
		}		
	}
	
  	function goToSearchStoresPageNGetProductList(){
	  	
	  	document.getElementById('methodName').value='goToSearchStoresPageNGetProductList';
		
		if(document.getElementById('originatingJspName').value == 'searchStoresJsp')	{
		
			document.getElementById('searchStoresStrutsHtmlForm').action='GoToSearchStoresPage.do';
			document.getElementById('searchStoresStrutsHtmlForm').submit();		
		}
		else if(document.getElementById('originatingJspName').value == 'searchResultsJsp')	{
			document.getElementById('searchResultsStrutsHtmlForm').action='GoToSearchStoresPage.do';
			document.getElementById('searchResultsStrutsHtmlForm').submit();
		}		
 	}
 	
  	function searchStores(){
		document.getElementById('methodName').value='searchStores';
		document.getElementById('searchStoresStrutsHtmlForm').submit();
 	}
	
/*Added by Julie Wallen Sept 11 2007 for IMC survey*/
function createCookie(name,value,days) {
 if (days) {
  var date = new Date();
  date.setTime(date.getTime()+(days*24*60*60*1000));
  var expires = "; expires="+date.toGMTString();
 }
 else var expires = "";
 document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
 var nameEQ = name + "=";
 var ca = document.cookie.split(';');
 for(var i=0;i < ca.length;i++) {
  var c = ca[i];
  while (c.charAt(0)==' ') 
  {c = c.substring(1,c.length);
  }
  if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
 }
 return null;
}

function rand_sur()
{
 var nth = 3; 
 
   var chk = readCookie('gsk_cookie');

   var rnd = Math.floor(Math.random() * nth) + 1;
/*  if (rnd == nth) 
  { 
        if (chk == '' || chk == null)
      {
    createCookie('gsk_cookie','survey_cookie',7);
    location.href = 'http://surveyor.imc2.com/ss/wsb.dll/external/GSK_1.htm';
      }
  }*/
}

/* Added by WIPRO for handling the tabs in the product and medicines page 26 Sep 2007  */

	function  displayPrescriptionsTab() {

		//redirect to the medicines page when this function is called from other pages.
		if (document.location.pathname != "/html/medicines/index.html") {
			document.location.href = "http://"+location.hostname+"/html/medicines/index.html#prescriptions";
			
		}

		//Swap the main tabs
		displaySwapShow('Table1','menu-table1');
		displaySwapHidden('Table2','menu-table2');
		displaySwapHidden('Table3','menu-table3');
		displaySwapHidden('Table4','menu-table4');

		//Handle the left navigation links
		document.getElementById("leftnav01").className ="inActive";
		document.getElementById("leftnav02").className ="unActive";
		document.getElementById("leftnav03").className ="unActive";

		//Swap the include files in the right pane
              document.getElementById("vaccines-panel").style.display="none";
		document.getElementById("overthecounter-panel").style.display="none";
	       document.getElementById("prescriptions-panel").style.display="block";
		
	}
	function  displayVaccinesTab() {

		//redirect to the medicines page when this function is called from other pages.
		if (document.location.pathname != "/html/medicines/index.html") {
			document.location.href = "http://"+location.hostname+"/html/medicines/index.html#vaccines";
		}

		//Swap the main tabs
		displaySwapShow('Table2','menu-table2');
		displaySwapHidden('Table1','menu-table1');
		displaySwapHidden('Table3','menu-table3');
		displaySwapHidden('Table4','menu-table4');

		//Handle the left navigation links
		document.getElementById("leftnav01").className ="unActive";
		document.getElementById("leftnav02").className ="inActive";
		document.getElementById("leftnav03").className ="unActive";

		//Swap the include files in the right pane
              document.getElementById("vaccines-panel").style.display="block";
		document.getElementById("overthecounter-panel").style.display="none";
	       document.getElementById("prescriptions-panel").style.display="none";

	}

	function  displayOverTheCounterTab() {

		//redirect to the medicines page when this function is called from other pages.
		if (document.location.pathname != "/html/medicines/index.html") {
			document.location.href = "http://"+location.hostname+"/html/medicines/index.html#over_the_counter";
		}

		//Swap the main tabs
		displaySwapShow('Table3','menu-table3');
		displaySwapHidden('Table1','menu-table1');
		displaySwapHidden('Table2','menu-table2');
		displaySwapHidden('Table4','menu-table4');

		//Handle the left navigation links
		document.getElementById("leftnav01").className ="unActive";
		document.getElementById("leftnav02").className ="unActive";
		document.getElementById("leftnav03").className ="inActive";

		//Swap the include files in the right pane
	       document.getElementById("vaccines-panel").style.display="none";
		document.getElementById("overthecounter-panel").style.display="block";
	       document.getElementById("prescriptions-panel").style.display="none";

	}
/* END of functions for medicines and products tabs */


