if(document.all){
	//fix background image flicker in IE6
	try {
		document.execCommand("BackgroundImageCache", false, true);
	}catch(e){

	}
}



function getDim(el){
	var curleft = curtop = 0;
	if (el.offsetParent) {
		curleft = el.offsetLeft
		curtop = el.offsetTop
		if(document.all){
			while (el = el.offsetParent) {
				curleft += el.offsetLeft
				curtop += el.offsetTop
			}
		}
	}
	return {x: curleft,y: curtop};
}
function ShowLargePic($smallImgId,$largeImgId,$xOffset,$yOffset) {
	// Get Image Dimensions
	$myImgDim = getDim(document.getElementById($smallImgId)); //fix ASAP

	// Set Styles

	var oLargeImage = document.getElementById($largeImgId);

	oLargeImage.style.top=($myImgDim.y-$yOffset)+'px';
	oLargeImage.style.left=($myImgDim.x-$xOffset)+'px';

	// Unhide Layer
	oLargeImage.style.display='block';
}
function HideLargePic($imgId) {
	// Hide Layer
	document.getElementById($imgId).style.display='none';
}



toggle_sub_nav = function(groupId, force){
	// JustinB: Added Blur to Deselect Object After Clicking (removes dotted border) [Edit: blur()s entire window in Safari, skip it for them.]
	if(navigator.userAgent.indexOf("Safari") < 0) this.blur();

	var oGroup = document.getElementById(groupId);

	//fail quietly, and early
	if(!oGroup){
		return;
	}

	//force the element to take on a certain style
	if(typeof force == "string"){
		oGroup.style.display = force;
		return;
	}

	//if we have a group open
	if(SubNavFocusGroup != ""){
		toggle_sub_nav(SubNavFocusGroup, "none"); //force hide it

		if(SubNavFocusGroup == groupId){
			SubNavFocusGroup = "";
			return;
		}
		//focus id is reset below
	}

	if(oGroup.style.display == "block"){
		oGroup.style.display = "none"; //hide
		SubNavFocusGroup = "";         //reset focus identifier
	}else{
		oGroup.style.display = "block"; //display
		SubNavFocusGroup = groupId;     //set focus identifier
	}

	return;
}





snap_css = function(){
	var divContentStyle = document.getElementById("content").style;
	divContentStyle.position   = "relative";
	divContentStyle.position   = "static";
	divContentStyle.marginLeft = "0px";
}


if (document.addEventListener) {
    document.addEventListener("DOMContentLoaded", snap_css, false);
}