defaultStatus = "ABSOLUTE.DESIGN";

/*******************************
 Picture Display Scripts
 enable images to be loaded from querystring or from html event
*******************************/
function jsLoadPicture(default_image, path_to_root) {
	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 = path_to_root + 'uploads/' + picture_src;
			}
			if (ident != '') {
				js_set_menu(ident);
			} else {
				js_set_menu('1');
			}
		} else {
			if (default_image != '') {
				document['preview'].src = path_to_root + 'uploads/' + default_image;
			}
			js_set_menu('1');
		}
	}
}

function jsSwapPicture(picture_src, path_to_root) {
	if (document.images) {
		if (picture_src != '') {
			document['preview'].src = path_to_root + '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";
	}
}


// google analytics
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-18409925-1']);
_gaq.push(['_trackPageview']);

(function() {
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
