// Random Promo
	var popUpWin=0;

function popUpWindow(URLStr, left, top, width, height)

{

  if(popUpWin)

  {

    if(!popUpWin.closed) popUpWin.close();

  }

  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');

}

function spotlightPromo() {
promos = new Array(4);

promos[0] = "<p align=\"left\">Tualatin, OR. — February 26, 2010<br>iGrafx&reg;, a leading provider of Business Process Analysis (BPA) solutions,  announced today that it is positioned within the Leaders&acute; Quadrant in Gartner Inc.&acute;s recently re-published report &quot;Magic Quadrant for Business Process Analysis Tools&quot;. <br/><a href=\"PressRelease/html/Press_GartnerMQ_022610.html\">Read more...</a>&nbsp;&nbsp;&nbsp;<IMG SRC=\"/images/icon_pdf.gif\" WIDTH=\"16\" HEIGHT=\"16\" BORDER=\"0\" ALIGN=\"absmiddle\"> <a href=\"PressRelease/PDF/Gartner_Magic_Quadrant_2010_PR_012610.pdf\" target=\"_blank\">Download pdf</a></p>";

promos[1] = "<p>Visit <a href=\"http://forum.igrafx.com\">iGrafx's User Forum</a> and interact with other users of iGrafx. Whether you're looking for tried and true best practice techniques or a solution to your unique situation, the iGrafx User Forum is a great resource for all iGrafx users.</p><p><a href=\"http://forum.igrafx.com/\"><img src=\"/images/ForumBadge.gif\" width=\"167\" height=\"75\" border=\"0\" alt=\"Come try the iGrafx User Forum\"></a></p>";

promos[2] = "<P>Take a look at our <a href=\"/resources/webinars/\">many recorded webinars</a> including:<br/><div align=\"center\" style=\"font-weight:bold;\"><A href=\"/landing/download_request.html?v=%2Fvideos%2FMappingAndModeling-Mar042010-LGflv%2FMappingAndModeling-Mar042010-LGflv.html&n=Process%20Mapping%20and%20Modeling%20with%20iGrafx&t=w\" rel=\"nofollow\">Process Mapping and Modeling with iGrafx</A></div><br/>In this 54 minute Process Mapping and Modeling session you will learn to:<UL class=\"normal\"><LI>Quickly and easily create an iGrafx process map</LI><LI>Add departments / swimlanes to an iGrafx process map to visualize who does what</LI><LI>And more...</LI></UL>There is also valuable Q &amp; A throughout the webinar.</P><p style=\"font-size:9px;\">Problems loading or slow Internet connection? Try the <A href=\"/landing/download_request.html?v=%2Fvideos%2FMappingAndModeling-Mar042010-SMswf%2FMappingAndModeling-Mar042010-SMswf.html&n=Process%20Mapping%20and%20Modeling%20with%20iGrafx&t=w\" rel=\"nofollow\">smaller version</A>.</p>";

promos[3] = "<p><div align=\"center\" style=\"font-weight:bold;\">Raise Process Improvement Above Organizational Silos</div><br/><a href=\"/products/processCentral/\">iGrafx&reg; Process Central&reg;</a> helps organizations bridge departmental silos through central management and distribution of all process knowledge, including process maps, analysis reports, spread sheets and related documents.</p><p>Learn how iGrafx&reg; Process Central&reg; worked for organizations such as <a href=\"/resources/casestudies/#SBirm\">Service Birmingham</a> and <a href=\"/resources/casestudies/#Hampshire\">Hampshire Police</a>.</p>";

// read cookie
index = ReadCookie("spotlightNo");
if (index == "") {
	index = Math.floor(Math.random() * promos.length);
} else {
	index++;
	if (index >= promos.length) {
		index = 0;	
	}
}

document.write(promos[index]);

// store last promo seen
createCookie("spotlightNo", index, 365);
}

function moviePromo() {
images = new Array(4);

images[0] = "<a href = 'javascript:popUpWindow(\"/videos/iGrafxOverviewMovie/index1.html\", 0, 0, 790, 443)'><img src='/images/home/promo_1d.png' width='538' height='236' border='0' align='absmiddle' title='Survive, then thrive'></a>";

images[1] = "<a href = 'javascript:popUpWindow(\"/videos/iGrafxOverviewMovie/index2.html\", 0, 0, 790, 443)'><img src='/images/home/promo_2d.png' width='538' height='236' border='0' align='absmiddle' title='It&acute;s more important than ever'></a>";

images[2] = "<a href = 'javascript:popUpWindow(\"/videos/iGrafxOverviewMovie/index3.html\", 0, 0, 790, 443)'><img src='/images/home/promo_3d.png' width='538' height='236' border='0' align='absmiddle' title='More than just survival'></a>";

images[3] = "<a href = 'javascript:popUpWindow(\"/videos/iGrafxOverviewMovie/index4.html\", 0, 0, 790, 443)'><img src='/images/home/promo_4d.png' width='538' height='236' border='0' align='absmiddle' title='It&acute;s a matter of survival'></a>";

//images[4] = "<a href = 'javascript:popUpWindow(\"/videos/iGrafxOverviewMovie/index5.html\", 0, 0, 790, 443)'><img src='/images/home/promo_5d.png' width='538' height='236' border='0' align='absmiddle' title='What if?'></a>";

//images[5] = "<a href = 'javascript:popUpWindow(\"/videos/iGrafxOverviewMovie/index6.html\", 0, 0, 790, 443)'><img src='/images/home/promo_6d.png' width='538' height='236' border='0' align='absmiddle' title='Yes, you can'></a>";

// read cookie
index = ReadCookie("promoNo");
if (index == "") {
	index = Math.floor(Math.random() * images.length);
} else {
	index++;
	if (index >= images.length) {
		index = 0;	
	}
}

document.write(images[index]);

// store last promo seen
createCookie("promoNo", index, 365);

}

function extractCookieValue(val) {
  if ((endOfCookie = document.cookie.indexOf(";", val)) == -1) {
     endOfCookie = document.cookie.length;
  }
  return unescape(document.cookie.substring(val,endOfCookie));
}

function ReadCookie(cookiename) {
  var numOfCookies = document.cookie.length;
  var nameOfCookie = cookiename + "=";
  var cookieLen = nameOfCookie.length;
  var x = 0;
  while (x <= numOfCookies) {
        var y = (x + cookieLen);
        if (document.cookie.substring(x, y) == nameOfCookie)
           return (extractCookieValue(y));
           x = document.cookie.indexOf(" ", x) + 1;
           if (x == 0){
              break;
           }
  }
  return (null);
}

function createCookie(name, value, expiredays) {
  var todayDate = new Date();
  todayDate.setDate(todayDate.getDate() + expiredays);
  document.cookie = name + "=" + value + "; expires=" +todayDate.toGMTString() + ";"
}


