function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
var dynimages=new Array()
dynimages[0]=["images/galleries/pmain01.gif", ""]
dynimages[1]=["images/galleries/pmain02.gif", ""]
dynimages[2]=["images/galleries/pmain03.gif", ""]
dynimages[3]=["images/galleries/pmain04.gif", ""]
dynimages[4]=["images/galleries/pmain05.gif", ""]
dynimages[5]=["images/galleries/pmain06.gif", ""]
dynimages[6]=["images/galleries/pmain07.gif", ""]
dynimages[7]=["images/galleries/pmain08.gif", ""]
dynimages[8]=["images/galleries/pmain09.gif", ""]
dynimages[9]=["images/galleries/pmain10.gif", ""]
dynimages[10]=["images/galleries/pmain11.gif", ""]
dynimages[11]=["images/galleries/pmain12.gif", ""]
dynimages[12]=["images/galleries/pmain13.gif", ""]
dynimages[13]=["images/galleries/pmain14.gif", ""]
dynimages[14]=["images/galleries/pmain15.gif", ""]
dynimages[15]=["images/galleries/pmain16.gif", ""]
dynimages[16]=["images/galleries/pmain17.gif", ""]
dynimages[17]=["images/galleries/pmain18.gif", ""]
dynimages[18]=["images/galleries/pmain19.gif", ""]
dynimages[19]=["images/galleries/pmain20.gif", ""]
dynimages[20]=["images/galleries/pmain21.gif", ""]
dynimages[21]=["images/galleries/pmain22.gif", ""]
dynimages[22]=["images/galleries/pmain23.gif", ""]
dynimages[23]=["images/galleries/pmain24.gif", ""]
dynimages[24]=["images/galleries/pmain25.gif", ""]
dynimages[25]=["images/galleries/pmain26.gif", ""]
dynimages[26]=["images/galleries/pmain27.gif", ""]
dynimages[27]=["images/galleries/pmain28.gif", ""]
dynimages[28]=["images/galleries/pmain29.gif", ""]
dynimages[29]=["images/galleries/pmain30.gif", ""]



//Set optional link target to be added to all images with a link:
var optlinktarget=""

//Set image border width
var imgborderwidth=0

//Optionally, change 1.0 and 0.7 below to affect Wipe gradient size and duration in seconds in IE5.5+:
var filterstring="progid:DXImageTransform.Microsoft.Fade(Duration=0.0)"

///////No need to edit beyond here/////

//Forward and back modification
function findLoaded(){
if(typeof document.getElementById('dynloadarea').getElementsByTagName('img')[0]!=='undefined'){
var theImg = document.getElementById('dynloadarea').getElementsByTagName('img')[0].src
for (var i_tem = 0; i_tem < dynimages.length; i_tem++)
if (theImg.indexOf(dynimages[i_tem][0])>-1)
return i_tem
}
else
return -1
}

function nextImg(){
if (findLoaded()<dynimages.length-1)
modifyimage('dynloadarea', findLoaded()+1)
else
modifyimage('dynloadarea', 0)
}

function previousImg(){
if (findLoaded()>0)
modifyimage('dynloadarea', findLoaded()-1)
else
modifyimage('dynloadarea', dynimages.length-1)
}
//End of forward and back modification

function returnimgcode(theimg){
var imghtml=""
if (theimg[1]!="")
imghtml='<a href="'+theimg[1]+'" target="'+optlinktarget+'">'
imghtml+='<img src="'+theimg[0]+'" border="'+imgborderwidth+'">'
if (theimg[1]!="")
imghtml+='</a>'
return imghtml
}

function modifyimage(loadarea, imgindex){
if (document.getElementById){
var imgobj=document.getElementById(loadarea)
if (imgobj.filters && window.createPopup){
imgobj.style.filter=filterstring
imgobj.filters[0].Apply()
}
imgobj.innerHTML=returnimgcode(dynimages[imgindex])
if (imgobj.filters && window.createPopup)
imgobj.filters[0].Play()
return false
}
}
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_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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];}
}