
var pic = new Array();

function preLoadPic() {
	pic[0]  = '../guest/img/banner-1.jpg';
	pic[1]  = '../guest/img/banner-2.jpg';
	pic[2]  = '../guest/img/banner-3.jpg';
	pic[3]  = '../guest/img/banner-4.jpg';
	pic[4]  = '../guest/img/banner-5.jpg';
	pic[5]  = '../guest/img/banner-6.jpg';

	pic[6] = '../guest/css/menu-item-over.gif';
		
	var preLoad = new Array();
	for (var i = 0; i < pic.length; i ++) {
		preLoadPic[i] 		= new Image();
		preLoadPic[i].src 	= pic[i];
	}
}

function menuOver(id) {
	document.getElementById('menu-' + id).className = 'menu-item-over';
}

function menuOut(id) {
	document.getElementById('menu-' + id).className = 'menu-item-out';
}

function toggle(id) {
	if(document.getElementById(id).style.display == 'none') {
		document.getElementById(id).style.display = '';
	} else {
		document.getElementById(id).style.display = 'none';
	}
	
}

function makePopup(pageURL, pageName, w, h, pageScroll, pageCenter) {
	if(pageCenter == 'no')	{
		LeftPosition = 10;
		TopPosition = 10;
	} else {
		LeftPosition = (screen.width) ? (screen.width - w) / 2 : 0;
		TopPosition = (screen.height) ? (screen.height - h) / 2 : 0;
	}

	var pageConfig = 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=' + pageScroll + ', resizable=yes, width=' + (w + 18) + ', height=' + (h + 18) + ', left=' + LeftPosition + ', top=' + TopPosition;
	var popup = window.open(pageURL, pageName, pageConfig);
	popup.focus();
	return popup;
}

function subMenuOver(subMenuId) {
	var subMenuStyle = document.getElementById(subMenuId).style.display;
	if(subMenuStyle == 'none') {
		document.getElementById(subMenuId).style.display = '';
	} else {
		document.getElementById(subMenuId).style.display = 'none';
	}
}

function subMenuOut(subMenuId) {
	document.getElementById(subMenuId).style.display = 'none';
}

function changePic(cnt) {
	document.getElementById('productImage').innerHTML = document.getElementById('productImage' + cnt).innerHTML;
}

var j = 0;
function runSlideShow() {
	var p = 6;
	var slideShowSpeed = 5000;
	var crossFadeDuration = 2;
	
	if(document.all) {
		document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
		document.images.SlideShow.filters.blendTrans.Apply();
	}
	document.images.SlideShow.src = preLoadPic[j].src;
	if(document.all) {
		document.images.SlideShow.filters.blendTrans.Play();
	}
	
	j = j + 1;
	if(j > (p - 1))
		j = 0;
	
	var t = setTimeout('runSlideShow()', slideShowSpeed);
}
