/*
	201008041400 - bpfeiffer - this file should be used
	on the EN version of Zilver PTX until the site is translated
	after which, the main.disabledUntilTranslated.js file should
	be renamed to main.js to overwrite this file
	
	main.disabledUntilTranslated.js contains the language detection fn
*/
	jQuery(document).ready(function() {

		$.easy.tooltip();
		$.easy.popup();
		$.easy.external();
		$.easy.rotate();
		$.easy.forms();
		$.easy.showhide();
		$.easy.jump();

		// clickable.js - finds any element of class=clickable and makes it a link to the href contained within
		$(".clickable").click(function() {
			window.location = jQuery(this).find("a").attr("href");
			return false;
		});

		// menus
		jQuery('ul.sf-menu').superfish();

		// play flash videos in place
		$('.videobox img').click(function(pd) {
			$(this).hide();
			$('.videobox .video').hide().flash(null, { version: 8 },
				function(htmlOptions) {
					var $this = $(this);
					var params = $this.attr('rel').split('|');
					htmlOptions.src = params[0];
					htmlOptions.width = params[1];
					htmlOptions.height = params[2];
					htmlOptions.flashvars = params[3];
					this.innerHTML = '<div class="alt">' + this.innerHTML + '</div>';
					$this.addClass('flash-replaced').prepend($.fn.flash.transform(htmlOptions));
				}).show();
			pd.preventDefault();
		});

		// inner fade call
		$('#image_rotate').innerfade({
			speed: 1500,
			timeout: 3500,
			type: 'sequence',
			containerheight: '250px'
		});


		$('body').prepend('<div id="disclaimer_float"> <table style="margin: 0 0 0 0; font-family: sans-serif; font-size: 12px; font-weight: normal; position: fixed; z-index: 999; top: 0; width: 100%; text-align: center; background: #fecc1d; color: black; border-top: 3px solid #ecb200; border-bottom: 3px solid #ecb200; padding: 6px;"> <tr> <td style="text-align: center;"> <span> <strong style="font-weight:bold;">CAUTION</strong> - In the United States, the Zilver PTX is an investigational device not available for sale.</span> </td> </tr> </table> <table style="margin: 0 0 0 0; font-family: sans-serif; font-size: 12px; font-weight: normal; position: relative; z-index: 888; top: 0; width: 100%; text-align: center; background: #fecc1d; color: black; border-top: 3px solid #ecb200; border-bottom: 3px solid #ecb200; padding: 6px;"> <tr> <td style="text-align: center;"> <span> <strong style="font-weight:bold;">CAUTION</strong> - In the United States, the Zilver PTX is an investigational device not available for sale.</span> </td> </tr> </table> </div> <!-- /#disclaimer_float -->');



		// Google Analytics Event Tracking with help from rebeccamurphey.com - http://bit.ly/9d4kK8
		// get every link on the page and when clicked perform this function
		jQuery('a').click(function() {	
		        var $a = jQuery(this);                    // variable a is each link we're working with
		        var lu = $a.attr('href');                 // grab the href of the link
		        var lc = $a.attr('class');                // grab the class of the link
		        var lt = $a.attr('title');                // grab the title of the link
		        var cat = 'Link';                         // set this to whatever you want
		        var act = 'Click';                        // set this to whatever you want
		        var lab = lu + ' - ' + lt + ' - ' + lc;        // set this to whatever you want
		        _gaq.push(['_trackEvent', cat , act , lab]);   // this the final onClick event
		    });

		// Google Analytics Event Tracking with help from rebeccamurphey.com - http://bit.ly/9d4kK8
		// get every submit button on the page and when clicked perform this function
		jQuery('input[type="submit"]').click(function() {
				var $i = jQuery(this);                 // variable i is each input we're working with
				var ilc = $i.parent().attr('class');            // grab the input's class
				var ilt = $i.attr('value');            // grab the input's value
				var ipu = window.location.pathname;    // grab the page url
				var cat = 'Input';                     // set this to your event category name
				var act = 'Submit';                          // set this to your event action name
				var lab = ipu + ' - ' + ilc + ' - ' + ilt;   // this is the full string sent to GA
				_gaq.push(['_trackEvent', cat , act , lab]); // this the final onClick event
		});
	

	}); // end jQuery ready

