var activeSlide = 0;
var slideLabelHTML = '';
if(navigator.userAgent.toLowerCase().indexOf('opera')!=-1) displayMode = 'table';
else displayMode = 'block';

function setSlidebuttons() {
	if(!self.slides || !slides.length || slides.length==1) return '';
	var slideHTML = ''
	+'<table cellpadding="0" cellspacing="0" border="0" height="31">'
	+'<tr>'
	+' <td width="30" height="13"></td>'
	+' <td width="5" height="13"></td>'
	+' <td width="13" height="13"></td>'
	+' <td width="5"></td>';
	for(var i=0; i<slides.length; i++) {
		slideHTML += '<td width="13"><table class="slidelabel" id="sLabel'+i+'" cellpadding="0" cellspacing="0"><tr><td width="8"><img src="../imgref/N_slide_label_bg_l.gif/$file/slide_label_bg_l.gif" width="8" height="13" alt=""></td><td nowrap class="sLabel">'+slides[i].split('~~')[1]+'</td><td width="8"><img src="../imgref/N_slide_label_bg_r.gif/$file/slide_label_bg_r.gif" width="8" height="13" alt=""></td></tr></table></td><td width="5"></td>';
	}
	slideHTML += ''
	+'	<td width="13" height="13"></td>'
	+'</tr>'
	
	+'<tr>'
	+'	<td height="5"></td>'
	+'</tr>'
	
	+'<tr>'
	+'	<td width="30"><table cellpadding="0" cellspacing="0"><tr><td width="8"><img src="../imgref/N_slide_label_bg_l.gif/$file/slide_label_bg_l.gif" width="8" height="13" alt=""></td><td nowrap class="sLabel"><b>More</b></td><td width="8"><img src="../imgref/N_slide_label_bg_r.gif/$file/slide_label_bg_r.gif" width="8" height="13" alt=""></td></tr></table></td><td width="5"></td>'
	+'	<td width="13" height="13" id="sButtonStart" class="sButtonStartEnd"><img src="../imgref/N_slide_inactive.gif/$file/slide_inactive.gif" width="13" height="13" alt="" border="0"></td>'
	+'	<td width="5"></td>';
	for(var i=0; i<slides.length; i++) {
		slideHTML += '<td width="13" class="slidebutton" onclick="slide('+i+')" onmouseover="slidelabel('+i+',1)" onmouseout="slidelabel('+i+',0)"><a href="javascript:slide('+i+')" class="sButtonInactive" id="sButton'+i+'">'+(i+1)+'</a></td><td width="5"></td>';
	}
	slideHTML += ''
	+'	<td width="13" height="13" id="sButtonEnd" class="sButtonStartEnd"><img src="../imgref/N_slide_inactive.gif/$file/slide_inactive.gif" width="13" height="13" alt="" border="0"></td>'
	+'</tr>';
	slideHTML += ''
	+'<tr>'
	+'	<td height="1"><img src="/icons/ecblank.gif" width="30" height="1"></td>'
	+'	<td height="1"><img src="/icons/ecblank.gif" width="5" height="1"></td>'
	+'	<td height="1"><img src="/icons/ecblank.gif" width="13" height="1"></td>'
	+'	<td width="5"><img src="/icons/ecblank.gif" width="5" height="1"></td>';
	for(var i=0; i<slides.length; i++) {
		slideHTML += '<td width="13"><img src="/icons/ecblank.gif" width="13" height="1"></td><td width="5"><img src="/icons/ecblank.gif" width="5" height="1"></td>';
	}
	slideHTML += ''
	+'	<td width="13"><img src="/icons/ecblank.gif" width="13" height="1"></td>'
	+'</tr>'
	+'</table>';
	return slideHTML;
}

function slide(id) {
	if(!self.slides || !slides.length) return;
	activeSlide = id;
	
	if(slides.length > 1) {
		if(activeSlide != 0) document.getElementById('sButtonStart').innerHTML = '<a href="javascript:slide('+(activeSlide-1)+')"><img src="../imgref/N_slide_prev.gif/$file/slide_prev.gif" width="13" height="13" alt="&lt;" border="0"></a>';
		else document.getElementById('sButtonStart').innerHTML = '';
		if(activeSlide < slides.length-1) document.getElementById('sButtonEnd').innerHTML = '<a href="javascript:slide('+(activeSlide+1)+')"><img src="../imgref/N_slide_next.gif/$file/slide_next.gif" width="13" height="13" alt="&gt;" border="0"></a>';
		else document.getElementById('sButtonEnd').innerHTML = '';
	}
	
	for(var i=0; i<slides.length; i++) {
		thisParaId = slides[i].split('~~')[0];
		if(activeSlide == i) {
			if(slides.length > 1) document.getElementById('sButton'+i).className = 'sButtonActive';
			document.getElementById('slide'+thisParaId).style.display = displayMode;
			if(eval('self.slidersRight'+thisParaId)) {
				document.getElementById('slidebuttons').style.left = '';
				document.getElementById('slidebuttons').style.right = eval('self.slidersRight'+thisParaId);
			}
			else {
				if(eval('self.slidersLeft'+thisParaId)) {
					document.getElementById('slidebuttons').style.right = '';
					document.getElementById('slidebuttons').style.left = eval('self.slidersLeft'+thisParaId);
				}
				else {
					document.getElementById('slidebuttons').style.left = '';
					document.getElementById('slidebuttons').style.right = slidersRightDefault;
				}
			}
		}
		else {
			document.getElementById('sButton'+i).className = 'sButtonInactive';
			document.getElementById('slide'+thisParaId).style.display = 'none';
		}
	}
}

function slidelabel(id, show) {
	show ? thisVis = 'visible' : thisVis = 'hidden';
	if(slides[id].split('~~')[1]) document.getElementById('sLabel'+id).style.visibility = thisVis;
}