<!--
	igMainTab = new ImageGroup(0, "/smith_noble/images/v3/config/", [{id:0,name:'',on:'',off:'',over:''},
				  {id:1,name:'imgMainTabHowTo',on:'txtHowToGuideSelected.gif',off:'txtHowToGuideUnselected.gif',over:'txtHowToGuideOver.gif'},
				  {id:2,name:'imgMainTabDimensions',on:'txt1DimensionsSelected.gif',off:'txt1DimensionsUnselected.gif',over:'txt1DimensionsOver.gif'},
				  {id:3,name:'imgMainTabMaterials',on:'txt2MaterialsSelected.gif',off:'txt2MaterialsUnselected.gif',over:'txt2MaterialsOver.gif'},
				  {id:4,name:'imgMainTabUpgrades',on:'txt3UpgradesSelected.gif',off:'txt3UpgradesUnselected.gif',over:'txt3UpgradesOver.gif'},
				  {id:5,name:'imgMainTabNoCharge',on:'txt4NoChargeOptionsSelected.gif',off:'txt4NoChargeOptionsUnselected.gif',over:'txt4NoChargeOptionsOver.gif'},
				  {id:6,name:'imgMainTabAddToCart',on:'txt5ReviewAddToCartSelected.gif',off:'txt5ReviewAddToCartUnselected.gif',over:'txt5ReviewAddToCartOver.gif'},
				  {id:7,name:'imgMainTabPreview',on:'txtRoomSettingsSelected.gif',off:'txtRoomSettingsUnselected.gif',over:'txtRoomSettingsOver.gif'}]);
				  				  				  
				  

	function ImageGroup(activeId, rootUrl, list){
		this.active = activeId;
		this.rootUrl = rootUrl;
		this.list = list;
		this.imgOver = imgOver;
		this.imgOut = imgOut;
		this.imgSelect = imgSelect;
	}
	function imgOver(id){
		if (this.active == id) {
			return false;
		}
		parent.document.getElementById(decodeHTMLmore(this.list[id].name)).src=this.rootUrl + this.list[id].over;
	}
	function imgOut(id){
		var url = (this.active==id ? this.list[id].on:this.list[id].off);
		parent.document.getElementById(decodeHTMLmore(this.list[id].name)).src=this.rootUrl + url;
	}

	function imgSelect(id){
		if(this.active==id){
			return false;
		}
		 
		//if (this.list[i].name == null) {
		//	return false;
		//}
		
		this.active=id;
		for(var i=1;i<this.list.length;i++){
			parent.document.getElementById(decodeHTMLmore(this.list[i].name)).src=this.rootUrl + this.list[i].off;
		}
		parent.document.getElementById(decodeHTMLmore(this.list[id].name)).src=this.rootUrl + this.list[id].on;
		
		//loading = false;
		//if (this == igMatType) {
		//	selectLoad = false;	
		//}
		
		return true;
	}

	function changeTabState(tabName, tab) {
		// set all the tabs to the unselected state
		// set the specified tab to the selected state
		var x = 0;
		
		// Reset the material filters when changing tabs
		colorFilterSendData="";
    	classFilterSendData="";
		filterAction="reset";
		
		if (tabName == "main") {
			for (x=0; x < 7; x++) {
				var tabFullName = "" + tabName + x;
				var tabCell = parent.document.getElementById(tabFullName);
				if (x == 0 || x == 6) {
						tabCell.className = 'smallMainUnselected';
						if (x == tab) {
							tabCell.className = 'smallMainSelected';
						}
				} else {
					tabCell.className = 'largeMainUnselected';
					if (x == tab) {
						tabCell.className = 'largeMainSelected';
					}
				}
			}
		} else if (tabName == "sub") {
			for (x=1; x <= 8; x++) {
				var tabFullName = "" + tabName + x;
				var tabCell = parent.document.getElementById(tabFullName);
				if (tabCell != null) {
					tabCell.className = "subTabUnselected";
					if (x == tab) {
						tabCell.className = "subTabSelected";
					}
				}
			}
		}
	}
	
	String.prototype.rememberScrollPosition = function (){
	  var objElement = document.getElementById(this);
	  var intTop = scrollTop;
	  if (null != intTop) 
	  {
	  	objElement.scrollTop = intTop;
	  }
	  //var onScrollFunc = function() {scrollTop = objElement.scrollTop;alert(scrollTop);};
	  //objElement.onScroll = onScrollFunc;
	}
	
	function resetScrollTop() {
		scrollTop = 0;
	}
	
	function getVScrollMsg() {
		var vscrollMsg = "";
		
		if (parent.document.getElementById("divOptionPanel").scrollHeight > parent.document.getElementById("divOptionPanel").clientHeight) 
		{ 
			vscrollMsg = " (scroll to view more)";	
	                            	// a vertical scroll bar is present in the div 
	
		} 
		return vscrollMsg;
	}		
-->
