var myinterval;
var startscale = 208;
var currentscale = 208;
var endscale = 110;

var iemac = navigator.userAgent.indexOf("MSIE") > -1 && navigator.userAgent.indexOf("Mac") ;

function Shrink() {
	window.clearInterval(myinterval);
	setCookie("pfizerflashstatus","1");
	myinterval = window.setInterval('PerformeScale()',50);
}
function PerformeScale() {
	currentscale += (endscale - currentscale)/2
	setFlashHeight(flashid,currentscale)
	if (currentscale <= endscale+2) { 
		window.clearInterval(myinterval);
		setFlashHeight(flashid,endscale)
	}
}

function Expand() {
	setCookie("pfizerflashstatus","0");
	window.clearInterval(myinterval);
	myinterval = window.setInterval('PerformeScaleExpand()',50);
}
function PerformeScaleExpand() {
	currentscale += (startscale - currentscale)/2
	setFlashHeight(flashid,currentscale)
	if (currentscale >= startscale-2) { 
		window.clearInterval(myinterval);
		setFlashHeight(flashid,startscale)
	}
}

function setFlashWidth(divid, newW){
	document.getElementById(divid).style.width = newW+"px";
}
function setFlashHeight(divid, newH){
	document.getElementById(divid).style.height = newH+"px";		
}
function setFlashSize(divid, newW, newH){
	setFlashWidth(divid, newW);
	setFlashHeight(divid, newH);
}

function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}
