function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

ddaccordion.init({
	headerclass: "mypets", //Shared CSS class name of headers group
	contentclass: "thepet", //Shared CSS class name of contents group
	revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseover"
	collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
	defaultexpanded: [1], //index of content(s) open by default [index1, index2, etc]. [] denotes no content.
	animatedefault: false, //Should contents open by default be animated into view?
	persiststate: false, //persist state of opened contents within browser session?
	toggleclass: ["", "openpet"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
	togglehtml: ["none", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
	animatespeed: "fast", //speed of animation: "fast", "normal", or "slow",
	oninit:function(expandedindices){ //custom code to run when headers have initalized
		//do nothing
	},
	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
		//do nothing
	}
})
jQuery(function($) {

			var counter = { value: 5 };
			var $inputs = $('#order input[type="text"][name^="pole"]');
			var $select = $('select#vat option:selected');
			var $counter = $('#brutto');
			var vat = $('select.target option:selected').val() / 100;
			
	$('.target').change(function() {
				
                vat = $('select.target option:selected').val() / 100;
count($inputs, counter);
});
			var count = function(e, c) {
				c.value = 0;
				e.each(function() {
					var count = parseFloat(this.value, 10);
					c.value += !isNaN(count) ? count : 0;
					c.value = (c.value * vat) + c.value;
					c.value = Math.round(c.value*100)/100;
				});
				$counter.val(c.value);
				
			};
			count($inputs, counter);
			$inputs.keyup(function() {
								   
				count($inputs, counter);
			});

		});
		$(document).ready(function(){
			$(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'slow',theme:'facebook',slideshow:2000});
		});
$(document).ready(function() {
      $("#category tr").hover(function() 
       { 
        $(this).addClass("cateHover"); 
       }, function() 
       {
        $(this).removeClass("cateHover");
       });
	  
	 	$("div.error3").toggle().animate({opacity: "0"}, 0);
		$("div.error3").animate({opacity: "1"}, 2000);
		
		
		$("div.info").toggle().animate({opacity: "0"}, 0);
		$("div.info").animate({opacity: "1"}, 2000);

 });
$(document).ready(function() {
						   
				$("#download2").click(
					function()
					{
						if ($('#download2:checked').val() != null)
						{
							$("#nameInvoice").val($("#neme").val());
							$("#lostnameInvoice").val($("#lostname").val());
							$("#businessInvoice").val($("#business").val());
							$("#streetInvoice").val($("#street").val());
							$("#namberInvoice").val($("#namber").val());
							$("#codeInvoice").val($("#code").val());
							$("#cityInvoice").val($("#city").val());
						}
						else
						{
							$("#nameInvoice").val("");
							$("#lostnameInvoice").val("");
							$("#businessInvoice").val("");
							$("#streetInvoice").val("");
							$("#namberInvoice").val("");
							$("#codeInvoice").val("");
							$("#cityInvoice").val("");
						}
					});
						$("#password1").val("");

						   
 });
$(document).ready(function(){
	
	$(".accordion h3:first").addClass("active");
	$(".accordion div#author:not(:first)").hide();
 
	$(".accordion h3").click(function(){
			$("input[name=addType]:checked").val(); 
		$(this).next("div#author").slideToggle("slow")
		.siblings("div#author:visible").slideUp("slow");
		$(this).toggleClass("active");
		$(this).siblings("h3").removeClass("active");
	});
 
});
$().ready(function()
		{
			$("#menu-panels li a").click(function()
			{
				$("#menu-panels .active").removeClass("active");
				$(this).parent().addClass("active");
 
				var classname = $(this).attr("class");
				$("#contentPanel div.text:visible").hide();
				$("#contentPanel div#"+classname).show();
 
				return false;
			});
			
		});
