//Google Analytics Code
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-20727544-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);
})();

// No confilct mode
var $m = jQuery;

$m(document).ready(function(){

	$m('li.menu-item').hover(
		function () {
			$m(this).children('ul').slideDown();
			},
		function () {
			$m(this).children('ul').slideUp();
			}
	);
	
	
	$m('.slide-show').cycle({
		fx: 'scrollUp',
		timeout: 10000
	});
	
	$m('.slide-show').hover(
		function () {
			$m(this).cycle('pause');
		},
		function () {
			$m(this).cycle('resume');
		}	
	);

	$m(".left-highlight").hover(
		function () {
			$m('.home-left').addClass('home-text-hovered');
			$m('.home-left').addClass('home-left-hovered');
			$m('.learn-button-left').addClass('learn-button-hovered');
			$m('#home-choice .retail').addClass('retail-hovered');
			$m('.in-store').addClass('in-store-hovered');
		},
		function () {
			$m('.home-left').removeClass('home-text-hovered');
			$m('.home-left').removeClass('home-left-hovered');
			$m('.learn-button-left').removeClass('learn-button-hovered');
			$m('#home-choice .retail').removeClass('retail-hovered');
			$m('.in-store').removeClass('in-store-hovered');
		}
	);
	
	$m(".right-highlight").hover(
		function () {
			$m('.home-right').addClass('home-text-hovered');
			$m('.home-right').addClass('home-right-hovered');
			$m('.learn-button-right').addClass('learn-button-hovered');
			$m('#home-choice .service').addClass('service-hovered');
			$m('.out-store').addClass('out-store-hovered');
		},
		function () {
			$m('.home-right').removeClass('home-text-hovered');
			$m('.home-right').removeClass('home-right-hovered');
			$m('.learn-button-right').removeClass('learn-button-hovered');
			$m('#home-choice .service').removeClass('service-hovered');
			$m('.out-store').removeClass('out-store-hovered');
		}
	);
	
	
	
	var i = 1
	$m("button.addreq").click(function() {
		i++
		$m(this).attr("disabled", "disabled");
		$m("form > ul.req > li:last-child").clone(true)
		.hide()
		.insertAfter("form > ul.req > li:last-child")
		.children("input").attr({
			name: 'req_'+i,
			value: ''
			})
		.parent("li")
		.fadeIn("normal", function() {
			$m("button.addreq").removeAttr("disabled");
		});
	});
	
	var t = 1
	$m("button.addresp").click(function() {
		t++
		$m(this).attr("disabled", "disabled");
		$m("form > ul.resp > li:last-child").clone(true)
		.hide()
		.insertAfter("form > ul.resp > li:last-child")
		.children("input").attr({
			name: 'resp_'+t,
			value: ''
			})				.parent("li")
		.fadeIn("normal", function() {
			$m("button.addresp").removeAttr("disabled");
		});
	});
	
	var n = 1
	$m("button.addqual").click(function() {
		n++
		$m(this).attr("disabled", "disabled");
		$m("form > ul.qual > li:last-child").clone(true)
		.hide()
		.insertAfter("form > ul.qual > li:last-child")
		.children("input").attr({
			name: 'qual_'+n,
			value: ''
			})
		.parent("li")
		.fadeIn("normal", function() {
			$m("button.addqual").removeAttr("disabled");
		});
	});

				
	$m(".remove").click(function() {
		$m(this).parent().fadeOut("normal" , function(){
			$m(this).remove();
		});
	});


//lightbox
	$(function() {
		$.nyroModalSettings({
			type: 'iframe',
			height: 438,
			width: 750
		});
	});

});


