$(document).ready(function() {
	$("a[rel|=external]").attr('target', '_blank');
		
	$("input.submit").each(function(){
		$(this).replaceWith('<a href="#" class="sendit">' + $(this).attr('value') + '</a>');
	}); 	
	$(".sendit").click(function(event) {
		event.preventDefault();
		$(this).parents('form').submit();
		
/*		$('.guide').each(function() {
			var def_value = this.value;
			//alert(def_value);
			if(this.value == def_value) {
				this.value = '';
				$('#registerForm').valid(false);
			} else {
				$('#registerForm').valid();
				$(this).parents('form').submit();	
			}
		}); */
		
		
	});  
	
	
	// Remove default text from input on focus
	var names = {};
	$('.guide').each(function() {
		var def_value = this.value;
		$(this).focusin(function() {
			if ($(this).attr('id') == "pass") {
				passMake(this, "Password");
			} else if ($(this).attr('id') == "confirm_pass") {
				passMake(this, "Confirm Password");
			} else {
				if(this.value == def_value) {
					this.value = '';
				}
			}
		});
		$(this).focusout(function() {
			if ($(this).attr('id') == "pass") {
				textMake(this, "Password");
			} else if ($(this).attr('id') == "confirm_pass") {
				textMake(this, "Confirm Password");
			} else{
				if(this.value == '') {
					this.value = def_value;
				}
			}
		});
	});
	
	function textMake(e, ID){
		if( e.id == undefined )
			e = this;
		
		var defval = names[e.getAttribute('name')];
		if( e.value.length === 0 || e.value === defval  )
		{
			var parNode = e.parentNode;
			if( parNode != undefined )
				textBoxMake( parNode, e, 'text', defval, false );
		}
	}
	function passMake(e, ID){
		if( e.id == undefined )
			e = this;
		if( ID != undefined )
		{
			names[e.getAttribute('name')] = e.value;
			names[e.getAttribute('name') + "_id"] = e.id;
		}	
		if( e.value === names[e.getAttribute('name')] )
		{
			var parNode = e.parentNode;
			if( parNode != undefined )
			{
				e.value = "null";
				textBoxMake( parNode, e, 'password', "", true );
			}
		}
	}
	function textBoxMake( parNode, e, type, defval, focus )
	{
		var newO=document.createElement('input');
		newO.setAttribute('type', type );
		newO.className="passBox";
		newO.setAttribute('value', defval );
		newO.setAttribute('name',e.getAttribute('name'));
		parNode.replaceChild(newO,e);
		newO.id = names[e.getAttribute('name') + "_id"];
		
		$("input#pass").rules("add", {
			required: true,
			password:true,
			minlength: 6,
			messages: {
				required: "Please provide a password.",
				password: "Please provide a password.",
				minlength: "Your password must be at least 6 characters long."
			}
		});
		
		$("input#confirm_pass").rules("add", {
			required: true,
			password:true,
			minlength: 6,
			equalTo: "#pass",
			messages: {
				required: "Please confirm your password.",
				password: "Please confirm your password.",
				minlength: "Your password must be at least 6 characters long.",
				equalTo: "Please enter the same password as above."
			}
		});
		
		if( focus ) {
			newO.focus();
			newO.focus();
		}
		setTimeout(function() {
			var obj = $(newO);
			obj.bind('blur',function(e){ textMake(this) });
			obj.bind('focus',function(e){ passMake(this) });
			obj.keydown( keydownBind );
		},0);
	}
	
	function keydownBind(e){
		if (e.keyCode == 13) {
			$(this).parents('form').submit();
			return false;
		}
	}
	// Submit form when you click Enter on input field
	$('form.validate input').keydown( keydownBind );
	
	// Form validation
	$(".validate").each(function() {
		$(this).validate({
			focusInvalid: false,
			onfocusout: false,
			onkeyup: false,
			onclick: false
		});
	});
	
	if ($('#registerForm').length >0 ) {
		$("input#pass").rules("add", {
			required: true,
			password:true,
			minlength: 6,
			messages: {
				required: "Please provide a password.",
				password: "Please provide a password.",
				minlength: "Your password must be at least 6 characters long."
			}
		});
		
		$("input#confirm_pass").rules("add", {
			required: true,
			password:true,
			minlength: 6,
			equalTo: "#pass",
			messages: {
				required: "Please confirm your password.",
				password: "Please confirm your password.",
				minlength: "Your password must be at least 6 characters long.",
				equalTo: "Please enter the same password as above."
			}
		});
		
		$.validator.addMethod("fname", function(value, element) {
			if (($(element).val()) == "First Name"){
				return false;
			} else {
				return true;
			}
		}, "Please enter your first name");
		
		$.validator.addMethod("lname", function(value, element) {
			if (($(element).val()) == "Last Name"){
				return false;
			} else {
				return true;
			}
		}, "Please enter your last name");
		
		$.validator.addMethod("password", function(value, element) {
			if (($(element).val() == "Password") || ($(element).val() == "Confirm Password")){
				return false;
			} else {
				return true;
			}
		});
		
		$.validator.addMethod("company", function(value, element) {
			if (($(element).val()) == "Company or Organization"){
				return false;
			} else {
				return true;
			}
		}, "Please enter your company or organization");
		
		$.validator.addMethod("phone_num", function(value, element) {
			if (($(element).val()) == "Phone Number"){
				return false;
			} else {
				return true;
			}
		}, "Please enter only digits");
	}
	
		   
	if( $('.jSelect').length) {
        $(".jSelect").selectbox(); }
		
		if( $('#infochunkSmallText').length) {
		$("#infochunkSmallText").bulletsCarousel({  
             idContainer: 'infochunkSmallText',  
             idContent: 'CarouselContent',  
             leftButton: 'newsLeft' ,
			 rightButton: 'newsRight',
			 bulletList: 'bullets',
			 timer: true,
			 time: 5000
        });
        }
		
		if( $('#mainWrapper960_topFrontpage').length) {
	   	$('#mainWrapper960_topFrontpage').bulletsCarousel2({  
             idContainer: 'homepageText',  
             idContent: 'CarouselContentIndex',  
             leftButton: 'mainLeft' ,
			 rightButton: 'mainRight',
			 bulletList: 'mainbullets',
			 timer: true,
			 time: 9000
        });			   
	}	   
   
			   
		if($("#productContentHere").length != 0) {
		
		$("dl.vtabsTabsContainer dt:eq(0)").addClass("tabActive");
		$("#TabContent ul li").addClass("hide");
		$("#TabContent ul li:nth-child("+1+") ").removeClass("hide");
		$("#TabContent ul li:nth-child("+1+") ul li ").removeClass("hide");
		
		
		
			var active=0;
			
			$(".productSelect").selectbox();
		}
		$("dt.tab").click( function () {
										 
						var $this = $(this);
						$("dt.tab").removeClass('tabActive');
						$this.addClass("tabActive");
						var myIndex = $this.index();
						
						
						if(active!= myIndex) {
							$("#productContentHere").stop(true,true).fadeOut();
						
							$("#TabContent ul li:nth-child("+(myIndex+1)+") ").removeClass("hide").siblings("li").addClass("hide");
							$("#TabContent ul li:nth-child("+(myIndex+1)+") ul li ").removeClass("hide");
							active = myIndex;
							
							$("#productContentHere").stop(true,true).fadeIn();
						}
			});
		   
	   
		   

	if( $('#rssLink').length )
	{
		setTimeout( function(){ $('#rssLink').attr("href","http://www.zeusscientific.com/news-events/news/type/newsRSS/news_format/xml/"); },500);
	}

		   
	    if ($('#faqAccordion').length > 0) {
            $('#faqAccordion').accordion({
                autoHeight: false,
                active: '.open'
            });
        }  	   
		    if ($('.testsAccordion').length > 0) {
            $('.testsAccordion').accordion({
                autoHeight: false,
                active: '.open'
            });
        } 	
		
		

		
		
		   $("#subMenu").hover(function() {
					$("ul.subnav").stop(true, true).hide();	
					
			
			});
		   $("#topWrapper960").hover(function() {
					$("ul.subnav").stop(true, true).hide();	
								});
		//menu code
		$("div#mainMenu ul li.about").stop(true, true).mouseenter(function() { //When trigger is clicked...
			var myIndex =  $(this).index();
			var menuer =  " ul.subnav:eq("+ (myIndex) +")";
			

			$(menuer).css("width","200px");
				$("ul.subnav").stop(true, true).fadeOut(120);
				$(menuer).stop(true, true).fadeIn('fast'); //Drop down the subnav on click

		$(this).parent().hover(function() {
		}, function(){	
			$(this).parent().find(" ul.subnav").stop(true, true).hide(); //When the mouse hovers out of the subnav, move it back up
		});
		
		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() { 
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});
		



		$("div#mainMenu ul li.products").stop(true, true).mouseenter(function() { //When trigger is clicked...
			var myIndex =  $(this).index();
			var menuer =  " ul.subnav:eq("+ (myIndex) +")";
				

				
				$(menuer).css("width","580px");
				$(menuer).css("margin-left","-150px");
				
				$("ul.subnav").stop(true, true).fadeOut(120);
				$(menuer).stop(true, true).fadeIn('fast'); //Drop down the subnav on click

		$(this).parent().hover(function() {
		}, function(){	
			$(this).parent().find(" ul.subnav").stop(true, true).hide(); //When the mouse hovers out of the subnav, move it back up
		});
		
		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() { 
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});
		
		

		$("div#mainMenu ul li.contact").stop(true, true).mouseenter(function() { //When trigger is clicked...
			var myIndex =  $(this).index();
			var menuer =  " ul.subnav:eq("+ (myIndex) +")";
			
				$("ul.subnav").stop(true, true).fadeOut(120);
				
				if(typeof document.body.style.maxHeight === "undefined")
				$(menuer).css('height', '70px');
				
				$(menuer).stop(true, true).fadeIn('fast'); //Drop down the subnav on click

		$(this).parent().hover(function() {
		}, function(){	
			$(this).parent().find("ul.subnav").stop(true, true).hide(); //When the mouse hovers out of the subnav, move it back up
		});
		
		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() { 
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});
		
		
		
				$("div#mainMenu ul li.RnD").stop(true, true).mouseenter(function() { //When trigger is clicked...
			var myIndex =  $(this).index();
			var menuer =  " ul.subnav:eq("+ (myIndex) +")";
			
				$("ul.subnav").stop(true, true).fadeOut(120);
				$(menuer).css("width","215px");
				$(menuer).stop(true, true).fadeIn('fast'); //Drop down the subnav on click

		$(this).parent().hover(function() {
		}, function(){	
			$(this).parent().find("ul.subnav").fadeOut(120); //When the mouse hovers out of the subnav, move it back up
		});
		
		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() { 
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});
/// mnenu   


var imageArray = ['http://www.zeusscientific.com/fileadmin/templates/images/content/products/menu/elisa_menu.jpg', 'http://www.zeusscientific.com/fileadmin/templates/images/content/products/menu/ifa_menu.jpg', 'http://www.zeusscientific.com/fileadmin/templates/images/content/products/menu/athena_menu.jpg'];
 
// Add hidden element
var hidden = $('body').append('<div id="img-cache" style="display:none; width:1px; height:1px;"/>').children('#img-cache');
 
// Add images to hidden element.
$.each(imageArray, function (i, val) {
  $('<img/>').attr('src', val).appendTo(hidden);
});
	   
		   
		   
		   
		   
		   
		   
		   
		   	
	//faq appear dissapear;	   
	$("div.faqlink ul li").click( function() {
			
			var $this = $(this);
			
			var myIndex = $this.index();
										
			$("div.faqlink ul li:nth-child("+(myIndex+1)+") .faqlinkAnswer").slideToggle();							
	});
		   




		//Searchbox show/hide default text if needed
	$("#siteSearch").focus(function(){
		if($(this).attr("value") == "Quick Search") $(this).attr("value", "");
	});
	$("#siteSearch").blur(function(){
							   
		if($(this).attr("value") == "") $(this).attr("value", "Quick Search");
				
	});
	
	
	$("#masterForm input, #masterForm textarea, #surveyform textarea, #surveyform input").focus(function() {
				$(this).css("background-color", "#ebebef"); 						 
	});
	
	$("#masterForm input, #masterForm textarea, #surveyform textarea, #surveyform input").blur(function() {
				$(this).css("background-color", "#ffffff"); 						 
	});	
	///////////////////////////////
	$("#masterForm input, #masterForm textarea, #surveyform textarea, #surveyform input").mouseenter(function() {
				$(this).css("border-color", "#728D9C"); 						 
	});
	
	$("#masterForm input, #masterForm textarea, #surveyform textarea, #surveyform input").mouseleave(function() {
				$(this).css("border-color", "#d8d8d8"); 						 
	});	
	

	
	
	if($("input#State").length > 0) {
		
		$("input#State").autocomplete({
									  
	minLength: 1,
	source: ["AL - ALABAMA",
    "AK - ALASKA",
    "AZ - ARIZONA",
    "AR - ARKANSAS",
    "CA - CALIFORNIA",
    "CO - COLORADO",
    "CT - CONNECTICUT",
    "DE - DELAWARE",
    "FL - FLORIDA",
    "GA - GEORGIA",
    "HI - HAWAI",
    "ID - IDAHO",
    "IL - ILLINOIS",
    "IN - INDIANA",
    "IA - IOWA",
    "KS - KANSAS",
    "KY - KENTUCKY",
    "LA -LOUISIANA",
    "ME - MAINE",
    "MD - MARYLAND",
    "MA - MASSACHUSETTS",
    "MI - MICHIGAN",
    "MN - MINNESOTA",
    "MS - MISSISSIPPI",
    "MO - MISSOURI",
    "MT - MONTANA",
    "NE - NEBRASKA",
    "NV - NEVADA",
    "NH - NEW HAMPSHIRE",
    "NJ - NEW JERSEY",
    "NM - NEW MEXICO",
    "NY - NEW YORK",
    "NC - NORTH CAROLINA",
    "ND - NORTH DAKOTA",
    "OH - OHIO",
    "OK - OKLAHOMA",
    "OR - OREGON",
    "PA - PENNSYLVANIA",
    "RI - RHODE ISLAND",
    "SC - SOUTH CAROLINA",
    "SD - SOUTH DAKOTA",
    "TN - TENNESSEE",
    "TX - TEXAS",
    "UT - UTAH",
    "VT - VERMONT",
    "VA - VIRGINIA",
    "WA - WASHINGTON",
    "WI - WISCONSIN",
    "WY - WYOMING"]
});
	}
	
	
		$("#contactUsOnlineButton").keypress(function(e) {
 			 if ((e.keyCode || e.which) == 13)  {
			 	$(this).trigger("click");
			 }
			 });
		
	$("#surveyform label[for=signup]").click(function(){
		$(this).prev("span.jqTransformCheckboxWrapper").find('a.jqTransformCheckbox').trigger('click');
	});
	
	/* Validation here */
	var error = 0;
	
	
		$("#nameRequired").blur( function() {
			if($("#nameRequired").val().length >= 2)
			{
				$(".nameRequired").css("color", "#585858");
			}
		 });
		$("#lastnameRequired").blur( function() {
            		if($("#lastnameRequired").val().length >= 2)
            		{
                		$(".lastnameRequired").css("color", "#585858");
            		}	
            	});		

        	$("#companyRequired").blur( function() {
            		if($("#companyRequired").val().length > 1)
            		{
               			$(".companyRequired").css("color", "#585858");

            		}
        	});		
		

/*		$("#phonenumberRequired").blur( function() {	
		        if($("#phonenumberRequired").val().length >= 4)
            		{
                		$(".phonenumberRequired").css("color", "#585858");
            		}
		});*/
		$("#emailRequired").blur( function() {
			var emailR = $("#emailRequired").val();
			if($('a#submitSurvey').length)
			{
				if ( emailR.length==0 || (   (emailR.indexOf('@') > 0) || ((emailR.charAt(emailR.length-4) == '.') && (emailR.charAt(emailR.length-3) == '.'))   )) 
				{
					$(".emailRequired").css("color", "#585858");
				}
			}
			else
			{
				if ((emailR.indexOf('@') > 0) || ((emailR.charAt(emailR.length-4) == '.') && (emailR.charAt(emailR.length-3) == '.'))) 
				{
					$(".emailRequired").css("color", "#585858");
				}
			}
		});	
		
if( $("#jTextbox").length > 0 ) {
	$("#jTextbox").selectbox();
	
	$("form#masterForm").jqTransform(); 
}





if( $("#surveyform").length > 0 ) {$("form#surveyform").jqTransform(); }
	
	$("#contactUsOnlineButton, a#submitSurvey").click( function(e) {		
			e.preventDefault();
			error = 0;
			var emailR = $("#emailRequired").val();

			if($(this).attr('id')=="contactUsOnlineButton")
			{
				if($("#nameRequired").val().length < 2)
				{
					error=1;
					$(".nameRequired").css("color", "#F89807");
				}
				else {
					$(".nameRequired").css("color", "#585858");
				}
				
				if($("#lastnameRequired").val().length < 2)
				{
					error=1;
					$(".lastnameRequired").css("color", "#F89807");
				}	
				else {
					$(".lastnameRequired").css("color", "#585858");
				}
		
				if($("#companyRequired").val().length < 2)
				{
					error=1;
					$(".companyRequired").css("color", "#F89807");
				}    
				else {
					$(".companyRequired").css("color", "#585858");

				}			
				/*if($("#phonenumberRequired").val().length < 4)
				{
					error=1;
					$(".phonenumberRequired").css("color", "#F89807");
				}	
				else {
					$(".phonenumberRequired").css("color", "#585858");
				}
				if($("#textareaRequired").val().length < 7)
				{
					error=1;
					$(".textareaRequired").css("color", "#F89807");
				}	
				else {
					$(".textareaRequired").css("color", "#585858");
				}*/
				if ((emailR.indexOf('@') < 0) || ((emailR.charAt(emailR.length-4) != '.') && (emailR.charAt(emailR.length-3) != '.'))) 
				{
					error=1;
					$(".emailRequired").css("color", "#F89807");
					//$("#emailRequired").css("background-color", "#D6C5C5");
				}	
				else {
					$(".emailRequired").css("color", "#787878");
				}
				if($("#countryRequired").val() == "0")
				{
					error=1;
					$(".countryRequired").css("color", "#F89807");
				}
				else {
					$(".countryRequired").css("color", "#585858");
				}
			}
		
			if($(this).attr('id')=="submitSurvey"){
				
				if (( emailR.length>0 && ((emailR.indexOf('@') < 0) || ((emailR.charAt(emailR.length-4) != '.') && (emailR.charAt(emailR.length-3) != '.'))))) 
				{
					error=1;
					$(".emailRequired").css("color", "#F89807");
					//$("#emailRequired").css("background-color", "#D6C5C5");
				}	
				else {
					$(".emailRequired").css("color", "#787878");
				}
			}
			
			if(error==1) {
				$("#contactNote").show("slow");
				$("#contactNote").animate({width: '600px', delay:840});
			}
			
			if(error==0 && $("#contactSubmit").length ) {
				$("#contactSubmit").trigger("click");
			//$("#masterForm").submit();
			}
			if(error==0 && $('#surveyform').length)	{
				$('form#surveyform .submit').trigger("click");
				//$('form#surveyform').trigger("click");
			}
	
	if($("#masterForm").length > 0) {
	   setTimeout( "$('#masterForm').jqTransform({imgPath:'jqtransformplugin/img/'})", 5000);	
	}

	  });
	if(	$("#phonenumberRequired").length > 0)
	$("#phonenumberRequired").numeric();
	
	if($("#filterProductList").length > 0)
		$("#filterProductList").filterSearch(); 

	
	$(".continentSelect").change(function() {
	
		if($(this).val() !=0) {
		$(this).closest("form").submit();
		}
	});	
	$(".productSelect").change(function() {
		$(this).closest("form").submit();
	});		
	
	 $("table tr:even td").addClass("CellA");
	 
	 






	 
	//Modal
	//firstTime = false;
	//Show Online Interactive Features Modal
if($('a.showVideo').length > 0) {
	$('a.showVideo').each(  function(){
		$(this).click( function(e){
			e.preventDefault();					 
			/*$('.window').removeClass('hide');
			$('.window').addClass('show');*/
			var id = '.window';  
			      
	        //Get the screen height and width  
	        var maskHeight = $(document).height();  
	        if( $.browser.msie )
	        maskHeight = maskHeight - 4; 
	        
	        var maskWidth = $(window).width();  
	        if( $.browser.msie )
	        maskWidth = maskWidth - 4;
	       
	        
	        //Set height and width to mask to fill up the whole screen  
	        $('#mask').css({'width':maskWidth,'height':maskHeight});  
	        $('#mask').css('top',  0);  
	        $('#mask').css('left', 0);  
	          
	        //transition effect    
	        if( !($.browser.msie) ) {
	        $('#mask').animate({opacity: 0.25}); 
	        $('#mask').fadeIn(440); }
	              
	        if( $.browser.msie ) {
			$('#mask').fadeTo(0,0).show().fadeTo("fast",0.3);
	        //$('#mask').fadeIn(100);
	        
	      	}
	        //Get the window height and width  
	        var winH = $(window).height();  
	        var winW = $(window).width();  
	                
	        //Set the popup window to center  
	       $(id).css('top',  winH/2-$(id).outerHeight()/2 );  
	       $(id).css('left', winW/2-$(id).outerWidth()/2 );  
	       
	        //$(id).css("top", ( $(window).height() - this.outerHeight() ) / 2+$(window).scrollTop() + "px");
     		//$(id).css("left", ( $(window).width() - this.outerWidth() ) / 2+$(window).scrollLeft() + "px");
	      
	        //transition effect  
	        $(id).fadeIn(700);   
			
			
			//should reposition to middle
			/*if ($('videoplayer')) {
				playHomePageFlash();
			}*/
		});
	});
	
	
	$('a.closeVideoModal').each(  function(){
		$(this).click( function(e){
			e.preventDefault();					 
			//$('.window').removeClass('show');
			//$('.window').addClass('hide');
			$('#mask').fadeOut(700); 
			$('.window').fadeOut(100, function(){ stopHomePageFlash(); });
			
			/*if ($('videoplayer')) {
				stopHomePageFlash();
			}*/
		});
	});
	
	// keyboard ESC press
	$(window.document).keydown(function(e){
		//alert(e.keyCode);
		if(e.keyCode == 27){
			if ($('.closeVideoModal')) 		{$('.closeVideoModal').trigger('click');}
		};
	});
	$('#mask').click( function(e){
		if ($('.closeVideoModal')) 		{$('.closeVideoModal').trigger('click');}
	});
}


/* Survey Form */
if ($('#surveyform').length > 0){
	/* Q4 */
	$('#other_4').focus(function() {
		$(this).parents().find("#q4_4").prev("a.jqTransformRadio").trigger('click');
	});
	$("input[name='4']").click(function(){ 
		if ($(this).attr('id') != "q4_4"){
			$('#other_4').val('');
		}
	});
	
	/* Q11 */
	$('#other_11').focus(function() {
		$(this).parents().find("#q11_4").prev("a.jqTransformRadio").trigger('click');
	});
	$("input[name='11']").click(function(){ 
		if ($(this).attr('id') != "q11_4"){
			$('#other_11').val('');
		}
	});
	
	/* Q12 */
	$('#answer_q12_1').focus(function() {
		$(this).parents().find("#q12_1").click();
		$(this).parents().find("#q12_1").prev("a.jqTransformRadio").trigger('click');
		$("#answer_q12_2").val('');
		$("#answer_q12_3").val('');
	});
	$('#answer_q12_2').focus(function() {
		$(this).parents().find("#q12_2").click();
		$(this).parents().find("#q12_2").prev("a.jqTransformRadio").trigger('click');
		$("#answer_q12_1").val('');
		$("#answer_q12_3").val('');
	});
	$('#answer_q12_3').focus(function() {
		$(this).parents().find("#q12_3").click();
		$(this).parents().find("#q12_3").prev("a.jqTransformRadio").trigger('click');
		$("#answer_q12_1").val('');
		$("#answer_q12_2").val('');
	});
	
	$("input[name='12']").click(function(){
		if ($(this).attr('id') == "q12_1"){
			$("#answer_q12_2").val('');
			$("#answer_q12_3").val('');
		} else if ($(this).attr('id') == "q12_2"){
			$("#answer_q12_1").val('');
			$("#answer_q12_3").val('');
		} else {
			$("#answer_q12_1").val('');
			$("#answer_q12_2").val('');
		}
	});
	
	$('#surveyform ol li:even').addClass('even');
	$('#surveyform ol li:odd').addClass('odd');
	
	$('body').addClass('survey');	
}


});



function getFlashMovie(movieName) {   
	var isIE = navigator.appName.indexOf("Microsoft") != -1;   
	return (isIE) ? window[movieName] : document[movieName];  
}  
function rollOutFromVideo(id) {
	getFlashMovie(id).videoPlayerRollout();
}
function stopHomePageFlash() {
	if($('videoplayer')){
		//alert(getFlashMovie('videoplayer'));
		if( $.browser.msie ) {
		getFlashMovie('videoplayer').stopVideo();
		}
	} 
}
function playHomePageFlash() {
	if($('videoplayer')){
		//alert( getFlashMovie('videoplayer') );
		getFlashMovie('videoplayer').playVideo();
	}
}


/*
CSS Browser Selector v0.4.0 (Nov 02, 2010)
Rafael Lima (http://rafael.adm.br)
http://rafael.adm.br/css_browser_selector
License: http://creativecommons.org/licenses/by/2.5/
Contributors: http://rafael.adm.br/css_browser_selector#contributors
*/
function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\/(\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\s|\/)(\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}; css_browser_selector(navigator.userAgent);
