var request;
var checkAjax = ajaxFunction();

function ajaxFunction() {
	try {
		// Opera 8.0+, Firefox, Safari
		request = new XMLHttpRequest();
		return true;
	} catch (e) {
		// Internet Explorer Browsers
		try {
			request = new ActiveXObject("Msxml2.XMLHTTP");
			return true;
		} catch (e) {
			try {
				request = new ActiveXObject("Microsoft.XMLHTTP");
				return true;
			} catch (e) {
				// Something went wrong
				return false;
			}
		}
	}
}

$(document).ready(function() {
	$('#intro').fadeIn('100');
	
	$('li.link').click(function() {
		if (this.className != "select link") {
			var noImage = false;
			
			if($("div.img-big").attr("style") == "display: none;"){
				$("div.img-big").attr("style", "display: block;");
			}
			
			if($("#img_" + this.id + " img").attr("src") != ""){
				var src = "images/" + $("#img_" + this.id + " img").attr("src");				
				$("div.img-big img").attr('src', src);				
			} else {
				$("div.img-big").attr("style", "display: none;");
				noImage = true;
			}
			var oldID = $("li.select").attr("id");
			this.className = "select link";
			$("#" + oldID).attr('class', "default link");
			
			var htmlStr = $("#txt_" + this.id).html();
			$("div.txtval").html(htmlStr);
			
			if(noImage == true){
				$("div.txtval").attr("style", "padding: 0px;");
			}
		}
	});

	$('.nav_01 li').hover(function() {
		if ($(this).children('ul').size() > 0) {
			($(this).children('ul')).animate( {
				opacity : 1,
				marginBottom : "0in"
			}, 250);

		}
	}, function() {
		($(this).children('ul')).animate( {
			opacity : 0.75,
			marginBottom : "-1.28in"
		}, 10);
	});
});

