var frame
var left
var nav
var inited
function init() {
	window.onresize=moveNav;
	if (!document.createElement) return //begone, old browser
	frame=document.getElementById('frame')
	left=document.getElementById('left')
	nav=document.createElement("DIV")
	nav.style.position="absolute";
	nav.style.lineHeight=left.style.lineHeight
	nav.style.fontSize=left.style.fontSize
	nav.style.padding=left.style.padding
	nav.style.width=left.style.width
	nav.style.height=getMyProperty(left,'height')
	nav.style.textAlign=left.style.textAlign
	
	inited = true
	moveNav()
	nav.innerHTML=left.innerHTML;
	document.body.appendChild(nav)
	left.style.visibility='hidden';
	watchForScroll()
	}
	
function getMyProperty(obj,prop) {
	if (document.all) {
		if (prop=='top') return obj.offsetTop+document.body.scrollTop+'px';
		if (prop=='left') return obj.offsetLeft+'px';
		if (prop=='height') return obj.offsetHeight+'px';
	} else {
		if (prop=='top') return (window.pageYOffset+parseInt(document.defaultView.getComputedStyle(obj,'').getPropertyValue('top')))+'px';
		if (prop=='left') return document.defaultView.getComputedStyle(obj,'').getPropertyValue('left');
		if (prop=='height') return document.defaultView.getComputedStyle(obj,'').getPropertyValue('height');
		}
	}

function moveNav() {
	if (!inited) return false;
	newLeft=getMyProperty(frame,'left');
	newTop=getMyProperty(left,'top');
	if (parseInt(newTop)+parseInt(getMyProperty(left,'height')) > parseInt(getMyProperty(frame,'height'))-30){
		newTop=(parseInt(getMyProperty(frame,'height'))-30-parseInt(nav.style.height))+'px'
		}
	nav.style.left=newLeft
	nav.style.top=newTop
	}

lastS = 0
thisS = 0
function watchForScroll() {
	thisS=(document.body.scrollTop)?document.body.scrollTop:window.pageYOffset
	if (thisS!=lastS) {
		lastS=thisS
		moveNav()
	}
	setTimeout('watchForScroll()',50)
	}



function changeImage()
{
  mainimage.src = list.options[list.selectedIndex].value;
}

function prevImage()
{
	if(list.selectedIndex == 0)
	{
		list.selectedIndex = list.options.length-1;
	}
	else
	{
		list.selectedIndex--;
	}
	changeImage();
}
function nextImage()
{
	if(list.selectedIndex == list.options.length-1)
	{
		list.selectedIndex = 0;
	}
	else
	{
		list.selectedIndex++;
	}
	changeImage();
}

// --------------------------------------------------------------------------------------------------
var SlideShowSpeed = 12000;
var CrossFadeDuration = 1;

var Picture = new Array(); // don't change this
var Caption = new Array(); // don't change this
var showHot = false;       // don't change this


Picture[1]  = 'images/1.jpg';
Picture[2]  = 'images/2.jpg';
Picture[3]  = 'images/3.jpg';
Picture[4]  = 'images/4.jpg';
Picture[5]  = 'images/5.jpg';
Picture[6]  = 'images/6.jpg';
Picture[7]  = 'images/7.jpg';
Picture[8]  = 'images/8.jpg';
Picture[9]  = 'images/9.jpg';
Picture[10] = 'images/10.jpg';
Picture[11] = 'images/11.jpg';
Picture[12] = 'images/12.jpg';
Picture[13] = 'images/13.jpg';
Picture[14] = 'images/14.jpg';
Picture[15] = 'images/15.jpg';


Caption[1]  = "1 of 15";
Caption[2]  = "2 of 15";
Caption[3]  = "3 of 15";
Caption[4]  = "4 of 15";
Caption[5]  = "5 of 15";
Caption[6]  = "6 of 15";
Caption[7]  = "7 of 15";
Caption[8]  = "8 of 15";
Caption[9]  = "9 of 15";
Caption[10] = "10 of 15";
Caption[11] = "11 of 15";
Caption[12] = "12 of 15";
Caption[13] = "13 of 15";
Caption[14] = "14 of 15";
Caption[15] = "15 of 15";


var tss;
var iss;
var jss = 1;
var pss = Picture.length-1;

var preLoad = new Array();
for (iss = 1; iss < pss+1; iss++){
preLoad[iss] = new Image();
preLoad[iss].src = Picture[iss];}

function runSlideShow(){
if (document.all){
document.images.PictureBox.style.filter="blendTrans(duration=2)";
document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
document.images.PictureBox.filters.blendTrans.Apply();}

document.images.PictureBox.src = preLoad[jss].src;
if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];
if (document.all) document.images.PictureBox.filters.blendTrans.Play();
jss = jss + 1;
if (jss > (pss)) jss=1;
tss = setTimeout('runSlideShow()', SlideShowSpeed);
}


function control(how){
if (showHot){
if (how=="H") jss = 1;
if (how=="F") jss = jss + 1;
if (how=="B") jss = jss - 1;
if (jss > (pss)) jss=1;
if (jss < 1) jss = pss;
if (document.all){
document.images.PictureBox.style.filter="blendTrans(duration=2)";
document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
document.images.PictureBox.filters.blendTrans.Apply();}

document.images.PictureBox.src = preLoad[jss].src;
if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];
if (document.all) document.images.PictureBox.filters.blendTrans.Play();
}}

