function showAdvert(pageUrl)
{
    window.open(pageUrl, 'ShowAdvert', 'toolbar=no,scrollbars=no,width=352,height=300');
}

function toggleFAQ(div)
{
    var divObj = document.getElementById(div);
    if (divObj != null)
    {
        if (divObj.style.visibility == "hidden")
        {
            divObj.style.visibility = "visible";
            divObj.style.display = "";
        }
        else    
        {
            divObj.style.visibility = "hidden";
            divObj.style.display = "none";
        }
    }
}

function MM_swapImgRestore() //v3.0
{
	var i,x,a=document.MM_sr;
	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
		x.src=x.oSrc;
}


function MM_findObj(n, d) //v4.01
{
	var p,i,x;
	if(!d)
		d=document;
	if((p=n.indexOf("?"))>0&&parent.frames.length)
	{
		d=parent.frames[n.substring(p+1)].document;
		n=n.substring(0,p);
	}
	if(!(x=d[n])&&d.all)
		x=d.all[n];
	for (i=0;!x&&i<d.forms.length;i++)
		x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++)
		x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById)
		x=d.getElementById(n);
	return x;
}

function MM_swapImage() //v3.0
{
	var i,j=0,x,a=MM_swapImage.arguments;
	document.MM_sr=new Array;
	for(i=0;i<(a.length-2);i+=3)
		if ((x=MM_findObj(a[i]))!=null)
		{
			document.MM_sr[j++]=x;
			if(!x.oSrc)
				x.oSrc=x.src;
			x.src=a[i+2];
		}
}

var totalImages = 6;
var currentImagePrefix = "gallery_image_";
//var currentTitlePrefix = "cycling_title_";
var currentImageID = 1;

function showFirstPic()
{
	showPic(currentImageID);
	document.getElementById("image_button_prev").style.display='none';
}
function showNextPic()
{
	document.getElementById("image_button_prev").style.display='block';
	document.getElementById("image_button_next").style.display='block';
	if (currentImageID < totalImages)
	{
		hidePic(currentImageID);
		currentImageID += 1;
		showPic(currentImageID);
	}
	if (currentImageID == totalImages)
	{
		document.getElementById("image_button_next").style.display='none';
	}
}
function showPrevPic()
{
	document.getElementById("image_button_prev").style.display='block';
	document.getElementById("image_button_next").style.display='block';
	if (currentImageID <= totalImages)
	{
		hidePic(currentImageID);
		currentImageID -= 1;
		showPic(currentImageID);
	}
	if (currentImageID == 1)
	{
		document.getElementById("image_button_prev").style.display='none';
	}
}
function showPic(imageId)
{
	document.getElementById("page_number").innerHTML = currentImageID +" / "+ totalImages;
	document.getElementById(currentImagePrefix+imageId).style.display='block';
	//document.getElementById(currentTitlePrefix+imageId).style.display='block';
}
function hidePic(imageId)
{
	document.getElementById(currentImagePrefix+imageId).style.display='none';
	//document.getElementById(currentTitlePrefix+imageId).style.display='none';
}

adImage01= new Image();
adImage01.src="/AboutMTN/PublishingImages/fifa_thumbnail.jpg";
adImage02= new Image();
adImage02.src="/AboutMTN/PublishingImages/fifa_thumbnail_hover.jpg";
adImage03= new Image();
adImage03.src="/AboutMTN/PublishingImages/womensday_thumbnail.jpg";
adImage04= new Image();
adImage04.src="/AboutMTN/PublishingImages/womensday_thumbnail_hover.jpg";
adImage05= new Image();
adImage05.src="/AboutMTN/PublishingImages/hvp_01_thumbnail.jpg";
adImage06= new Image();
adImage06.src="/AboutMTN/PublishingImages/hvp_01_thumbnail_hover.jpg";
adImage07= new Image();
adImage07.src="/Sponsorships/PublishingImages/cricket_thumbnail.jpg";
adImage08= new Image();
adImage08.src="/Sponsorships/PublishingImages/cricket_thumbnail_h.jpg";
adImage09= new Image();
adImage09.src="/AboutMTN/PublishingImages/summer_thumbnail.jpg";
adImage10= new Image();
adImage10.src="/AboutMTN/PublishingImages/summer_thumbnail_hover.jpg";

function rollover(imagename, newsrc)
{
    document.images[imagename].src=newsrc.src;
}
