
function showTabContent(tabNameShow) {
    var allContentTabs = new Array('description', 'itemspecs', 'shipping', 'resources', 'photos');
    for (i = 0; i < allContentTabs.length; i++ ) {    
        tabName = 'producttab_' + allContentTabs[i];
        var t = $(tabName);
        if (t != null) {
            if (tabName != ('producttab_' + tabNameShow)) {
                t.className = 'tab';
            }
            else {
				t.className = 'tabselected';
            }
        }
    }
}

function showBlocks(blockNames) {
    for (var i = 0; i < arguments.length; i++) {
        var t = $(arguments[i]);
        if (t != null) {
            new Element.show(t);
        }
    }
}
function hideBlocks(blockNames) {
    for (var i = 0; i < arguments.length; i++) {
        var t = $(arguments[i]);
        if (t != null) {
            new Element.hide(t);
        }
    }    
}

function swapImage(domElement, newSrc) {
    //var e = $(domElement);
    var e = document.getElementById(domElement);
    if (e != null) {
        e.src = newSrc;
    }
}

function swapImageProps(domElement, newWidth, newHeight, altCaption) {
    var e = $(domElement);
    if (e != null) {
        e.width = newWidth;
        e.height = newHeight;
        if (altCaption != '') {
            e.alt = altCaption.unescapeHTML();
        }
        else {
            e.alt = '';
        }
    }
}
function swapCaption(domElement, newCaption) {
    var e = $(domElement);
    if (e != null) {
        e.innerHTML = newCaption;
    }
}
function swapSelectedStyle(selectedSetID) {
    for (i = 0; i < imagesetids.length ; i++) {
        var e = $('mainthumbnail' + imagesetids[i]);
        if (e != null) {
            e.className = 'mainthumbnail';
        }
        var e2 = $('largethumbnail' + imagesetids[i]);
        if (e2 != null) {
            e2.className = 'largethumbnail';
        }
    }
    var main = $('mainthumbnail' + selectedSetID);
    if (main != null) {
        main.className = 'mainthumbnailactive';
    }
    var large = $('largethumbnail' + selectedSetID);
    if (large != null) {
        large.className = 'largethumbnailactive';
    }
}


function displaySwatchWindow(windowtitle, itemskuid) {
	//alert(itemskuid);
	var win = new Window(
		{
			className: 'alphacube', 
			title: windowtitle, 
			zIndex: 100, 
			width:650, 
			height:425, 
			url: '/Code/Actions/getItemSkuData.aspx?sku=' + itemskuid + '', 
			draggable:true, 
			
			hideEffect:Element.hide,
			showEffect:Element.show,
			
			wiredDrag:true 
		}
	)
	win.showCenter(); 	
	//win.setDestroyOnClose();
}