<!--
NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
W3C = (document.getElementById) ? 1 : 0;


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];}
}


strTextPrevious = ''
strTextNext     = 'next image'

//image gallery
function change_text(intIndex, strText)
{
  	strValue = 'description_'+intIndex;
	if (W3C) 
	{
		objLayer = document.getElementById(strValue);
	}
	else if (NS4)
	{
 		objLayer = document.layers[strValue];
	} 
	else 
	{
 		objLayer = document.all[strValue];
	}
	if (strText == 'previous image')
	{
		objLayer.innerText = strTextPrevious
	}
	else if (strText == 'next image')
	{
		objLayer.innerText = strTextNext
	}
	else
	{
		objLayer.innerText = strText;
	}
}

function change_image(intIndex, objImage, strDirection)
{
	strLinkPrevious = 'link_previous_'+intIndex;
	strLinkNext = 'link_next_'+intIndex;
	if (W3C) 
	{
		objLinkPrevious = document.getElementById(strLinkPrevious);
		objLinkNext = document.getElementById(strLinkNext);
	}
	else if (NS4)
	{
 		objLinkPrevious = document.layers[strLinkPrevious];
 		objLinkNext = document.layers[strLinkNext];
	} 
	else 
	{
 		objLinkPrevious = document.all[strLinkPrevious];
 		objLinkNext = document.all[strLinkNext];
	}

	if (strDirection == 'previous')
	{
		if (intCurrentIndex[intIndex] == 0)
		{
			return;
		}
		else
		{
			intCurrentIndex[intIndex] = intCurrentIndex[intIndex] - 1;
			objImage.src = arrImage[intIndex][intCurrentIndex[intIndex]];
		}
		if (parseInt(intCurrentIndex[intIndex]) == 0)
		{
			objButtonPrevious = eval('button_previous_' + intIndex)
			objButtonPrevious.src = 'images/photos_prev_g.gif'
			objLinkPrevious.className = 'picturenavlinkdisable'
			strTextPrevious = '';
		}
		else
		{
			objButtonPrevious = eval('button_previous_' + intIndex)
			objButtonPrevious.src = 'images/photos_prev.gif'
			objLinkPrevious.className = 'picturenavlink'
			strTextPrevious = 'previous image';
		}
		if (intNumPictures[intIndex] == parseInt(intCurrentIndex[intIndex]) + 1)
		{
			objButtonNext= eval('button_next_' + intIndex)
			objButtonNext.src = 'images/photos_next_g.gif'
			objLinkNext.className = 'picturenavlinkdisable'
			strTextNext = '';
		}
		else
		{
			objButtonNext = eval('button_next_' + intIndex)
			objButtonNext.src = 'images/photos_next.gif'
			objLinkNext.className = 'picturenavlink'
			strTextNext = 'next image';
		}		
	}
	else if (strDirection == 'next')
	{
		if (intCurrentIndex[intIndex] == (intNumPictures[intIndex] - 1))
		{
			return;
		}
		else
		{
			intCurrentIndex[intIndex] = intCurrentIndex[intIndex] + 1;
			objImage.src = arrImage[intIndex][intCurrentIndex[intIndex]];
		}
		if (parseInt(intCurrentIndex[intIndex]) == 0)
		{
			objButtonPrevious = eval('button_previous_' + intIndex)
			objButtonPrevious.src = 'images/photos_prev_g.gif'
			objLinkPrevious.className = 'picturenavlinkdisable'
			strTextPrevious = '';
		}
		else
		{
			objButtonPrevious = eval('button_previous_' + intIndex)
			objButtonPrevious.src = 'images/photos_prev.gif'
			objLinkPrevious.className = 'picturenavlink'
			strTextPrevious = 'previous image';
		}
		if (intNumPictures[intIndex] == parseInt(intCurrentIndex[intIndex]) + 1)
		{
			objButtonNext = eval('button_next_' + intIndex)
			objButtonNext.src = 'images/photos_next_g.gif'
			objLinkNext.className = 'picturenavlinkdisable'
			strTextNext = '';
		}
		else
		{
			objButtonNext = eval('button_next_' + intIndex)
			objButtonNext.src = 'images/photos_next.gif'
			objLinkNext.className = 'picturenavlink'
			strTextNext = 'next image';
		}		
	}	
}

function zoom_image(intIndex)
{
	image_zoom = window.open('image_zoom.php?imgfile='+arrZoomImage[intIndex][intCurrentIndex[intIndex]], 'image_zoom', 'toolbars=no,scrollbars=no,width=320,height=240');
	image_zoom.focus();
}

function zoom_gallery_image(intIndex)
{
	image_zoom = window.open('image_zoom.php?imgfile='+arrZoomImage[intIndex], 'image_zoom', 'toolbars=no,scrollbars=no,width=320,height=240');
	image_zoom.focus();
}

//promo bar
function populate()
{
	if (iedom)
	{
		cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
		cross_marquee.style.left=parseInt(marqueewidth)+8+"px"
		cross_marquee.innerHTML=marqueecontent
		actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
	}
	else if (document.layers)
	{
		ns_marquee=document.ns_marquee.document.ns_marquee2
		ns_marquee.left=parseInt(marqueewidth)+8
		ns_marquee.document.write(marqueecontent)
		ns_marquee.document.close()
		actualwidth=ns_marquee.document.width
	}
	lefttime=setInterval("scrollmarquee()",20)
}

function scrollmarquee()
{
	if (iedom)
	{
		if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
			cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+"px"
		else
			cross_marquee.style.left=parseInt(marqueewidth)+8+"px"
	}
	else if (document.layers)
	{
		if (ns_marquee.left>(actualwidth*(-1)+8))
			ns_marquee.left-=copyspeed
		else
			ns_marquee.left=parseInt(marqueewidth)+8
	}
}

