
var popWindow = null;

function popwindow(url,width,height) {
	var midX = (screen.width/2)-(width/2);
	var midY = (screen.height/2)-(height/2);
	popWindow = window.open (''+[url]+'','popwin', "width="+[width]+",height="+[height]+",toolbar=no,menubar=no,scrollbars=yes,resizable=yes,top="+midY+",left="+midX+",screenX="+midX+",screenY="+midY+"");
	popWindow.focus();

}

var imgwin = null;

function zoomAcc(img) {
	imgwin = window.open("/Products/Accessories/zoomacc.asp?img="+[img]+"","poproomimage","width=200,height=200,toolbar=no,menubar=no,scrollbars=no,resizable=no");
	imgwin.focus();
}

function zoomCustom(img) {
	imgwin = window.open("/Products/Custom-Design/zoomcustom.asp?img="+[img]+"","poproomimage","width=200,height=200,toolbar=no,menubar=no,scrollbars=no,resizable=no");
	imgwin.focus();
}

function zoomPop(img) {
	imgwin = window.open("/Dealers/Point-of-Purchase-Sales-Materials/zoompop.asp?img="+[img]+"","poproomimage","width=200,height=200,toolbar=no,menubar=no,scrollbars=no,resizable=no");
	imgwin.focus();
}

var timer1 = null;
var timer2 = null;
var timer3 = null;

var subMenuArr = new Array("products","collections","about","search","advice","news","faq","dealers","store","contact","home");
var i,j;


function showSubMenu(id) {

	var i;
	var o1 = null;
	var o2 = null;

	for(i=0;i<subMenuArr.length;i++) {

		if(subMenuArr[i]==id) {

			if(document.all) {
				o1 = document.all(id+"sub");
				o2 = document.all("blanksub");
			} else if(document.getElementById) {
				o1 = document.getElementById(id+"sub");
				o2 = document.getElementById("blanksub");
			}

			if(o1!=null && o2!=null) {
				o2.style.display = "none";
				o1.style.display = "block";
			}

			break;
		}
	}
	
}


function resetSubMenus() {

	var i;
	var o1 = null;
	var o2 = null;

	for(i=0;i<subMenuArr.length;i++) {

		o1 = null;
		o2 = null;

		if(document.all) {
			o1 = document.all(subMenuArr[i]+"sub");
			o2 = document.all("blanksub");
		} else if(document.getElementById) {
			o1 = document.getElementById(subMenuArr[i]+"sub");
			o2 = document.getElementById("blanksub");
		}

		if(o1!=null && o2!=null) {
			o1.style.display = "none";
			o2.style.display = "block";
		}
	}
}



function resetMenuImages() {

	var i;

	for(i=0;i<mImgList.length;i++) {
		if(document.images && document.images[mImgList[i]]) {
			if(document.images[mImgList[i]].filters) { document.images[mImgList[i]].filters.blendTrans.apply(); }
			if(mImgList[i]==currentPage) {
				document.images[mImgList[i]].src = mSelImg[mImgList[i]].src;
			} else {
				document.images[mImgList[i]].src = mOutImg[mImgList[i]].src;
			}
			if(document.images[mImgList[i]].filters) { document.images[mImgList[i]].filters.blendTrans.play(); }
		}
	}
}


function resetMenuStyles() {

	var i;
	var o1 = null;
	
	for(i=0;i<subMenuArr.length;i++) {

		o1 = null;
		
		if(document.all) {
			o1 = document.all(subMenuArr[i]+"menu");
		} else if(document.getElementById) {
			o1 = document.getElementById(subMenuArr[i]+"menu");
		}

		if(o1!=null) {
			if(subMenuArr[i]==currentPage) {
				o1.className = "MenuSel";
			} else {
				o1.className = "Menu";
			}

		}
	}
}


function mOvr(id) {

	resetMenuStyles();
	resetSubMenus();
	clearTimeout(timer1);
	clearTimeout(timer2);
	clearTimeout(timer3);

	var o1 = null;
		
	if(document.all) {
		o1 = document.all(id+"menu");
	} else if(document.getElementById) {
		o1 = document.getElementById(id+"menu");
	}

	if(o1!=null) {
		o1.className = "MenuSel";
	}

	showSubMenu(id);
}


function mOut(id) {


	var o1 = null;
		
	if(document.all) {
		o1 = document.all(id+"menu");
	} else if(document.getElementById) {
		o1 = document.getElementById(id+"menu");
	}

	if(o1!=null) {
		
		if(id==currentPage) {
			o1.className = "Menu";
		} else {
			o1.className = "MenuSel";
		}
		
	}

	resetAll();
	
}


function subMOvr(id) {

	clearTimeout(timer1);
	clearTimeout(timer2);
	clearTimeout(timer3);

	var o1 = null;
		
	if(document.all) {
		o1 = document.all(id+"menu");
	} else if(document.getElementById) {
		o1 = document.getElementById(id+"menu");
	}

	if(o1!=null) {
		o1.className = "MenuSel";
	}

	showSubMenu(id);
}

function resetAll() {
	timer1 = setTimeout("resetSubMenus();",600);
	timer2 = setTimeout("resetMenuStyles();",650);

	if(currentPage!="") {
	timer3 = setTimeout("subMOvr(currentPage);",690);
	}
}