var pausecontent=new Array()
pausecontent[0]='<a href="../news-and-media/"><u> June 04, 2009</u></a><br /><br /><font color ="000066">UPM PHARMACEUTICALS®, INC. PASSES PRE-APPROVAL INSPECTION (PAI) FOR SOLID ORAL DOSE PRODUCT</font>'
pausecontent[1]='<a href="../news-and-media/"><u> April 24, 2009</u></a><br /><br /><font color ="000066">UPM PHARMACEUTICALS®, INC. Installation of New Packaging Line</font>'
pausecontent[2]='<font color ="000066">Contract Pharma<br /><br /><font color ="000066">9/24/2009 - 9/25/2009(Booth #63)</font>'
pausecontent[3]='<font color ="000066">AAPS<br /><br /><font color ="000066">11/8/2009 - 11/12/2009(Booth # 1947)</font>'


function newWindow(page) {OpenWin = this.open(page, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width=700,height=600,left=200,top=0" );}
function weatherWindow(page) {OpenWin = this.open(page, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=600,height=466,left=0,top=0" );}

/***********************************************
* Pausing up-down scroller- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

function pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}

// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------

pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}


// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------

pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}

// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------

pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}

pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}

// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------

pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}

//This function retrieves the current day, date and year
<!-- 
var this_weekday_name_array = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")	//predefine weekday names
var this_month_name_array = new Array("January","February","March","April","May","June","July","August","September","October","November","December")	//predefine month names

var this_date_timestamp=new Date()	//get current day-time stamp

var this_weekday = this_date_timestamp.getDay()	//extract weekday
var this_date = this_date_timestamp.getDate()	//extract day of month
var this_month = this_date_timestamp.getMonth()	//extract month
var this_year = this_date_timestamp.getYear()	//extract year

if (this_year < 1000)
	this_year+= 1900;	//fix Y2K problem
if (this_year==101)
	this_year=2001;		//fix Netscape browsers - it displays the year as being the year 101!

var this_date_string = this_weekday_name_array[this_weekday] + ", " + this_month_name_array[this_month] + " " + this_date + ", " + this_year	//concat long date string
// -->

windowtitle = '';
videoname = '';
xMax = 0;
yMax = 0;
xOffset = 0;
yOffset = 0;

function centerWindow() {
  if (document.all) {
    xMax = screen.width;
    yMax = screen.height;
  } else {
    if (document.layers) {
      xMax = window.outerWidth;
      yMax = window.outerHeight;
    } else {
      xMax = 640;
      yMax=480;
    }
  }
  xOffset = (xMax - 320)/2;
  yOffset = (yMax - 261)/2;
}

function showmov(wintl,vidnme) {
  if (typeof vidwin != 'undefined') vidwin.close();
  centerWindow();
  vidwin = window.open('about:blank','','height=236,width=320,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
  windowtitle = wintl;
  videoname = vidnme;
  setTimeout('displaymov()',500)
}

function displaymov() {
  doc = vidwin.document;
  doc.open('text/html');
  doc.write('<HTML>\n<HEAD>\n<TITLE>' + windowtitle + '<\/TITLE>\n<\/HEAD>\n');
  doc.write('<BODY bgcolor="white" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">\n');
  doc.write('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"\n');
  doc.write('        width="320" height="236"\n');
  doc.write('        codebase="http://www.apple.com/qtactivex/qtplugin.cab">\n');
  doc.write('<param name="src" value="' + videoname  + '">\n');
  doc.write('<param name="autoplay" value="true">\n');
  doc.write('<param name="controller" value="true">\n');
  doc.write('<param name="loop" value="false">\n');
  doc.write('<param name="bgcolor" value="#C3C3C3">\n');
  doc.write('<embed src="' + videoname + '" pluginspage="http://www.apple.com/quicktime/download/"\n');
  doc.write('       height="236" width="320" autoplay="true" loop="false" controller="true">\n');
  doc.write('</embed></object>\n<\/BODY>\n<\/HTML>');
  doc.close();
}

function showwmv(wintl,vidnme) {
  if (typeof vidwin != 'undefined') vidwin.close();
  centerWindow();
  vidwin = window.open('about:blank','','height=286,width=320,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
  windowtitle = wintl;
  videoname = vidnme;
  setTimeout('displaywmv()',500)
}

function displaywmv() {
  doc = vidwin.document;
  doc.open('text/html');
  doc.write('<HTML>\n<HEAD>\n<TITLE>' + windowtitle + '<\/TITLE>\n<\/HEAD>\n');
  doc.write('<BODY bgcolor="white" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">\n');
  doc.write('<object id="MediaPlayer" width=320 height=286	classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"\n');
  doc.write('        standby="Loading Microsoft® Windows® Media Player components..."\n');
  doc.write('        type="application/x-oleobject"\n');
  doc.write('        codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">\n');
  doc.write('<param name="filename" value="' + videoname  + '">\n');
  doc.write('<param name="AutoStart" value="true">\n');
  doc.write('<param name="ShowControls" value="true">\n');
  doc.write('<param name="ShowStatusBar" value="false">\n');
  doc.write('<param name="Autorewind" value="true">\n');
  doc.write('<param name="ShowDisplay" value="false">\n');
  doc.write('<embed src="' + videoname + '" width=320 height=286\n');
  doc.write('       type="application/x-mplayer2" name=MediaPlayer\n');
  doc.write('       autostart=1 showcontrols=1 showstatusbar=0 autorewind=1 showdisplay=0>\n');
  doc.write('</embed></object>\n<\/BODY>\n<\/HTML>');
  doc.close();
}


