// JScript File

//var ua = navigator.userAgent.toLowerCase(); 
//this.ua= ua;
//this.isIE        = ( (ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1) ); 
//this.versionMinor = parseFloat(navigator.appVersion); 
//if (this.isIE && this.versionMinor >= 4) {
//	    document.write ("<style>")
//	    document.write ("#sanofiLeft {filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+window.root+"images/sanofiTop_left.png',sizingMethod='scale'); width:15px; height:29px; position:relative; background-repeat:repeat-x; top:35px;}") 
//	    document.write ("#sanofiLogo {filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+window.root+"images/sanofiTop.png',sizingMethod='scale'); width:771px; height:59px; position:relative; top:35px;}") 
//	    document.write ("#sanofiRight {filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+window.root+"images/sanofiTop_right.png',sizingMethod='scale'); height:29px; position:relative; top:35px;}")
//	    //document.write ("#solostar_homeback {filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+window.root+"images/solostar_homeback.png',sizingMethod='scale'); background-repeat:no-repeat; margin:12px 0 0 0; padding:2px 10px 0 190px; width:104px; font-size:13px; text-align:right; height:200px;}")
//	    document.write ("</style>")
//}           

//else{
//	    document.write ("<style>")
//	    document.write ("#sanofiLeft { background-image:url("+window.root+"images/sanofiTop_left.png); width:15px; height:29px; background-repeat:repeat-x; position:relative; background-repeat:repeat-x; top:35px;}") 
//	    document.write ("#sanofiLogo { background-image:url("+window.root+"images/sanofiTop.png);background-repeat:no-repeat; width:771px; height:59px; position:relative; top:35px; margin-left:auto; margin-right:auto;}") 
//	    document.write ("#sanofiRight { background-image:url("+window.root+"images/sanofiTop_right.png); height:29px; background-repeat:repeat-x; position:relative; top:35px;}") 
//	    //document.write ("#solostar_homeback { background-image:url("+window.root+"images/solostar_homeback.png); background-repeat:no-repeat; margin:12px 0 0 0; width:104px; font-size:13px; text-align:right; padding:2px 10px 0 190px; height:200px;}") 
//	    document.write ("</style>")
//}          
     
// ------------------------------

function openWin( windowURL, windowName, windowFeatures) {
     winhandle = window.open( windowURL, windowName, windowFeatures ) ;
	 try {
	 	winhandle.focus();
	}
	catch(err) {
		alert("To view this information, please disable your popup blocker or add www.lantus.com to your safe list");
	}
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function showISI() {
	MM_showHideLayers('divFlash','','show')
 	window.document.aravaScroller_Consumer.Play();
}
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_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 showHideAllLayers() {
    MM_showHideLayers('homeimagetext','','show');
    MM_showHideLayers('opticlikpromo','','show');
    MM_showHideLayers('lantusprogrampromo','','show');
    MM_showHideLayers('learnaboutpromo','','show');
    MM_showHideLayers('rightdosepromo','','show');
    MM_showHideLayers('landingimagetext','','show');
	
	MM_showHideLayers('introtext','','show');
    MM_showHideLayers('promotier','','show');
    //MM_showHideLayers('learnaboutpromo','','show');
	//MM_showHideLayers('lantusprogrampromo','','show');

	//MM_showHideLayers('introtext','','show');
	//MM_showHideLayers('lantusprogrampromo','','show');
	//MM_showHideLayers('learnaboutpromo','','show');
	//MM_showHideLayers('rightdosepromo','','show');
}

function change(id, newClass) {
identity=document.getElementById(id);
identity.className=newClass;
}

// flash control

function getFlashMovieObject(movieName)
{
  if (window.document[movieName]) 
  {
      return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }
}



function validateSearchForm(searchTerm)
{
    var valid = true;
    if (document.getElementById(searchTerm).value == "Enter search term" || 
    document.getElementById(searchTerm).value.length == 0 ) {
 	    window.alert ("Please enter a search text.");
  		valid = false;
 	}
 	else
 	{
 	    var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?";
 		for (var i = 0; i < document.getElementById(searchTerm).value.length; i++) {
  		    if (iChars.indexOf(document.getElementById(searchTerm).value.charAt(i)) != -1) {
  			    window.alert ("Your search text has special characters. \nThese are not allowed.\nPlease remove them and try again.");
  			    valid = false;
  			    break;
  	        }
        }
     }
     return valid;
}

function dif()
{
alert("This service is currently down for maintnance.  Please chack back soon.");
}

function change(id, newClass) 
{
identity=document.getElementById(id);
identity.className=newClass;
}


var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
var daysInMonth = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

function datechanged(monthId, dayId)
{
    var monthdown = document.getElementById(monthId);
    var daydown = document.getElementById(dayId);


    var ddMonthIndex = monthdown.selectedIndex;
    daydown.options.clear
    if(daydown.options.length != daysInMonth[ddMonthIndex])
    {
        for(var i = daydown.options.length-1; i >=0;i--)
        {
            daydown.options[i] = null;
        }
        for(var j = 0; j < daysInMonth[ddMonthIndex];j++)
        {
            daydown.options[j] = j;
        }
    }
}
function flashRollOverOut(flashMovie, movieClip, frame)
{
    
	var flashMovie=getFlashMovieObject(flashMovie);
	flashMovie.TGotoFrame(movieClip, frame);
}

function totracksolostar()
{
    WT_TrackAction('4', '/lantus_SoloStar_256K.flv');
}
function totrackvial()
{
    WT_TrackAction('4', '/lantus_vial_256K.flv');
}