<!--
/*******************************
 Picture Display Scripts
 enable images to be loaded from querystring or from html event
*******************************/
function jsLoadPicture(default_image) {
	if (document.images) {
		if (document.location.href.indexOf(".htm?")>=0) {
			var querystring = document.location.href.substring(document.location.href.lastIndexOf("?")+1,document.location.href.length);
			arr_querystring = querystring.split("&");
			arr_name = new Array(arr_querystring.length);
			arr_value = new Array(arr_querystring.length);
			for (i=0;i<arr_querystring.length;i++) {
				arr_name[i] = arr_querystring[i].substring(0,arr_querystring[i].lastIndexOf("="));
				arr_value[i] = arr_querystring[i].substring(arr_querystring[i].lastIndexOf("=")+1,arr_querystring[i].length);
			}
			var picture_src;
			for (i=0; i<arr_name.length; i++) {
				if (arr_name[i] == "src") {
					picture_src = arr_value[i];
				}
				if (arr_name[i] == "id") {
					ident = arr_value[i];
				}
			}
			if (picture_src != '') {
				document['preview'].src = '../uploads/' + picture_src;
			}
			if (ident != '') {
				js_set_menu(ident);
			} else {
				js_set_menu('1');
			}
		} else {
			if (default_image != '') {
				document['preview'].src = '../uploads/' + default_image;
			}
			js_set_menu('1');
		}
	}
}

function jsSwapPicture(picture_src) {
	if (document.images) {
		if (picture_src != '') {
			document['preview'].src = '../uploads/' + picture_src;
		}
	}
}

function js_set_menu(ident) {
	if(document.getElementById){
		for (i=1;i<=6;i++) {
			var el = document.getElementById("sub-menu-" + i);
			if(el) { el.className="menu"; }
		}
		var el = document.getElementById("sub-menu-" + ident);
		el.className="menu-on";
	}
}
//-->