// 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){
	document.frmDetail.imgPhoto.src = url;
}
function openwin(url){
	newwindow = window.open(url, 'name', 'height=500, width=660, 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(){
	if (event.keyCode == 13)
	{
		event.cancelBubble = true;
		event.returnValue = false;
		//alert(document.getElementById("header_styleSearch"));
		__doPostBack('header$styleSearch','')
		//document.getElementById("header_styleSearch").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;
        }
    }
}
