﻿/* Styles2 javascript file controls all drop down authentication and display
	create 07/12/09 daf
*/	
		
		var itemCntr;
		var itemCntr2;
		var itemMsg;
		var itemMsg1;
		var itemMsg2;
		var itemMsg3;
		var temp2;
		var temp3;
		var temp4;
		var temp5;
		var tempG1;
		var tempV1;
		var ITNValue;
		var ITNValue2;
		var elem2;
		var elem3;
		var DisplayDiv;
		var DisplayDiv2;
		var VkitItemNo;
		var strBad;
		var L1SelectedItem1;
		var L2SelectedItem1;
		var selectedItem1;
		var selectedItem2;
		var selectedItem3;
		var selectedItem4;
		var formSelectedItem1;
		var formSelectedItem2;
		var formSelectedItem3;
		var formSelectedItem4;
function Get_Cookie( check_name ) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f
	
	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );
		
		
		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
	
		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found ) 
	{
		return null;
	}
}

function Set_Cookie( name, value, expires, path, domain, secure ) {
	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );
	// if the expires variable is set, make the correct expires time, the
	// current script below will set it for x number of days, to make it
	// for hours, delete * 24, for minutes, delete * 60 * 24
	if ( expires )
	{
		expires = expires * 1000 * 60 * 60 * 24;
	}
	//alert( 'today ' + today.toGMTString() );// this is for testing purpose only
	var expires_date = new Date( today.getTime() + (expires) );
	//alert('expires ' + expires_date.toGMTString());// this is for testing purposes only

	document.cookie = name + "=" +escape( value ) +
		( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + //expires.toGMTString()
		( ( path ) ? ";path=" + path : "" ) + 
		( ( domain ) ? ";domain=" + domain : "" ) +
		( ( secure ) ? ";secure" : "" );
}

// this deletes the cookie when called
function Delete_Cookie( name, path, domain ) {
	if ( Get_Cookie( name ) ) document.cookie = name + "=" +
			( ( path ) ? ";path=" + path : "") +
			( ( domain ) ? ";domain=" + domain : "" ) +
			";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
function checkNoStyleCookie() {
	//alert("got Here ");
	var FullItemNo = document.getElementById("ITN").value;
	//alert("FullItemNo = " + FullItemNo);
	//if (Get_Cookie('ItemNo')) {
	//	alert( 'WTF ' + Get_Cookie('ItemNo'));
	//}
	if (Get_Cookie('ItemNo')) Delete_Cookie('ItemNo', '/', '');
	//alert('Still Here ' + Get_Cookie('ItemNo'));
	Set_Cookie('ItemNo', FullItemNo, 1, '/', '', '');
}
function checkNoStyleGroupedCookie(icount) {
	//alert("got Here ");
	var FullItemNo = document.getElementById("ITN"+icount).value;
	//alert("FullItemNo = " + FullItemNo);
	//if (Get_Cookie('ItemNo')) {
	//	alert( 'WTF ' + Get_Cookie('ItemNo'));
	//}
	if (Get_Cookie('ItemNo')) Delete_Cookie('ItemNo', '/', '');
	//alert('Still Here ' + Get_Cookie('ItemNo'));
	Set_Cookie('ItemNo', FullItemNo, 1, '/', '', '');
}
function formatCurrency(num) {
			num = isNaN(num) || num === '' || num === null ? 0.00 : num;
			return parseFloat(num).toFixed(2);
}
function setStyleG2(icount) {
			//alert("Here's the icount value " + icount);
			var priceSelect = document.getElementById("styleG1" + icount);
			itemCntr = priceSelect.selectedIndex;
			//alert(itemCntr);
			strBad = "No Longer Available";
			temp2 = new Array;
			temp2 = priceSelect.options[priceSelect.selectedIndex].value.split('|');
			itemMsg = priceSelect.options[priceSelect.options.selectedIndex].text;
			ITNValue2 = document.getElementById("Item_Root");
			ITNValue2.value = ITNValue2.value + ' ' + temp2[1];
			document.getElementById("ITN").value = ITNValue2.value;
			var currentPrice = document.getElementById("GroupedItem_CurrentPrice1");
			var priceOutput = "Price: $" + formatCurrency(temp2[0] / 100);
			currentPrice.innerHTML = priceOutput.bold();
			if (document.getElementById("styleG2") != null) {
				document.getElementById("styleG2").disabled = "";
			}
}
function set3LevelStyleG2(icount) {
	//alert(icount);
	var currentPrice;
	var priceSelect = document.getElementById("styleG1" + icount);
	temp3 = new Array;
	temp3 = priceSelect.options[priceSelect.selectedIndex].value.split('|');
	var itemCntr = priceSelect.selectedIndex;
	if (itemCntr == 0) {
		L1SelectedItem1 = document.getElementById("L1Selection")
		L2SelectedItem1 = document.getElementById("L2Selection")
		elem = document.getElementById("LevelG2" + icount + "_" + L1SelectedItem1.value);
		elem2 = document.getElementById("styleG2" + icount + "_" + L1SelectedItem1.value);
		elem2.selectedIndex = 0;
		elem.style.display = "none";
		if (document.getElementById("LevelG3" + icount + "_" + L1SelectedItem1.value) != null) {
			document.getElementById("LevelG3" + icount + "_" + L1SelectedItem1.value).style.display = "none";
		}
		document.getElementById("styleG1" + icount).focus;
		return false;
	}
	if (DisplayDiv != null) {
		//elem.style.display = "none";
		//alert('this is getting fired here');
	}
	elem = document.getElementById("LevelG2" + icount + "_" + temp3[1]);
	elem.style.display = "block";
	var L1SelectedItem = document.getElementById("L1Selection")
	L1SelectedItem.value = temp3[1];
	currentPrice = document.getElementById("GroupedItem_CurrentPrice" + icount);
	var priceOutput = "Price: $" + formatCurrency(temp3[0] / 100);
	currentPrice.innerHTML = priceOutput.bold();

	
		
}
function set3LevelStyleG3(icount) {
	//alert(icount);
	var L1SelectedItem = document.getElementById("L1Selection")
	DisplayDiv = L1SelectedItem.value;
	//alert(DisplayDiv);
	var styleSelect = document.getElementById("styleG2" + icount + "_" + DisplayDiv);
	itemCntr = styleSelect.selectedIndex;
	//alert(itemCntr);
	if (itemCntr == 0) {
		alert("Please " + styleSelect.options[0].text);
		L1SelectedItem1 = document.getElementById("L1Selection")
		L2SelectedItem1 = document.getElementById("L2Selection")
		if (document.getElementById("LevelG3" + icount + "_" + L1SelectedItem1.value) != null) {
			document.getElementById("LevelG3" + icount + "_" + L1SelectedItem1.value).style.display = "none";
		}
		document.getElementById("styleG2" + icount + "_" + L1SelectedItem1.value).focus;
		return false;

	}
	temp4 = new Array;
	temp4 = styleSelect.options[styleSelect.selectedIndex].value.split('|');
	if (DisplayDiv2 != null) {
		//elem.style.display = "none";
		//alert("this code is displayed here");
	}
	DisplayDiv2 = temp4[1];
	var L2SelectedItem = document.getElementById("L2Selection")
	L2SelectedItem.value = temp4[1];
	elem = document.getElementById("LevelG3" + icount + "_" + DisplayDiv2 + "_" + DisplayDiv);
	elem.style.display = "block";
}

function set3LevelStyleG4(icount) {
	//alert(icount);
	var L1SelectedItem = document.getElementById("L1Selection")
	var L2SelectedItem = document.getElementById("L2Selection")
	var ITNValue = document.getElementById("Item_Root"+icount);
	DisplayDiv = L1SelectedItem.value;
	DisplayDiv2 = L2SelectedItem.value;
	//alert("Here's DisplayDiv "  + DisplayDiv);
	//alert("Here's DisplayDiv2 " + DisplayDiv2);
	var styleSelect = document.getElementById("styleG2" + icount + "_" + DisplayDiv);
	var styleSelect2 = document.getElementById("styleG3" + icount + "_" + DisplayDiv2 + "_" + DisplayDiv);
	itemCntr = styleSelect.selectedIndex;
	//alert(itemCntr);
	if (itemCntr == 0) {
		alert("Please " + styleSelect.options[0].text);
		L1SelectedItem1 = document.getElementById("L1Selection")
		L2SelectedItem1 = document.getElementById("L2Selection")
		if (document.getElementById("LevelG3" + icount + "_" + L1SelectedItem1.value) != null) {
			document.getElementById("LevelG3" + icount + "_" + L1SelectedItem1.value).style.display = "none";
		}
		document.getElementById("styleG2" + icount + "_" + L1SelectedItem1.value).focus;
		return false;

	}
	temp4 = new Array;
	temp4 = styleSelect2.options[styleSelect2.selectedIndex].value.split('|');
	//alert("Here's the 1st temp4 " + temp4[0]);
	//alert("Here's the 2nd temp4 " + temp4[1]);
	//alert("Here's the 3rd temp4 " + temp4[2]);
	//alert("Here's the 4th temp4 " + temp4[3]);
	//if (DisplayDiv2 != null) {
	//	elem.style.display = "none";
	//}
	DisplayDiv2 = temp4[1];
	var L2SelectedItem = document.getElementById("L2Selection")
	L2SelectedItem.value = temp4[1];
	//elem = document.getElementById("LevelG3" + icount + "_" + DisplayDiv2 + "_" + DisplayDiv);
	//elem.style.display = "block";
	var FullItemNo = ITNValue.value + ' ' + temp4[1] + ' ' + temp4[2] + ' ' + temp4[3];
	//alert("Here's your FullItemNo " + FullItemNo);
	document.getElementById("ITN").value = FullItemNo;
	//alert("Here's your ITN value " + document.getElementById("ITN").value);
}
function set2LevelStyleG2(icount) {
	//alert(icount);
	var priceSelect = document.getElementById("styleG1" + icount);
	var itemCntr = priceSelect.selectedIndex;
	//alert(itemCntr);

	if (itemCntr == 0) {
		alert("Please " + priceSelect.options[0].text);
		return false;
	}
	temp2 = new Array;
	temp2 = priceSelect.options[priceSelect.selectedIndex].value.split('|');
	ITNValue = document.getElementById("Item_Root");
	var currentPrice = document.getElementById("GroupedItem_CurrentPrice1");
	var priceOutput = "Price: $" + formatCurrency(temp2[0] / 100);
	//alert(priceOutput);
	currentPrice.innerHTML = priceOutput.bold();
	if (DisplayDiv != null) {
		elem.style.display = "none";
	}
	DisplayDiv = temp2[1];
	//alert(DisplayDiv);
	elem = document.getElementById("LevelG2" + icount + "_" + DisplayDiv);
	elem.style.display = "block";

	if (document.getElementById("styleG2") != null) {
		document.getElementById("styleG2").disabled = "";


	}

}
function set2LevelStyleG3(icount) {
	//alert(icount);
	var styleSelect = document.getElementById("styleG2" + icount + "_" + DisplayDiv);
	var ITNValue = document.getElementById("Item_Root" + icount);
	itemCntr = styleSelect.selectedIndex;
	if (itemCntr >= 1) {
		//document.getElementById("I1").disabled = "";
		//} else if (itemCntr == 0) {
		//document.getElementById("I1").disabled = "disabled";
		//} else {
		//	document.getElementById("I1").disabled = "disabled";
	}
	temp3 = new Array;
	temp3 = styleSelect.options[styleSelect.selectedIndex].value.split('|');
	var FullItemNo = ITNValue.value + ' ' + temp3[2] + ' ' + temp3[1];
	//alert("Here is the current FullItemNo " + FullItemNo);
	document.getElementById("ITN2" + icount).value = FullItemNo;
	//alert("Here is the current ITN2" + icount + "value " + document.getElementById("ITN2" + icount).value);
	
}
function checkStyleG2() {
	strBad = "No Longer Available";
	var priceSelect1 = document.getElementById('styleG1');
	temp2 = new Array;
	temp2 = priceSelect1.options[priceSelect1.selectedIndex].value.split('|');
	var priceSelect2 = document.getElementById('styleG2_' + temp2[1]);
	itemMsg1 = priceSelect1.options[priceSelect1.options.selectedIndex].text;
	itemMsg2 = priceSelect2.options[priceSelect2.options.selectedIndex].text;

	var oStr1 = new String(itemMsg1);
	if (oStr1.indexOf(strBad) >= 0) {
		var intEnd1;
		var strOption1;
		intEnd1 = oStr1.indexOf("-") - 1;
		strOption1 = oStr1.substring(0, intEnd1);
		alert("Sorry, " + strOption1 + " is no longer available.\nPlease make another selection.");
		return false;
	}
	var oStr2 = new String(itemMsg2);

	if (oStr2.indexOf(strBad) >= 0) {
		var intEnd2;
		var strOption2;
		intEnd2 = oStr2.indexOf("-");
		strOption2 = oStr2.substring(0, intEnd2);
		alert("Sorry, " + strOption2 + " is no longer available.\nPlease make another selection.");
		return false;
	}


}
function checkGroupedStyle2(icount) {
	//alert(icount);
	strBad = "No Longer Available";
	var priceSelect1 = document.getElementById("styleG1" + icount);
	temp2 = new Array;
	temp2 = priceSelect1.options[priceSelect1.selectedIndex].value.split('|');
	//alert("here's the first temp2 " + temp2[0]);
	//alert("here's the 2nd temp2 " + temp2[1]);
	ITNValue = document.getElementById("Item_Root"+icount);
	//alert("Here's the current ITNValue " + ITNValue.value);

	var itemCntr = priceSelect1.selectedIndex;
	if (itemCntr == 0) {
		alert("Please " + priceSelect1.options[0].text);
		return false;
	}
	var priceSelect2 = document.getElementById("styleG2" + icount + "_" + temp2[1]);
	temp3 = new Array;
	temp3 = priceSelect2.options[priceSelect2.selectedIndex].value.split('|');
	//alert("here's the first temp3 " + temp3[0]);
	//alert("here's the 2nd temp3 " + temp2[3]);

	var itemCntr2 = priceSelect2.selectedIndex;
	if (itemCntr2 == 0) {
		alert("Please " + priceSelect2.options[0].text);
		return false;
	}
	itemMsg1 = priceSelect1.options[priceSelect1.options.selectedIndex].text;
	itemMsg2 = priceSelect2.options[priceSelect2.options.selectedIndex].text;
	var oStr1 = new String(itemMsg1);
	if (oStr1.indexOf(strBad) >= 0) {
		var intEnd1;
		var strOption1;
		intEnd1 = oStr1.indexOf("-") - 1;
		strOption1 = oStr1.substring(0, intEnd1);
		alert("Sorry, " + strOption1 + " is no longer available.\nPlease make another selection.");
		return false;
	}
	var oStr2 = new String(itemMsg2);

	if (oStr2.indexOf(strBad) >= 0) {
		var intEnd2;
		var strOption2;
		intEnd2 = oStr2.indexOf("-");
		strOption2 = oStr2.substring(0, intEnd2);
		alert("Sorry, " + strOption2 + " is no longer available.\nPlease make another selection.");
		return false;
	}
	//var FullItemNo = ITNValue.value + ' ' + temp3[1] + ' ' + temp2[1];
	var FullItemNo = document.getElementById("ITN2"+icount).value;
	//alert("Here's the FullItemNo" + document.getElementById("ITN2" + icount).value);
	if (Get_Cookie('ItemNo')) Delete_Cookie('ItemNo', '/', '');
	Set_Cookie('ItemNo', FullItemNo, 1, '/', '', '');	
}
function checkGroupedStyle1(icount) {
	//alert(icount);
	strBad = "No Longer Available";
	var priceSelect1 = document.getElementById("styleG1" + icount);
	ITNValue = document.getElementById("Item_Root"+icount);
	//alert(ITNValue.value);
	//alert(priceSelect1.options[priceSelect1.options.selectedIndex].text);
	temp2 = new Array;
	temp2 = priceSelect1.options[priceSelect1.selectedIndex].value.split('|');
	//alert(temp2[0]);
	//alert(temp2[1]);
	var itemCntr = priceSelect1.selectedIndex;
	if (itemCntr == 0) {
		alert("Please " + priceSelect1.options[0].text);
		return false;
	}
	itemMsg1 = priceSelect1.options[priceSelect1.options.selectedIndex].text;
	var oStr1 = new String(itemMsg1);
	if (oStr1.indexOf(strBad) >= 0) {
		var intEnd1;
		var strOption1;
		intEnd1 = oStr1.indexOf("-");
		strOption1 = oStr1.substring(0, intEnd1);
		alert("Sorry, " + strOption1 + " is no longer available.\nPlease make another selection.");
		return false;
	}
	var FullItemNo = ITNValue.value + ' ' + temp2[1];
	//alert(FullItemNo);
	if (Get_Cookie('ItemNo')) Delete_Cookie('ItemNo', '/', '');
	Set_Cookie('ItemNo', FullItemNo, 1, '/', '', '');
	//if (Get_Cookie('ItemNo')) alert(Get_Cookie('ItemNo'));

	//var L1Selection = document.getElementById("L1Selection"+icount)
	//L1Selection.value = FullItemNo;
	//document.getElementById("L1Selection").value = FullItemNo;
	//document.getElementById("ITN1"+icount).value = FullItemNo;
	//alert("Here's the ITN1"+icount+" Value " + L1Selection.value);

}
function checkGroupedStyle3(icount) {
	strBad = "No Longer Available";
	var priceSelect1 = document.getElementById("styleG1" + icount);
	temp2 = new Array;
	temp2 = priceSelect1.options[priceSelect1.selectedIndex].value.split('|');
	var priceSelect2 = document.getElementById("styleG2"+icount+ "_" + temp2[1]);
	temp3 = new Array;
	temp3 = priceSelect2.options[priceSelect2.selectedIndex].value.split('|');
	var priceSelect3 = document.getElementById("styleG3" + icount + "_" + temp3[1] + "_" + temp2[1]);
	itemMsg1 = priceSelect1.options[priceSelect1.options.selectedIndex].text;
	itemMsg2 = priceSelect2.options[priceSelect2.options.selectedIndex].text;
	itemMsg3 = priceSelect3.options[priceSelect3.options.selectedIndex].text;
	//alert(itemMsg1);
	//alert(itemMsg2);
	//alert(itemMsg3);
	var oStr1 = new String(itemMsg1);
	if (oStr1.indexOf(strBad) >= 0) {
		var intEnd1;
		var strOption1;
		intEnd1 = oStr1.indexOf("-") - 1;
		strOption1 = oStr1.substring(0, intEnd1);
		alert("Sorry, " + strOption1 + " is no longer available.\nPlease make another selection.");
		return false;
	}
	var oStr2 = new String(itemMsg2);
	if (oStr2.indexOf(strBad) >= 0) {
		var intEnd2;
		var strOption2;
		intEnd2 = oStr2.indexOf("-");
		strOption2 = oStr2.substring(0, intEnd2);
		alert("Sorry, " + strOption2 + " is no longer available.\nPlease make another selection.");
		return false;
	}
	var oStr3 = new String(itemMsg3);
	if (oStr3.indexOf(strBad) >= 0) {
		var intEnd3;
		var strOption3;
		intEnd3 = oStr3.indexOf("-");
		strOption3 = oStr2.substring(0, intEnd3);
		alert("Sorry, " + strOption3 + " is no longer available.\nPlease make another selection.");
		return false;
	}
	var FullItemNo = document.getElementById("ITN").value;
	//alert(FullItemNo);
	if (Get_Cookie('ItemNo')) Delete_Cookie('ItemNo', '/', '');
	Set_Cookie('ItemNo', FullItemNo, 1, '/', '', '');
	
}		










		
		//older code 
		function setStyle2() {
			var priceSelect = document.getElementById("style1");
			itemCntr = priceSelect.selectedIndex;
			strBad = "No Longer Available";
			temp2 = new Array;
			temp2 = priceSelect.options[priceSelect.selectedIndex].value.split('|');
			itemMsg = priceSelect.options[priceSelect.options.selectedIndex].text;
			ITNValue2 = document.getElementById("Item_Root");
			ITNValue2.value = ITNValue2.value + ' ' + temp2[1];
			
			document.getElementById("ITN").value = ITNValue2.value;

			var currentPrice = document.getElementById("Item_CurrentPrice");
			var priceOutput = "Price: $" + formatCurrency(temp2[0] / 100);
			currentPrice.innerHTML = priceOutput.bold();


			if (document.getElementById("style2") != null) {
				document.getElementById("style2").disabled = "";


			}
		}
        function set3LevelStyle2() {
        var priceSelect = document.getElementById("style1");
        temp3 = new Array;
       	temp3 = priceSelect.options[priceSelect.selectedIndex].value.split('|');
		var itemCntr = priceSelect.selectedIndex;
			if (itemCntr == 0) {
                L1SelectedItem1 = document.getElementById("L1Selection")
                L2SelectedItem1 = document.getElementById("L2Selection")
				
				elem = document.getElementById("Level2_"+L1SelectedItem1.value);
				elem2 = document.getElementById("style2_"+L1SelectedItem1.value);
				elem2.selectedIndex = 0;
				elem.style.display = "none";
				if (document.getElementById("Level3_"+L1SelectedItem1.value) != null) {
					document.getElementById("Level3_"+L1SelectedItem1.value).style.display = "none";
				}	
				document.getElementById("style1").focus;
				return false;
			}
			if (DisplayDiv != null) {
				elem.style.display = "none";
			}
			elem = document.getElementById("Level2_" + temp3[1]);
			elem.style.display = "block";
			var L1SelectedItem = document.getElementById("L1Selection")
			L1SelectedItem.value = temp3[1];
			var currentPrice = document.getElementById("Item_CurrentPrice");
			var priceOutput = "Price: $" + formatCurrency(temp3[0] / 100);
			currentPrice.innerHTML = priceOutput.bold();
		}
		function set3LevelStyle3() {
			var L1SelectedItem = document.getElementById("L1Selection")
			DisplayDiv = L1SelectedItem.value;
			var styleSelect = document.getElementById("style2_" + DisplayDiv);
			itemCntr = styleSelect.selectedIndex;
			if (itemCntr == 0) {
				alert("Please " + styleSelect.options[0].text);
				L1SelectedItem1 = document.getElementById("L1Selection")
                L2SelectedItem1 = document.getElementById("L2Selection")
				if (document.getElementById("Level3_"+L1SelectedItem1.value) != null) {
					document.getElementById("Level3_"+L1SelectedItem1.value).style.display = "none";
				}	
				document.getElementById("style2_"+L1SelectedItem1.value).focus;
				return false;
				
			}
			temp4 = new Array;
			temp4 = styleSelect.options[styleSelect.selectedIndex].value.split('|');
			if (DisplayDiv2 != null) {
				elem.style.display = "none";
			}
			DisplayDiv2 = temp4[1];
			var L2SelectedItem = document.getElementById("L2Selection")
			L2SelectedItem.value = temp4[1];
			elem = document.getElementById("Level3_" + DisplayDiv2 + "_" + DisplayDiv);
			elem.style.display = "block";
		}
		function set3LevelStyle4() {
			var L1SelectedItem = document.getElementById("L1Selection")
			var L2SelectedItem = document.getElementById("L2Selection")
			DisplayDiv = L1SelectedItem.value;
			DisplayDiv2 = L2SelectedItem.value;
			var styleSelect2 = document.getElementById("style3_"+ DisplayDiv2 + "_" + DisplayDiv);
			itemCntr2 = styleSelect2.selectedIndex;

			if (itemCntr2 == 0) {
				alert("Please " + styleSelect2.options[0].text);
			}
			temp5 = new Array;
			temp5 = styleSelect2.options[styleSelect2.selectedIndex].value.split('|');
			ITNValue = document.getElementById("Item_Root");
			var FullItemNo = ITNValue.value + ' ' + temp5[1] + ' ' + temp5[2] + ' ' + temp5[3];
			//alert(FullItemNo);
			document.getElementById("ITN").value = FullItemNo;
			
		}       
		function set2LevelStyle2() {
			var priceSelect = document.getElementById("style1");
			var itemCntr = priceSelect.selectedIndex;
			
			if (itemCntr == 0) {
				alert("Please " + priceSelect.options[0].text);
				return false;
			}	
			temp2 = new Array;
			temp2 = priceSelect.options[priceSelect.selectedIndex].value.split('|');
			ITNValue = document.getElementById("Item_Root");
			var currentPrice = document.getElementById("Item_CurrentPrice");
			var priceOutput = "Price: $" + formatCurrency(temp2[0] / 100);
			//alert(priceOutput);
			currentPrice.innerHTML = priceOutput.bold();
			if (DisplayDiv != null) {
				elem.style.display = "none";
			}
			DisplayDiv = temp2[1];
			//alert(DisplayDiv);
			elem = document.getElementById("Level2_" + DisplayDiv);
			elem.style.display = "block";
			
			if (document.getElementById("style2") != null) {
				document.getElementById("style2").disabled = "";
            

			}

		}

		function set2LevelStyle3() {
			var styleSelect = document.getElementById("style2_" + DisplayDiv);
			itemCntr = styleSelect.selectedIndex;
			if (itemCntr >= 1) {
			document.getElementById("I1").disabled = "";
			} else if (itemCntr == 0) {
			document.getElementById("I1").disabled = "disabled";
			} else {
				document.getElementById("I1").disabled = "disabled";
			}
			temp3 = new Array;
			temp3 = styleSelect.options[styleSelect.selectedIndex].value.split('|');
            var FullItemNo = ITNValue.value + ' ' + temp3[2] + ' ' + temp3[1];
            //alert(FullItemNo);
            document.getElementById("ITN").value = FullItemNo;
            var currentPrice = document.getElementById("Item_CurrentPrice");
			var priceOutput = "Price: $" + formatCurrency(temp3[0] / 100);
			currentPrice.innerHTML = priceOutput.bold();

		}
		function setStyle4() {
			var styleSelect = document.getElementById("style3");
			itemCntr = styleSelect.selectedIndex;
			//alert(itemCntr)
			temp4 = new Array;
			temp5 = new Array;
			temp5 = document.getElementById("Item_Root").value.split(' ');
			temp4 = styleSelect.options[styleSelect.selectedIndex].value.split('|');

			ITNValue2.value = temp5[0] + ' ' + temp4[1] + ' ' + temp5[1] + ' ' + temp5[2];
			document.getElementById("ITN").value = ITNValue2.value;
			//alert(document.getElementById("ITN").value);

			if (document.getElementById("style3") != null) {
				document.getElementById("style3").disabled = "";
			}
		}
		function checkStyle1() {
			strBad = "No Longer Available";
			var priceSelect = document.getElementById('style1');
			Temp1 = new Array;
			Temp1 = priceSelect.options[priceSelect.selectedIndex].value.split('|');
			//alert("here's the first Temp1 " + Temp1[0]);
			//alert("here's the 2nd Temp1 " + Temp1[1]);
			ITNValue = document.getElementById("Item_Root");
			//alert("Here's the ITN value " + ITNValue.value); 
			itemMsg = priceSelect.options[priceSelect.options.selectedIndex].text;
			var itemCntr = priceSelect.selectedIndex;
			if (itemCntr == 0) {
				alert("Please " + priceSelect.options[0].text);
				return false;
			}
			var oStr = new String(itemMsg);
			if (oStr.indexOf(strBad) >= 0) {
				var intEnd;
				var strOption;
				intEnd = oStr.indexOf("-") ;
				strOption = oStr.substring(0, intEnd);
				alert("Sorry, " + strOption + " is no longer available.\nPlease make another selection.");
				return false;
			}
			var FullItemNo = ITNValue.value ;
			//alert("here's the Full ItemNo " + FullItemNo);
			if (Get_Cookie('ItemNo')) Delete_Cookie('ItemNo', '/', '');
			Set_Cookie('ItemNo', FullItemNo, 1, '/', '', '');
			//if (Get_Cookie('ItemNo')) alert("Here's your Cookie " + Get_Cookie('ItemNo'));
		}
		function checkStyle2() {
			strBad = "No Longer Available";
			var priceSelect1 = document.getElementById('style1');
			temp2 = new Array;
			temp2 = priceSelect1.options[priceSelect1.selectedIndex].value.split('|');
			var priceSelect2 = document.getElementById('style2_'+temp2[1]);
			itemMsg1 = priceSelect1.options[priceSelect1.options.selectedIndex].text;
			itemMsg2 = priceSelect2.options[priceSelect2.options.selectedIndex].text;
			
			var oStr1 = new String(itemMsg1);
			if (oStr1.indexOf(strBad) >= 0) {
				var intEnd1;
				var strOption1;
				intEnd1 = oStr1.indexOf("-") - 1;
				strOption1 = oStr1.substring(0, intEnd1);
				alert("Sorry, " + strOption1 + " is no longer available.\nPlease make another selection.");
				return false;
			}
				var oStr2 = new String(itemMsg2);
				
				if (oStr2.indexOf(strBad) >= 0) {
					var intEnd2;
					var strOption2;
					intEnd2 = oStr2.indexOf("-");
					strOption2 = oStr2.substring(0, intEnd2);
					alert("Sorry, " + strOption2 + " is no longer available.\nPlease make another selection.");
					return false;
				}


			}
			function checkNGStyle2() {
				strBad = "No Longer Available";
				var priceSelect1 = document.getElementById('style1');
				temp2 = new Array;
				temp2 = priceSelect1.options[priceSelect1.selectedIndex].value.split('|');
				var itemCntr = priceSelect1.selectedIndex;
				if (itemCntr == 0) {
					alert("Please " + priceSelect1.options[0].text);
					return false;
				}
				var priceSelect2 = document.getElementById('style2_' + temp2[1]);
				var itemCntr2 = priceSelect2.selectedIndex;
				if (itemCntr2 == 0) {
					alert("Please " + priceSelect2.options[0].text);
					return false;
				}
				itemMsg1 = priceSelect1.options[priceSelect1.options.selectedIndex].text;
				itemMsg2 = priceSelect2.options[priceSelect2.options.selectedIndex].text;

				var oStr1 = new String(itemMsg1);
				if (oStr1.indexOf(strBad) >= 0) {
					var intEnd1;
					var strOption1;
					intEnd1 = oStr1.indexOf("-") - 1;
					strOption1 = oStr1.substring(0, intEnd1);
					alert("Sorry, " + strOption1 + " is no longer available.\nPlease make another selection.");
					return false;
				}
				var oStr2 = new String(itemMsg2);

				if (oStr2.indexOf(strBad) >= 0) {
					var intEnd2;
					var strOption2;
					intEnd2 = oStr2.indexOf("-");
					strOption2 = oStr2.substring(0, intEnd2);
					alert("Sorry, " + strOption2 + " is no longer available.\nPlease make another selection.");
					return false;
				}
					var FullItemNo = document.getElementById("ITN").value;
	                //alert(FullItemNo);
	                if (Get_Cookie('ItemNo')) Delete_Cookie('ItemNo', '/', '');
	                Set_Cookie('ItemNo', FullItemNo, 1, '/', '', '');

			}
			function checkVKStyle1(icount) {
				//alert(selectedItem1);
				//alert(selectedItem2);
				//alert(selectedItem3);
				strBad = "No Longer Available";
				if (document.getElementById("vstyle1") != null) {
					//alert("vstyle1 is alive!");
					var priceSelect1 = document.getElementById("vstyle1");
					itemMsg1 = priceSelect1.options[priceSelect1.options.selectedIndex].text;
					var itemCntr1 = priceSelect1.selectedIndex;
					if (itemCntr1 == 0) {
						alert("Please " + priceSelect1.options[0].text);
						return false;
					}
					var oStr1 = new String(itemMsg1);
					if (oStr1.indexOf(strBad) >= 0) {
						var intEnd1;
						var strOption1;
						intEnd1 = oStr1.indexOf("-") - 1;
						strOption1 = oStr1.substring(0, intEnd1);
						alert("Sorry, " + strOption1 + " is no longer available.\nPlease make another selection.");
						return false;
					}
					//alert(formSelectedItem1.value);

				}
				if (document.getElementById("vstyle2") != null) {
					//alert("vstyle2 is alive!");
					var priceSelect2 = document.getElementById("vstyle2");
					itemMsg2 = priceSelect2.options[priceSelect2.options.selectedIndex].text;
					var itemCntr2 = priceSelect2.selectedIndex;
					if (itemCntr2 == 0) {
						alert("Please " + priceSelect2.options[0].text);
						return false;
					}
					var oStr2 = new String(itemMsg2);
					if (oStr2.indexOf(strBad) >= 0) {
						var intEnd2;
						var strOption2;
						intEnd2 = oStr2.indexOf("-");
						strOption2 = oStr2.substring(0, intEnd2);
						alert("Sorry, " + strOption2 + " is no longer available.\nPlease make another selection.");
						return false;
					}
					//alert(formSelectedItem2.value);

				}
				if (document.getElementById("vstyle3") != null) {
					//alert("vstyle3 is alive!");
					var priceSelect3 = document.getElementById("vstyle3");
					itemMsg3 = priceSelect3.options[priceSelect3.options.selectedIndex].text;
					var itemCntr3 = priceSelect3.selectedIndex;
					if (itemCntr3 == 0) {
						alert("Please " + priceSelect3.options[0].text);
						return false;
					}
					var oStr3 = new String(itemMsg3);
					if (oStr3.indexOf(strBad) >= 0) {
						var intEnd3;
						var strOption3;
						intEnd3 = oStr3.indexOf("-");
						strOption3 = oStr3.substring(0, intEnd3);
						alert("Sorry, " + strOption3 + " is no longer available.\nPlease make another selection.");
						return false;
					}

					//alert(formSelectedItem3.value);
				}
				var FullItemNo3 = document.getElementById("ITN");
				//alert("Here's the FullItemNo " + FullItemNo3.value);
				//alert("Here's the FullItemNo" + document.getElementById("ITN2" + icount).value);
				if (Get_Cookie('ItemNo')) Delete_Cookie('ItemNo', '/', '');
				Set_Cookie('ItemNo', document.getElementById("ITN"), 1, '/', '', '');
				//if (Get_Cookie('ItemNo')) alert("Here you go" + Get_Cookie('ItemNo'));
				//return false;
				
				
			}									
		function checkStyle3() {
			strBad = "No Longer Available";
			var priceSelect1 = document.getElementById('style1');
			temp2 = new Array;
			temp2 = priceSelect1.options[priceSelect1.selectedIndex].value.split('|');
			var priceSelect2 = document.getElementById('style2_' + temp2[1]);
			temp3 = new Array;
			temp3 = priceSelect2.options[priceSelect2.selectedIndex].value.split('|');
			var priceSelect3 = document.getElementById('style3_' + temp3[1]);
			itemMsg1 = priceSelect1.options[priceSelect1.options.selectedIndex].text;
			itemMsg2 = priceSelect2.options[priceSelect2.options.selectedIndex].text;
			itemMsg3 = priceSelect3.options[priceSelect3.options.selectedIndex].text;
			var oStr1 = new String(itemMsg1);
			if (oStr1.indexOf(strBad) >= 0) {
				var intEnd1;
				var strOption1;
				intEnd1 = oStr1.indexOf("-") - 1;
				strOption1 = oStr1.substring(0, intEnd1);
				alert("Sorry, " + strOption1 + " is no longer available.\nPlease make another selection.");
				return false;
			}
			var oStr2 = new String(itemMsg2);
			if (oStr2.indexOf(strBad) >= 0) {
				var intEnd2;
				var strOption2;
				intEnd2 = oStr2.indexOf("-");
				strOption2 = oStr2.substring(0, intEnd2);
				alert("Sorry, " + strOption2 + " is no longer available.\nPlease make another selection.");
				return false;
			}
			var oStr3 = new String(itemMsg3);
			if (oStr3.indexOf(strBad) >= 0) {
				var intEnd3;
				var strOption3;
				intEnd3 = oStr3.indexOf("-");
				strOption3 = oStr2.substring(0, intEnd3);
				alert("Sorry, " + strOption3 + " is no longer available.\nPlease make another selection.");
				return false;
			}
		}
		function checkNGStyle3() {
			strBad = "No Longer Available";
			var priceSelect1 = document.getElementById('style1');
			temp2 = new Array;
			temp2 = priceSelect1.options[priceSelect1.selectedIndex].value.split('|');
			//alert("Here's Level1: " + temp2[0]);
			//alert("Here's Level1: " +temp2[1]);
			//alert("Here's Level1: " +temp2[2]);
			var itemCntr = priceSelect1.selectedIndex;
			if (itemCntr == 0) {
				alert("Please " + priceSelect1.options[0].text);
				return false;
			}
			var priceSelect2 = document.getElementById('style2_' + temp2[1]);
			temp3 = new Array;
			temp3 = priceSelect2.options[priceSelect2.selectedIndex].value.split('|');
			var itemCntr2 = priceSelect2.selectedIndex;
			if (itemCntr2 == 0) {
				alert("Please " + priceSelect2.options[0].text);
				return false;
			}
			var priceSelect3 = document.getElementById('style3_' + temp3[1] + "_" + temp2[1]);
			var itemCntr3 = priceSelect3.selectedIndex;
			if (itemCntr3 == 0) {
				alert("Please " + priceSelect3.options[0].text);
				return false;
			}
			itemMsg1 = priceSelect1.options[priceSelect1.options.selectedIndex].text;
			itemMsg2 = priceSelect2.options[priceSelect2.options.selectedIndex].text;
			itemMsg3 = priceSelect3.options[priceSelect3.options.selectedIndex].text;
			var oStr1 = new String(itemMsg1);
			if (oStr1.indexOf(strBad) >= 0) {
				var intEnd1;
				var strOption1;
				intEnd1 = oStr1.indexOf("-") - 1;
				strOption1 = oStr1.substring(0, intEnd1);
				alert("Sorry, " + strOption1 + " is no longer available.\nPlease make another selection.");
				return false;
			}
			var oStr2 = new String(itemMsg2);
			if (oStr2.indexOf(strBad) >= 0) {
				var intEnd2;
				var strOption2;
				intEnd2 = oStr2.indexOf("-");
				strOption2 = oStr2.substring(0, intEnd2);
				alert("Sorry, " + strOption2 + " is no longer available.\nPlease make another selection.");
				return false;
			}
			var oStr3 = new String(itemMsg3);
			if (oStr3.indexOf(strBad) >= 0) {
				var intEnd3;
				var strOption3;
				intEnd3 = oStr3.indexOf("-");
				strOption3 = oStr2.substring(0, intEnd3);
				alert("Sorry, " + strOption3 + " is no longer available.\nPlease make another selection.");
				return false;
			}
			var FullItemNo = document.getElementById("ITN").value;
			//alert("Here's the FullItemNo" + FullItemNo);
			//alert("Here's the FullItemNo" + document.getElementById("ITN2" + icount).value);
			if (Get_Cookie('ItemNo')) Delete_Cookie('ItemNo', '/', '');
			Set_Cookie('ItemNo', FullItemNo, 1, '/', '', '');				
			
		}
		function checkgStyle1(icount) {
			//alert(icount);
			strBad = "No Longer Available";
			var priceSelect1 = document.getElementById("gstyle1"+icount);
			temp2 = new Array;
			temp2 = priceSelect1.options[priceSelect1.selectedIndex].value.split('|');
			var itemCntr = priceSelect1.selectedIndex;
			if (itemCntr == 0) {
				alert("Please " + priceSelect1.options[0].text);
				return false;
			}	
			itemMsg1 = priceSelect1.options[priceSelect1.options.selectedIndex].text;
			var oStr1 = new String(itemMsg1);
			if (oStr1.indexOf(strBad) >= 0) {
				var intEnd1;
				var strOption1;
				intEnd1 = oStr1.indexOf("-") ;
				strOption1 = oStr1.substring(0, intEnd1);
				alert("Sorry, " + strOption1 + " is no longer available.\nPlease make another selection.");
				return false;
			}
		}
		function checkgStyle3(icount) {
			strBad = "No Longer Available";
			var priceSelect1 = document.getElementById('gstyle1'+icount);
			temp2 = new Array;
			temp2 = priceSelect1.options[priceSelect1.selectedIndex].value.split('|');
			var priceSelect2 = document.getElementById('style2_' + temp2[1]);
			temp3 = new Array;
			temp3 = priceSelect2.options[priceSelect2.selectedIndex].value.split('|');
			var priceSelect3 = document.getElementById('gstyle2_' + temp3[1]);
			itemMsg1 = priceSelect1.options[priceSelect1.options.selectedIndex].text;
			itemMsg2 = priceSelect2.options[priceSelect2.options.selectedIndex].text;
			itemMsg3 = priceSelect3.options[priceSelect3.options.selectedIndex].text;
			var oStr1 = new String(itemMsg1);
			if (oStr1.indexOf(strBad) >= 0) {
				var intEnd1;
				var strOption1;
				intEnd1 = oStr1.indexOf("-") - 1;
				strOption1 = oStr1.substring(0, intEnd1);
				alert("Sorry, " + strOption1 + " is no longer available.\nPlease make another selection.");
				return false;
			}
			var oStr2 = new String(itemMsg2);
			if (oStr2.indexOf(strBad) >= 0) {
				var intEnd2;
				var strOption2;
				intEnd2 = oStr2.indexOf("-");
				strOption2 = oStr2.substring(0, intEnd2);
				alert("Sorry, " + strOption2 + " is no longer available.\nPlease make another selection.");
				return false;
			}
			var oStr3 = new String(itemMsg3);
			if (oStr3.indexOf(strBad) >= 0) {
				var intEnd3;
				var strOption3;
				intEnd3 = oStr3.indexOf("-");
				strOption3 = oStr2.substring(0, intEnd3);
				alert("Sorry, " + strOption3 + " is no longer available.\nPlease make another selection.");
				return false;
			}
		}		
		function setgStyle2(icount) {
			VkitItemNo = 'item' + icount;
			tempG1 = new Array;
			var priceSelect = document.getElementById('gstyle1' + icount);
			var itemCntr = priceSelect.selectedIndex;
			ITNValue = document.getElementById('Item_Root' + icount);
			if (itemCntr >= 1) {
			} else if (itemCntr == 0) {
			} else {
			}
			tempG1 = priceSelect.options[priceSelect.selectedIndex].value.split('|');
			var currentPrice = document.getElementById("Item_CurrentPrice");
			var priceOutput = "Price: $" + formatCurrency(tempG1[0] / 100);
			var FullItemNo = ITNValue.value + ' ' + tempG1[2];
			if (document.getElementById("ITN"+icount) != null){ 
			    document.getElementById("ITN"+icount).value = FullItemNo;
			}    
		}
		function setvNoStyle(icount) {
		VkitItemNo = 'item' + icount;
		strBad = "- No Longer Available";
		tempV1 = new Array;
		var priceSelect = document.getElementById('vstyle' + icount);
		var itemCntr = priceSelect.selectedIndex;
		tempV1 = priceSelect.options[priceSelect.selectedIndex].value.split('|');
			if (icount == 1) {
			    selectedItem1 = tempV1[2] + " " + tempV1[1];
			   //alert("Here's your selectedItem1 " + selectedItem1);
			   if (Get_Cookie('VkitItemNo1')) Delete_Cookie('VkitItemNo1', '/', '');
	            Set_Cookie('VkitItemNo1', selectedItem1, 1, '/', '', '');
			   	//if (Get_Cookie('icount')) Delete_Cookie('icount', '/', '');
	            Set_Cookie('icount', 1, 1, '/', '', '');
	            
			}
			if (icount == 2) {
			    selectedItem2 = tempV1[2] + " " + tempV1[1];
			    //alert("Here's your selectedItem2 " + selectedItem2);
			   	if (Get_Cookie('VkitItemNo2')) Delete_Cookie('VkitItemNo2', '/', '');
	            Set_Cookie('VkitItemNo2', selectedItem2, 1, '/', '', '');
	           // if (Get_Cookie('icount')) Delete_Cookie('icount', '/', '');
	            Set_Cookie('icount',2, 1, '/', '', '');

			}
			if (icount == 3) {
			    selectedItem3 = tempV1[2] + " " + tempV1[1];
			    //alert("Here's your selectedItem3 " + selectedItem3);
			   	if (Get_Cookie('VkitItemNo3')) Delete_Cookie('VkitItemNo3', '/', '');
	            Set_Cookie('VkitItemNo3', selectedItem3, 1, '/', '', '');
			   //	if (Get_Cookie('icount')) Delete_Cookie('icount', '/', '');
	            Set_Cookie('icount', 3, 1, '/', '', '');
	            
			}
		
		}
		function setvStyle2a(icount) {
			//alert(icount);
			strBad = "- No Longer Available";
			tempV1 = new Array;
			var priceSelect = document.getElementById('vstyle' + icount);
			var itemCntr = priceSelect.selectedIndex;
			tempV1 = priceSelect.options[priceSelect.selectedIndex].value.split('|');
			//alert(tempV1[0]);
			//alert(tempV1[1]);
			//alert(tempV1[2]);
			//alert(tempV1[3]);
			if (icount == 1) {
				selectedItem1 = tempV1[3] + " " + tempV1[2] + " " + tempV1[1];
				//alert("Here's your selectedItem1 " + selectedItem1);
				if (Get_Cookie('VkitItemNo1')) Delete_Cookie('VkitItemNo1', '/', '');
				Set_Cookie('VkitItemNo1', selectedItem1, 1, '/', '', '');
				if (Get_Cookie('icount')) Delete_Cookie('icount', '/', '');
				Set_Cookie('icount', icount, 1, '/', '', '');

			}
			if (icount == 2) {
				selectedItem2 = tempV1[3] + " " + tempV1[1];
				//alert("Here's your selectedItem2 " + selectedItem2);
				if (Get_Cookie('VkitItemNo2')) Delete_Cookie('VkitItemNo2', '/', '');
				Set_Cookie('VkitItemNo2', selectedItem2, 1, '/', '', '');
				if (Get_Cookie('icount')) Delete_Cookie('icount', '/', '');
				Set_Cookie('icount', icount, 1, '/', '', '');

			}
			if (icount == 3) {
				selectedItem3 = tempV1[3] + " " + tempV1[1];
				//alert("Here's your selectedItem3 " + selectedItem3);
				if (Get_Cookie('VkitItemNo3')) Delete_Cookie('VkitItemNo3', '/', '');
				Set_Cookie('VkitItemNo3', selectedItem3, 1, '/', '', '');
				if (Get_Cookie('icount')) Delete_Cookie('icount', '/', '');
				Set_Cookie('icount', icount, 1, '/', '', '');

			}
			//if (Get_Cookie('icount')) {
			//  alert("here's the icount " + Get_Cookie('icount'));
			//}
			//if (icount == 1) {
			//formSelectedItem1 = document.getElementById("Item" + icount);
			//alert(formSelectedItem1.value);
			//formSelectedItem1.value = selectedItem;
			//alert(formSelectedItem1.value);
			//}
			//if (icount == 2) {
			//formSelectedItem2 = document.getElementById("Item" + icount);
			//alert(formSelectedItem2.value);
			//formSelectedItem2.value = selectedItem;
			//alert(formSelectedItem2.value);
			//}
			//if (icount == 3) {
			//formSelectedItem3 = document.getElementById("Item" + icount);
			//alert(formSelectedItem3.value);
			//formSelectedItem3.value = selectedItem;
			//alert(formSelectedItem3.value);
			//}
			//if (icount == 4) {
			//formSelectedItem4 = document.getElementById("Item" + icount);
			//alert(formSelectedItem4.value);
			//formSelectedItem4.value = selectedItem;
			//alert(formSelectedItem4.value);
			//}										
			itemMsg = priceSelect.options[priceSelect.options.selectedIndex].text;
			//alert(itemMsg);
			var oStr = new String(itemMsg);
			if (oStr.indexOf(strBad) >= 0) {
				var intEnd;
				var strOption;
				intEnd = oStr.indexOf("-");
				strOption = oStr.substring(0, intEnd);
				alert("Sorry, " + strOption + " is no longer available.\nPlease make another selection.");
				document.getElementById("I1").disabled = "disabled";
				return false;
			}
			else {
				document.getElementById("I1").disabled = "";
				return true;
			}
			if (itemCntr >= 1) {
			} else if (itemCntr == 0) {
			} else {
			}
			var currentPrice = document.getElementById("Item_CurrentPrice");
			var priceOutput = "Price: $" + formatCurrency(tempV1[0] / 100);

		}				
		
		
		function setvStyle2(icount) {
			//alert(icount);
			document.getElementById("I1").disabled = "";
			VkitItemNo = 'item' + icount;
			//alert("here's the VkitItemNo " + VkitItemNo);
			strBad = "- No Longer Available";
			//alert(gstyle);
			tempV1 = new Array;
			var priceSelect = document.getElementById('vstyle' + icount);
			var itemCntr = priceSelect.selectedIndex;
			tempV1 = priceSelect.options[priceSelect.selectedIndex].value.split('|');
			//alert(tempV1[0]);
			//alert(tempV1[1]);
			//alert(tempV1[2]);
			if (icount == 1) {
			    selectedItem1 = tempV1[2] + " " + tempV1[1];
			    //alert("Here's your selectedItem1 " + selectedItem1);
			   	if (Get_Cookie('VkitItemNo1')) Delete_Cookie('VkitItemNo1', '/', '');
	            Set_Cookie('VkitItemNo1', selectedItem1, 1, '/', '', '');
			   	if (Get_Cookie('icount')) Delete_Cookie('icount', '/', '');
	            Set_Cookie('icount', icount, 1, '/', '', '');
	            
			}
			if (icount == 2) {
			    selectedItem2 = tempV1[2] + " " + tempV1[1];
			    //alert("Here's your selectedItem2 " + selectedItem2);
			   	if (Get_Cookie('VkitItemNo2')) Delete_Cookie('VkitItemNo2', '/', '');
	            Set_Cookie('VkitItemNo2', selectedItem2, 1, '/', '', '');
	            if (Get_Cookie('icount')) Delete_Cookie('icount', '/', '');
	            Set_Cookie('icount',icount, 1, '/', '', '');

			}
			if (icount == 3) {
			    selectedItem3 = tempV1[2] + " " + tempV1[1];
			    //alert("Here's your selectedItem3 " + selectedItem3);
			   	if (Get_Cookie('VkitItemNo3')) Delete_Cookie('VkitItemNo3', '/', '');
	            Set_Cookie('VkitItemNo3', selectedItem3, 1, '/', '', '');
			   	if (Get_Cookie('icount')) Delete_Cookie('icount', '/', '');
	            Set_Cookie('icount', icount, 1, '/', '', '');
	            
			}
			//if (Get_Cookie('icount')) {
	          //  alert("here's the icount " + Get_Cookie('icount'));
	        //}
			//if (icount == 1) {
				//formSelectedItem1 = document.getElementById("Item" + icount);
				//alert(formSelectedItem1.value);
				//formSelectedItem1.value = selectedItem;
				//alert(formSelectedItem1.value);
			//}
			//if (icount == 2) {
				//formSelectedItem2 = document.getElementById("Item" + icount);
				//alert(formSelectedItem2.value);
				//formSelectedItem2.value = selectedItem;
				//alert(formSelectedItem2.value);
			//}
			//if (icount == 3) {
				//formSelectedItem3 = document.getElementById("Item" + icount);
				//alert(formSelectedItem3.value);
				//formSelectedItem3.value = selectedItem;
				//alert(formSelectedItem3.value);
			//}
			//if (icount == 4) {
				//formSelectedItem4 = document.getElementById("Item" + icount);
				//alert(formSelectedItem4.value);
				//formSelectedItem4.value = selectedItem;
				//alert(formSelectedItem4.value);
			//}										
			itemMsg = priceSelect.options[priceSelect.options.selectedIndex].text;
			//alert(itemMsg);
			var oStr = new String(itemMsg);
			if (oStr.indexOf(strBad) >= 0) {
				var intEnd;
				var strOption;
				intEnd = oStr.indexOf("-") ;
				strOption = oStr.substring(0, intEnd);
				alert("Sorry, " + strOption + " is no longer available.\nPlease make another selection.");
				document.getElementById("I1").disabled = "disabled";
				return false;
			}
			else {
				document.getElementById("I1").disabled = "";
				return true;
			}
			if (itemCntr >= 1) {
			} else if (itemCntr == 0) {
			} else {
			}
			var currentPrice = document.getElementById("Item_CurrentPrice");
			var priceOutput = "Price: $" + formatCurrency(tempV1[0] / 100);
			
		}		
		function setgStyle3() {
			if (document.getElementById("gstyle3") != null) {
				document.getElementById("gstyle3").disabled = "";
			}
		}
		
	
