$(document).ready(function(){
	$('ul.main-menu li').hover(function() {
	  $(this).addClass('hover');
	}, function() {
	  $(this).removeClass('hover');
	});
		
	$('.tooltip').tooltip({
		track: true,
		delay: 0,
		showURL: false,
		showBody: " - ",
		fade: 150
	});
	$("a.fancy").fancybox({
		'titleShow' : true,
		'titlePosition' : 'inside',
		'transitionIn' : 'elastic',
		'transitionOut' : 'elastic'	
	});
	$("a.fancy-gal").fancybox({
		'titleShow' : true,
		'titlePosition' : 'inside',
		'transitionIn' : 'elastic',
		'transitionOut' : 'elastic'	
	});
	
	$("#iframe1").fancybox({
		'width'			: 696,
		'height'			: 380,
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'			: 'iframe'
	});
	$(".iframe2").fancybox({
		'titleShow' 		: false,
		'width'			: 640,
		'height'			: 360,
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'			: 'iframe'

	});
	$("#iframe3").fancybox({
		'width'			: 696,
		'height'			: 410,
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'			: 'iframe'		
	});	
	$(".sign-button").click(function(){
		$("div#sign-box").show("middle");
		$(".sign-button").toggle();
	});

	$("li#hide_button").click(function(){
		$("div#sign-box").hide("middle");
	});
	/*
	$("ul.tabs-nav").tabs("div.tabs-nav-content > ul", { 
		effect: 'slide', 
		//fadeOutSpeed: "fast", 
		rotate: true 
	});
	*/
	$("ul.tabs2-nav").tabs("div.tabs2-nav-content > div", { 
		effect: 'slide', 
		//fadeOutSpeed: "fast", 
		rotate: true 
	});
	
	//$("ul.tabs").tabs().play(); 	
	$(".askAboutProduct").fancybox({
		'width'			: 725,
		'height'			: 330,
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'			: 'iframe'
	});
});

function addOne(elementName) {
	inputAmount = document.getElementById(elementName).value;          
	var re = /^[0-9]+$/;
	if (re.test(inputAmount) == false) inputAmount = 0;
	amount = parseInt(inputAmount);          
	amount = amount + 1;
	document.getElementById(elementName).value = amount;
	jQuery('#basketForm').submit();
}
function subtractOne(elementName) {
	inputAmount = document.getElementById(elementName).value;          
	var re = /^[0-9]+$/;
	if (re.test(inputAmount) == false) inputAmount = 0;
	amount = parseInt(inputAmount);          
	amount = amount - 1;
	if (amount<1) amount = 1; 
	document.getElementById(elementName).value = amount;
	jQuery('#basketForm').submit();
}

function update_field_boxes(){
	if (document.getElementById("user-typ-a").checked != true && document.getElementById("user-typ-b").checked != true) {
		document.getElementById("user-typ-a").checked = true;
	}
	typ = document.getElementById("user-typ-a").checked;	

	if (typ){
		jQuery(".company").hide();		
	}
	else{
		jQuery(".company").show();
	}
	return true;
}
