function setLargePriceOutOfScope() {
	
	var wLeftGreyBox = document.getElementById("price_oos_left");
	var wRightGreyBox = document.getElementById("price_oos_right");
	
	if (wLeftGreyBox != null && wRightGreyBox != null) {
	
		var wLeftSlider = document.getElementById("price_min_thumb");
		var wRightSlider = document.getElementById("price_max_thumb");
		
		wLeftGreyBox.style.width = wLeftSlider.style.left;
		
		wRightWidth = 486 - parseInt(wRightSlider.style.left.substring(0, wRightSlider.style.left.indexOf("px", 0)));
		
		if (wRightWidth == parseInt(wRightWidth)) {
			wRightGreyBox.style.width = wRightWidth + "px";
		}
		
	}
	
}

function setLargeCaratOutOfScope() { 
	
	var wLeftGreyBox = document.getElementById("carat_oos_left");
	var wRightGreyBox = document.getElementById("carat_oos_right");
	
	if (wLeftGreyBox != null && wRightGreyBox != null) {
	
		var wLeftSlider = document.getElementById("carat_min_thumb");
		var wRightSlider = document.getElementById("carat_max_thumb");
		
		wLeftGreyBox.style.width = wLeftSlider.style.left;
		
		wRightWidth = 486 - parseInt(wRightSlider.style.left.substring(0, wRightSlider.style.left.indexOf("px", 0)));
		
		if (wRightWidth == parseInt(wRightWidth)) {
			wRightGreyBox.style.width = wRightWidth + "px";
		}
		
	}
	
}

function setSmallPriceOutOfScope() {
	
	var wLeftGreyBox = document.getElementById("price_oos_left");
	var wRightGreyBox = document.getElementById("price_oos_right");
	
	if (wLeftGreyBox != null && wRightGreyBox != null) {
	
		var wLeftSlider = document.getElementById("price_min_thumb");
		var wRightSlider = document.getElementById("price_max_thumb");
		
		wLeftGreyBox.style.width = wLeftSlider.style.left;
		
		wRightWidth = 294 - parseInt(wRightSlider.style.left.substring(0, wRightSlider.style.left.indexOf("px", 0)));
		
		if (wRightWidth == parseInt(wRightWidth)) {
			wRightGreyBox.style.width = wRightWidth + "px";
		}
	
	}
	
}

function setSmallCaratOutOfScope() { 

	var wLeftGreyBox = document.getElementById("carat_oos_left");
	var wRightGreyBox = document.getElementById("carat_oos_right");
	
	if (wLeftGreyBox != null && wRightGreyBox != null) {
	
		var wLeftSlider = document.getElementById("carat_min_thumb");
		var wRightSlider = document.getElementById("carat_max_thumb");
		
		wLeftGreyBox.style.width = wLeftSlider.style.left;
		
		wRightWidth = 294 - parseInt(wRightSlider.style.left.substring(0, wRightSlider.style.left.indexOf("px", 0)));
		
		if (wRightWidth == parseInt(wRightWidth)) {
			wRightGreyBox.style.width = wRightWidth + "px";
		}
		
	}
	
}

function ipResetTops() {
	document.getElementById('carat_min_thumb').style.top = 0;
	document.getElementById('carat_max_thumb').style.top = 0;
}

/* Educational */

var eduMainTabs = new Array("ctrdTab", "dsTab", "t4cTab", "ocTab");
var eduMainContent = new Array("ctrdBox", "dsBox", "t4cBox", "ocBox");

var t4cTabs = new Array("cwTab", "clrTab", "cltyTab", "ctTab", "ctgrdBox");
var t4cContent = new Array("cwBox", "clrBox", "cltyBox", "ctBox", "ctgrdBox");
var ocTabs = new Array("plshTab", "smtryTab", "lbTab", "dtTab", "lwTab");
var ocContent = new Array("plshBox", "smtryBox", "lbBox", "dtBox", "lwBox");

var ctrdTabs = new Array("ctrdBudgetTab", "ctrdShapeTab", "ctrdT4CTab", "ctrdOtherTab");
var ctrdContent = new Array("ctrdBudgetBox", "ctrdShapeBox", "ctrdT4CBox", "ctrdOtherBox");

var shapeItems = new Array("roundShapeItem", "princessShapeItem", "marquiseShapeItem", "emeraldShapeItem", "radiantShapeItem", "pearShapeItem", "ovalShapeItem", "heartShapeItem", "asscherShapeItem", "cushionShapeItem");
var shapeTips = new Array("roundTip", "princessTip", "marquiseTip", "emeraldTip", "radiantTip", "pearTip", "ovalTip", "heartTip", "asscherTip", "cushionTip");
var caratItems = new Array("ring1Cell", "ring2Cell", "ring3Cell", "ring4Cell", "ring5Cell", "ring6Cell", "ring7Cell", "ring8Cell", "ring9Cell", "ring10Cell");
var colorItems = new Array("dGradeItem", "eGradeItem", "fGradeItem", "gGradeItem", "hGradeItem", "iGradeItem", "jGradeItem", "kmGradeItem", "nrGradeItem", "szGradeItem");
var colorTips = new Array("dTip", "eTip", "fTip", "gTip", "hTip", "iTip", "jTip", "kmTip", "nrTip", "szTip");
var clarityItems = new Array("flItem", "ifItem", "vvsItem", "vsItem", "siclItem", "iclItem");
var clarityTips = new Array("flTip", "ifTip", "vvsTip", "vsTip", "siclTip", "iclTip");
var anatomyItems = new Array("diameterItem", "tableItem", "crownItem", "girdleItem", "pavilionItem", "culetItem", "depthItem");
var ratioItems = new Array("princessRatioItem", "marquiseRatioItem", "emeraldRatioItem", "radiantRatioItem", "pearRatioItem", "ovalRatioItem", "heartRatioItem", "asscherRatioItem", "cushionRatioItem");
var ratioTips = new Array("princessRatioTip", "marquiseRatioTip", "emeraldRatioTip", "radiantRatioTip", "pearRatioTip", "ovalRatioTip", "heartRatioTip", "asscherRatioTip", "cushionRatioTip");

var cutGradeContent = new Array("ctBox", "ctgrdBox");

function ipSetSelectedItem(pSelectedItemId, pItemGroupIds) {
	for (var i = 0; i < pItemGroupIds.length; i++) {
		if (pSelectedItemId == pItemGroupIds[i]) {
			$("#" + pSelectedItemId).addClass("selected");
		} else {
			$("#" + pItemGroupIds[i]).removeClass("selected");
		}
	}
}

function ipSetSelectedSubMenuItem(pSelectedItemId, pItemGroupIds, pClassName) {
	for (var i = 0; i < pItemGroupIds.length; i++) {
		if (pSelectedItemId == pItemGroupIds[i]) {
			$("#" + pSelectedItemId).addClass(pClassName);
		} else {
			$("#" + pItemGroupIds[i]).removeClass('selected');
			$("#" + pItemGroupIds[i]).removeClass('firstSelected');
			$("#" + pItemGroupIds[i]).removeClass('lastSelected');
		}
	}
}

function ipSetContent(pSelectedContentId, pContentGroupIds) {
	for (var i = 0; i < pContentGroupIds.length; i++) {
		if (pSelectedContentId == pContentGroupIds[i]) {
			$("#" + pContentGroupIds[i]).css("display", "block");
		} else {
			$("#" + pContentGroupIds[i]).css("display", "none");
		}
	}
}

function ipMoveArrowHorizontally(pContainerId, pOffsetAmount) {
	$("#" + pContainerId + " img.dynamicArrow").css("left", pOffsetAmount + "px");
}

function ipMoveArrowVertically(pContainerId, pOffsetAmount) {
	$("#" + pContainerId + " img.dynamicArrow").css("top", pOffsetAmount + "px");
}

function ipSwapImage(pImageId, pImageFileName) {
	document.getElementById(pImageId).src="cgi/en/img/ip/" + pImageFileName;
}

function ipCheckInput(pInputId) {
	document.getElementById(pInputId).checked = "checked";
}
