// for the subcategories

function showhide(layername){
	if(document.getElementById(layername).style.display=='none'){
		document.getElementById(layername).style.display='block';
	}
	else{
		document.getElementById(layername).style.display='none'; 
	} 
}
function loadImage(url, name){
	document.frmDetail.imgPhoto.src = url;
	document.frmDetail.imageName.value = name;
}
function openwin(url, width){
	newwindow = window.open(url, 'name', 'height=500, width=' + width + ', scrollbars=yes, toolbar=no, resizable=yes, statusbar=no');
	if (window.focus) {
		newwindow.focus()
	}
}
function openimage(url){
	newwindow = window.open(url, 'name', 'height=1000, width=780, scrollbars=yes, toolbar=no, resizable=yes, statusbar=no');
	if (window.focus) {
		newwindow.focus()
	}
}
function loadXLImage(url, name, imageId){
	document.frmDetail.imgPhoto.src = url;
	document.frmDetail.imageName.value = name;
	document.frmDetail.imageId.value = imageId;
}
function openXLImage(url){
	url = url + document.frmDetail.imageId.value;
	newwindow = window.open(url, 'name', 'height=1000, width=780, scrollbars=yes, toolbar=no, resizable=yes, statusbar=no');
	if (window.focus) {
		newwindow.focus()
	}
}
function hideText(){
	document.getElementById("header_txtSearch").value = "";
}
function submitSearch(evt){
	if (evt.keyCode == 13){
		evt.cancelBubble = true;
		evt.returnValue = false;
		document.getElementById("header_btnGo").click();
	}
}
function NextImage(imageObject, imageList) {
    var list = imageList.split(",");
    var image = document.getElementById(imageObject);
    var current = image.src.toString().substring(image.src.toString().lastIndexOf("/") + 1);
    for (var i = 0; i < list.length; i++) {
        if (list[i] == current) {
            if (i == list.length - 1) {
                image.src = "Images/Products/Thumb/" + list[0];
            }
            else {
                image.src = "Images/Products/Thumb/" + list[i + 1];
            }
            break;
        }
    }
}
function showb(obj, ending) {
    obj.src = '/images/' + ending;
}
function showButtons(id) {
    document.getElementById('buttons' + id).style.display = '';
    document.getElementById('background' + id).style.display = '';
}
function hideButtons(id) {
    document.getElementById('buttons' + id).style.display = 'none';
    document.getElementById('background' + id).style.display = 'none';
}
