<ja:if test=<%=chameleon.includeIndexGuestBookTop || chameleon.includeIndexGuestBookBottom%>><script type="text/javascript" src="$resPath/embedguestbook.js"></script></ja:if>
<script type="text/javascript">
/* <![CDATA[ */
function keypress(e) {
	if(!e) var e = window.event;
	if(e.keyCode) keyCode = e.keyCode; 
	else if(e.which) keyCode = e.which;
	switch(keyCode) {
		<ja:if exists="parentIndexPage">case 8: window.location="$parentIndexPage"; return false; break;</ja:if><ja:else><ja:if test=<%=chameleon.useUpLinkThis || (chameleon.useUpLinkDefault && parentIndexPage != void)%>>case 8: window.location="<%=(chameleon.useUpLinkDefault)? parentIndexPage:upLink%>"; return false; break;</ja:if></ja:else>
		<ja:if exists="nextIndexPage">case 63235: case 39: window.location="$nextIndexPage"; return false; break;</ja:if>
		<ja:if exists="previousIndexPage">case 63234: case 37: window.location="$previousIndexPage"; return false; break;</ja:if>
		<ja:if exists="firstIndexPage">case 63273: case 36: window.location="$firstIndexPage"; return false; break;</ja:if>
		<ja:if exists="lastIndexPage">case 63275: case 35: window.location="$lastIndexPage"; return false; break;</ja:if>
		<ja:if test=${doIndexSlideShow}>case 32: show_down(); setTimeout('show_out()', 200); return false; break;</ja:if>
	${slideShowCode}}
	return true;
}
function keypresslistener() {
	if(document.all) document.onkeydown = keypress;
	else if(document.layers || document.getElementById) document.onkeypress = keypress;
}
up0 = new Image(31,31); up0.src = "$resPath/up.gif";
up1 = new Image(31,31); up1.src = "$resPath/up1.gif";
next0 = new Image(31,31); next0.src = "$resPath/next.gif";
next1 = new Image(31,31); next1.src = "$resPath/next1.gif";
prev0 = new Image(31,31); prev0.src = "$resPath/prev.gif";
prev1 = new Image(31,31); prev1.src = "$resPath/prev1.gif";
<ja:if test=${doIndexSlideShow}>
show0 = new Image(31,31);show0.src = "$resPath/show.gif";
show1 = new Image(31,31);show1.src = "$resPath/show1.gif";
stop0 = new Image(31,31);stop0.src = "$resPath/stop.gif";
stop1 = new Image(31,31);stop1.src = "$resPath/stop1.gif";

<ja:if test=${indexSlideShowStartsSlides}>
var delay = ${slideShowDelay};
function show_over() { 
	document.getElementById("show").src = show1.src;;
}
function show_out() { 
	document.getElementById("show").src = show0.src;
}
function show_down() { 
	window.location="${firstSlideLink}?show_param="+delay;
}
function change_delay() { 
	delay = prompt('$text.delay', ${slideShowDelay});
}
function redirect() {
}
</ja:if><ja:else>
var delay = ${indexSlideShowDelay};
var show_param = -1;
if (window.location.search.length > 1) {
	var parms = window.location.search.substring(1,location.search.length).split("&");
	for (var i = 0; i < parms.length; i++) {		
		if (parms[i].substring(0, parms[i].indexOf("=")) == "show_param")
		delay = show_param = parms[i].substring(parms[i].indexOf("=")+1, parms[i].length);
	}
}
var show_delay = show_param;
function show_timer() {
	if (show_delay >= 0) {
		if (--show_delay < 0 && show_param > 0) {
			<ja:if exists="nextIndexPage">window.location="$nextIndexPage?show_param="+show_param;</ja:if>
			<ja:else><ja:if test=${indexSlideShowLoop}>window.location="$firstIndexPage?show_param="+show_param;</ja:if><ja:else>show_down(); setTimeout('show_out()', 200);</ja:else></ja:else>
		}
		else if(show_param > 0)
			window.status='Time left: '+(show_delay+1)+' s'; 
	}
	setTimeout('show_timer()', 1000);	
}
function show_over() { 
	document.getElementById("show").src = (show_param >= 0)? stop1.src : show1.src;;
	window.status = '$text.startStopSlideShow - $text.changeSpeed';
}
function show_out() { 
	document.getElementById("show").src = (show_param >= 0)? stop0.src : show0.src;
}
function show_down() { 
	if (show_param >= 0) { 
		show_param = -1; 
		document.getElementById("show").src = stop1.src; 
		window.status=''; 
	} 
	else { 
		show_param = delay; 
		document.getElementById("show").src=show1.src; 
	} 
	show_delay = show_param; 
}
function change_delay() { 
	delay = prompt('$text.delay', (show_param < 0)? ${indexSlideShowDelay} : show_param);
	show_param = show_delay = delay; 
	document.getElementById("show").src = show1.src;
}
</ja:else></ja:if>
<ja:if test=${newLabel}>
function generatenew(fDays) {
  now = new Date();
  nDays = now.getTime() / 86400000;
  if((nDays - fDays) <= ${newLabelDaysCount})
    document.write('<span class="newlabel">&nbsp;$text.new&nbsp;<\/span><%=("$text.new".length() > 4)? "<br />":"&nbsp;"%>');
}
</ja:if>
<ja:if test=${autoMaximize}>
top.window.moveTo(0,0);
if (document.all) {
	top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers || document.getElementById) {
	if (top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth) {
		top.window.outerHeight = screen.availHeight;
		top.window.outerWidth = screen.availWidth;
	}
}
</ja:if>
<ja:if test=<%=(chameleon.includeIndexGuestBookTop || chameleon.includeIndexGuestBookBottom) && (level == 0 || !chameleon.indexGuestBookOnlyTop)%>>
function rgb2hex(c) {
	if(c.charAt(0) == '#') return c;
	else if(c.indexOf('rgb') == 0) {
		var hex = '';
		var array = /([0-9]+)[, ]+([0-9]+)[, ]+([0-9]+)/.exec(c);
		for(i = 1; i < 4; i++) hex += ('0' + parseInt(array[i]).toString(16)).slice(-2);
		return '#' + hex;
	}
	else return '#000000';
}

function getColors() {
	if((el = document.getElementById("body")) != null) {
		if(window.getComputedStyle) {
			color = rgb2hex(document.defaultView.getComputedStyle(el, null).getPropertyValue('color'));
			bgcolor = rgb2hex(document.defaultView.getComputedStyle(el, null).getPropertyValue('background-color'));
		}
		else if(el.currentStyle != null) {
			color = el.currentStyle['color'];
			bgcolor = el.currentStyle['backgroundColor'];
		}
	}
}

function showGuestbook() {
	getColors();
	embedGuestbook("${guestBookPath}/guestbook.swf", ${guestBookWidth}, ${guestBookHeight}, "xmlfile=${guestBookFile}.xml&xmlphp_path=${guestBookPath}/&width=${guestBookWidth}&width=${guestBookHeight}&basefontsize=${guestbookBaseFontSize}&bgcolor=" + bgcolor + "&countcolor=" + color + "&usercolor=${guestbookHighlightColor}&commentscolor=" + color + "&pagelabel=$text.page&namelabel=$text.name&msglabel=$text.message&nameerror=$text.enterName&msgerror=$text.enterMessage&welcomemsg=$text.welcomeMessage&showrating=${guestBookRating}&ratinglabel=$text.rating&avgratinglabel=$text.avgRating&ascending=${guestbookAscending}&dateFormat=${gbDateFormat}&msgscount=${guestbookEntries}");
}
</ja:if>
<ja:if test=${printingPhotobox}>
function selectallItems(setto) { 
	var allBox = document.getElementsByTagName("input"); cnt = 0;
	for(i = 0; i < allBox.length; i++) {
		var input = allBox[i];
		if(input.name.indexOf("xc") == 0) {
			input.checked = setto; cblist[cnt++] = setto;
		}
	}
}
/* ]]> */
</script>
<script type="text/javascript" src="http://printbutton.com/${companyId}.js"></script>
</ja:if>
<ja:else>
/* ]]> */
</script>
</ja:else>

