// 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.getElementById("imgPhoto").src = url;
	document.getElementById("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.getElementById("imgPhoto").src = url;
	document.getElementById("imageName").value = name;
	document.getElementById("imageId").value = imageId;
}
function openXLImage(url){
	url = url + document.getElementById("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 (escape(list[i]) == current) {
			if (i == list.length - 1) {
				image.src = "http://d23gkft280ngn0.cloudfront.net/thumb/" + list[0];
			}
			else {
				image.src = "http://d23gkft280ngn0.cloudfront.net/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';
}

