
// 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(5);

promos[0] = "<p align=\"center\"><span class=\"style2\"><strong>iGrafx is a Leader!</strong></span></p><p align=\"left\">iGrafx announced today that it is <span class=\"style2\">positioned within the Leaders Quadrant</span> in Gartner Inc.'s \"Magic Quadrant for Business Process Analysis Tools\" report, authored by David Norton, published on December 12, 2011.<br><IMG SRC=\"/images/arrow_right.gif\" WIDTH=\"11\" HEIGHT=\"9\" BORDER=\"0\" ALIGN=\"absmiddle\"> <a href=\"/pressroom/PressRelease/html/Press_12_19_2011_iGrafx_MagicQuadrant.html\" target=\"_blank\">Read more</a></p>";

promos[1] = "<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.html?name=Process%20Mapping%20and%20Modeling%20with%20iGrafx%20Recorded%20Webinar&ao_f=004d&ao_d=d-0001&c_type=v\" 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.html?name=small%20version%20of%20Process%20Mapping%20and%20Modeling%20with%20iGrafx%20Recorded%20Webinar&ao_f=004e&ao_d=d-0001&c_type=v\" rel=\"nofollow\">smaller version</A>.</p>";

promos[2] = "<p align=\"left\">Case Study:  Learn why Hewlett Packard has included <span class=\"style2\">iGrafx for SAP</span> as the Business Process Management application to complement its SAP implementation service methodology.&nbsp;&nbsp;&nbsp;<IMG SRC=\"/images/icon_pdf.gif\" WIDTH=\"16\" HEIGHT=\"16\" BORDER=\"0\" ALIGN=\"absmiddle\"> <a href=\"http://my.igrafx.com/acton/attachment/1035/f-0295/0/-/-/-/-/file.pdf\" target=\"_blank\">Download pdf</a></p>";

promos[3] = "<p align=\"center\"><span class=\"style2\"><strong>iGrafx is a Leader!</strong></span></p><p align=\"left\">iGrafx announced today that it is <span class=\"style2\">positioned within the Leaders Quadrant</span> in Gartner Inc.'s \"Magic Quadrant for Business Process Analysis Tools\" report, authored by David Norton, published on December 12, 2011.<br><IMG SRC=\"/images/arrow_right.gif\" WIDTH=\"11\" HEIGHT=\"9\" BORDER=\"0\" ALIGN=\"absmiddle\"> <a href=\"/pressroom/PressRelease/html/Press_12_19_2011_iGrafx_MagicQuadrant.html\" target=\"_blank\">Read more</a></p>";

promos[4] = "<p align=\"left\">Case Study:  Learn why Hewlett Packard has included <span class=\"style2\">iGrafx for SAP</span> as the Business Process Management application to complement its SAP implementation service methodology.&nbsp;&nbsp;&nbsp;<IMG SRC=\"/images/icon_pdf.gif\" WIDTH=\"16\" HEIGHT=\"16\" BORDER=\"0\" ALIGN=\"absmiddle\"> <a href=\"http://my.igrafx.com/acton/attachment/1035/f-0295/0/-/-/-/-/file.pdf\" target=\"_blank\">Download pdf</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(6);

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 = '/products/iG4SAP/'><img src='/images/home/iGrafx4SAPpromo1.jpg' width='538' height='236' border='0' align='absmiddle' title='iGrafx for SAP'></a>";

images[5] = "<a href = '/products/14/whatsnew.html' onClick='javascript: pageTracker._trackPageview(\"/internal_promo/whatsnew-homepage-promo\");'><img src='/images/home/iGrafx2011promo1.jpg' width='538' height='236' border='0' align='absmiddle' title='iGrafx 2011'></a>";

// read cookie
index = ReadCookie("promoNo");
if (index == "") {
	index = Math.floor(Math.random() * images.length);
} else {
	index++;
	if (index >= images.length) {
		index = 0;
	}
}

try
  {
  document.write(images[index]);
  }
catch(err)
  {
  //Handle errors here
  document.write("<a href = '/products/iG4SAP/'><img src='/images/home/iGrafx4SAPpromo1.jpg' width='538' height='236' border='0' align='absmiddle' title='iGrafx for SAP'></a>");
  }


// 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() + ";"
}


