// Stop flickering in IE6
try {
	document.execCommand("BackgroundImageCache", false, true);
} catch(e) {}

/* _toggleTroubleElements : function(visibility, content){
		
	if (content) {
		var selects = $('lightwindow_contents').getElementsByTagName('select');
	} else {
		var selects = document.getElementsByTagName('select');
	}
	
	for(var i = 0; i < selects.length; i++) {
		selects[i].style.visibility = visibility;
	}
	
	if (!content) {
		if (this.options.hideFlash){
			var objects = document.getElementsByTagName('object');
			for (i = 0; i != objects.length; i++) {
				objects[i].style.visibility = visibility;
			}
			var embeds = document.getElementsByTagName('embed');
			for (i = 0; i != embeds.length; i++) {
				embeds[i].style.visibility = visibility;
			}
		}
		var iframes = document.getElementsByTagName('iframe');
		for (i = 0; i != iframes.length; i++) {
			iframes[i].style.visibility = visibility;
		}
	}
} */

function toggleLightBoxSet(pDivToToggle, pAdjustedHeight, pDisplay, pVisibility, pZIndex)
{
	var overlay = $(pDivToToggle);

	overlay.setStyle({
		opacity: 0.8,
		backgroundImage: 'url(images/black_50.png)',
		backgroundRepeat: 'repeat',
		height: pAdjustedHeight + 'px',
		display: pDisplay,
		visibility: pVisibility,
		zIndex: pZIndex
	});
}
function toggleLightBox(divtotoggle, display, visibility, zindex) {
	var xScroll, yScroll;
	if (window.innerHeight && window.scrollMaxY) {
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ 
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { 
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}

	var windowWidth, windowHeight;
	if (self.innerHeight) {	
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { 
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { 
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	var adjustedWidth, adjustedHeight;
	if(xScroll < windowWidth){	
		adjustedWidth = windowWidth;
	} else {
		adjustedWidth = xScroll;
	}
	if(yScroll < windowHeight){
		adjustedHeight = windowHeight;
	} else {		
		adjustedHeight = yScroll;
	}

	var overlay = $(divtotoggle);

	overlay.setStyle({
		opacity: 0.8,
		backgroundImage: 'url(images/black_50.png)',
		backgroundRepeat: 'repeat',
		height: adjustedHeight+'px',
		display: display,
		visibility: visibility,
		zIndex: zindex
	});
}

function togglePopup(pDivToToggle, pDisplay, pVisibility, pZIndex)
{
	var popup = $(pDivToToggle);

	popup.setStyle({
		display: pDisplay,
		visibility: pVisibility,
		zIndex: pZIndex
	});
}

function resizeShoppingDiv(divtotoggle, width, height) {
	var d = $(divtotoggle);

	d.setStyle({
		width: width+'px',
		height: height+'px'
	});
}
