﻿        var guid = new RegExp("(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}");


        function GetElementsByClassName(_2,_3,_4){
            var _5=(_3=="*"&&_2.all)?_2.all:_2.getElementsByTagName(_3);
            var _6=new Array();
            _4=_4.replace(/\-/g,"\\-");
            var _7=new RegExp("(^|\\s)"+_4+"(\\s|$)");
            var _8;
            for(var i=0;i<_5.length;i++){
                _8=_5[i];
                if(_7.test(_8.className)){
                    _6.push(_8);
                }
            }
            return (_6);
        }
        
        
        function swapMainImage(el, caption, alt)
        {                
            var mainimage = document.getElementById("MainImage"); 
            var newmainimageid = el.src;                     
               
            mainimage.src = productImageRoot + guid.exec(newmainimageid)[0] + "/200-200/" + caption;   
            mainimage.alt = alt; 
        }
        
        function ShowFeature(featureNumber){
        
            // hide all features
            el=GetElementsByClassName(document,"div","FeatureData");
            for(i=0;i<el.length;i++){
                if (i == featureNumber)
                    el[i].className = el[i].className.replace(stateMatch, "$1_normal_");
                else
                    el[i].className = el[i].className.replace(stateMatch, "$1_hidden_");
            }
            
            // hide all features
            el=GetElementsByClassName(document,"h3","FeatureTitle");
            for(i=0;i<el.length;i++){
                if (i == featureNumber)
                    el[i].className = el[i].className.replace(stateMatch, "$1_selected_");
                else
                    el[i].className = el[i].className.replace(stateMatch, "$1_normal_");
            }
        }