$(function() {

	if(jQuery.fn.defuscate) { $(".obfuscated").defuscate(); }
	if(jQuery.fn.toggleVal) { $(".togvalue").toggleVal(); }
	if(jQuery.fn.tooltip) { $(".tool_page, .op6").tooltip({ track: true, delay: 0, showURL: false, showBody: " - ", fade: 250 }); }

	$("a.bl_").attr({"target":"_blank"});
	$(".historyBack").click(function(event) { event.preventDefault(); history.back(-1); });
	$("a.goto").click(function(event) { event.preventDefault(); var $tr = $(this.hash); $tr = $tr.length && $tr || $('#' + this.hash.slice(1));
		if ($tr.length) { $('html,body').animate({scrollTop: $tr.offset().top}, 1000); /*, 'bounceout'*/ } });
	
	$("a.favorite").click(function(event) {
		event.preventDefault();
		if (document.all) { window.external.AddFavorite(location.href, document.title); } 
		else if (window.sidebar) { window.sidebar.addPanel(document.title, location.href, ""); }
	});


	$("a.fancybox").fancybox({'overlvayShow':true, 'overlayColor':'#000', 'overlayOpacity':0.73, 'padding':0, 'imageScale':true, onComplete:banHide, onCleanup:banShow, 'transitionIn': 'elastic', 'transitionOut': 'elastic', 'titlePosition': 'over' });
	$(".op6").css({opacity:0.5}).hover(function(){ $(this).fadeTo("normal", 1); }, function(){ $(this).fadeTo("normal", 0.5); }).click(function(event) { 
		event.preventDefault(); 
		$("#highslide").fadeIn("normal"); 
		$(".position").hide();
		$("div."+$(this).attr("rel")).show().removeClass("none");
	});


	$(".op0").click(function(event) { 
		event.preventDefault(); 
		$("#highslide").fadeIn("normal"); 
		$(".position").hide();
		$("div."+$(this).attr("rel")).show().removeClass("none");
	});

	$(".opac").css({opacity:0.7});
	$("#highslide").hide().removeClass("none");
	$(".buttonclose, .opac, .buttoncloses").click(function(event) { event.preventDefault(); $("#highslide").fadeOut("normal"); });



	$(".Lmenu").lavaLamp({ fx: "backout", speed: 600, overcolor: {color: '#ffffff'},outcolor: {color: '#005d9e'}, speedcolor:300 });
});

function banHide() { $(".bnWithFlash").hide(); }
function banShow() { $(".bnWithFlash").show(); }
function goToUrl(url) { window.location.href = url; };
function SwitchClass(elements) { $.each(elements, function(index, item) { $("." + item).hover(function() { $(this).addClass(item + "Active"); }, function() { $(this).removeClass(item + "Active"); }); }); };
function showElement(ident) { if($.browser.mozilla || $.browser.safari) { $(ident).fadeIn("slow"); } else { $(ident).css({display:"block"}); }; };
function hideElement(ident) { if($.browser.mozilla || $.browser.safari) { $(ident).fadeOut("slow"); } else { $(ident).css({display:"none"}); }; };
function AcceptAlert(text) { return confirm(text); }

function setAction(action, form) { $("#"+form+" .action").val(action); $("#"+form).submit(); }
function AcceptAlert(text) { return confirm(text); }
