 var imagenumber = 2 ;
// var imagenumber = 3 ;
var rand1 = Math.floor( Math.random() * imagenumber + 1 ) ;

if (getCookie('portalrotate2') != "yes")
{
   setCookie('portalrotate2', 'yes');
   rand1 = 2;
}

images = new Array();
images[1] ="../static/img/shareholders/2010/index5.jpg";
images[2] ="../static/img/shareholders/2010/ecomms_1.jpg";
//images[3] ="../static/img/shareholders/2010/index_finreports.jpg";
var image = images[rand1];

links = new Array();
links[1] ="http://ukgroup.standardlife.com/content/news/new_articles/2010/2010_interims.xml";
links[2] ="http://www.standardlife.com/shareholders/shareholder_communications.html"; 
//links[3] ="http://www.standardlife.com/ara"; 
var link = links[rand1];
// links[4] ="shareholder_news/index.html";
// var link = links[rand1];

alttexts = new Array();
alttexts[1] ="4.35p per share. The board have proposed an interim dividend of 4.35p per share, an increase of 4.8% from 2009.  This will be paid on 19 November 2010. Read the 2010 half year results";
alttexts[2] ="Ecommunications. Register for ecommunications to get your information through more quickly, and help us save paper too. Find out more.";
//alttexts[3] ="Financial reports 2009. Our Annual Report and Accounts and Summary Financial Report are now available online. View now. ";
// alttexts[4] ="An easy way to find out about Standard Life’s business in 2008 and how we have performed for you, our shareholders.";

var alttext = alttexts[rand1];

//Standard function to set a cookie. Note the following:
// - path set to '/' to allow cookie to be read from any other directory on server;
// - no expiry date set, so cookie will expire at end of session.
function setCookie(strName, strValue) 
{
	document.cookie = strName + '=' + strValue + '; path=/';
} 
  

//Return value of supplied cookie - given a cookie name
function getCookie(strCookieName) 
{
	//get all cookies
	strAllCookies = document.cookie;
	strKey = strCookieName + '=';
	
	//find our cookie and extract it
	intStart = strAllCookies.indexOf(strKey);
	if (intStart > -1) 
	{
		intStart += strKey.length;
		intEnd = strAllCookies.indexOf(';', intStart);
		if (intEnd == -1) intEnd = strAllCookies.length;
		strCookieVal = strAllCookies.substring(intStart, intEnd);
	}
	else strCookieVal = '';
	
	return(strCookieVal);	
}


/*commented out as it works a bit weird
// this function gets the cookie, if it exists
function OLDgetCookie( name ) 
{
	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) )
	{
		return null;
	}
	
	if ( start == -1 ) return null;

	var end = document.cookie.indexOf( ";", len );
	if ( end == -1 ) 
	{
		end = document.cookie.length;
	}
	
	return unescape( document.cookie.substring( len, end ) );
}
*/
