$(function(){
	$("th:nth-child(odd)").addClass("odd");
	$("tr:nth-child(even)").addClass("even");
	
	$("tr:not(:first-child)").mouseover(function(){
		$(this).addClass("hover");
	}).mouseout(function(){
		$(this).removeClass("hover");
	});
});




$(function(){
	
	$("#carouselInner").css("width",640*$("#carouselInner ul.column").size()+"px");
	$("#carouselInner ul.column:last").prependTo("#carouselInner");
	$("#carouselInner").css("margin-left","-640px");
	
	$("#carouselPrev").click(function(){
		$("#carouselNext,#carouselPrev").hide();
		$("#carouselInner").animate({
			marginLeft : parseInt($("#carouselInner").css("margin-left"))+640+"px"
		},"slow","swing" , 
		function(){
			$("#carouselInner").css("margin-left","-640px")
			$("#carouselInner ul.column:last").prependTo("#carouselInner");
			$("#carouselNext,#carouselPrev").show();
		});
	});
	
	$("#carouselNext").click(function(){
		$("#carouselNext,#carouselPrev").hide();
		$("#carouselInner").animate({
			marginLeft : parseInt($("#carouselInner").css("margin-left"))-640+"px"
		},"slow","swing" , 
		function(){
			$("#carouselInner").css("margin-left","-640px");
			$("#carouselInner ul.column:first").appendTo("#carouselInner");
			$("#carouselNext,#carouselPrev").show();
		});
	});
	
	var timerID = setInterval(function(){
		$("#carouselNext").click();
	},5000);
	
	$("#carouselPrev img,#carouselNext img").click(function(){
		clearInterval(timerID);
	});



	
});

/*$(function(){
	$("div.tooltip").css("opacity","0.9").hide();
	$("#aboutus a").mouseover(function(){
		$("div.tooltip:not(:animated)").fadeIn("slow").css({
			"top":$(this).offset().top-158+"px",
			"left":$(this).offset().left+$(this).width()+"px"
		});
	}).mouseout(function(){
		$("div.tooltip:not(:animated)").fadeOut("slow");
		setTimeout(function(){$("div.tooltip").hide();},5000);
	
	});
});
*/



$(function(){
	$("#footer #aboutus a").click(function(){

$("#carouselWrap").hide();
$("#brand").hide();
$("#rightcontentsbox p").hide();
$("#rightcontentsbox").load("../Information/About_Us.html dl", function(){
	$("#rightcontentsbox dd:not(:first)").css("display","none");
	$("#rightcontentsbox dt:first").addClass("selected");
	$("#rightcontentsbox dl dt").click(function(){
		if($("+dd",this).css("display")=="none"){
			$("#rightcontentsbox dd").slideUp("slow");
			$(" +dd",this).slideDown("slow");
			$("#rightcontentsbox dt").removeClass("selected");
			$(this).addClass("selected");
		}
	}).mouseover(function(){
		$(this).addClass("over");
	}).mouseout(function(){
		$(this).removeClass("over");
	});
});
	});
});




$(function(){
	$("#leftmenubox  .wheretobuy a").click(function(){
	$("#rightcontentsbox p").hide();
	$("#carouselWrap").hide();
	$("#rightcontentsbox ").load("../Information/Where_To_Buy.html dl");
	});
});




$(function(){
	$("#leftmenubox  .contact a").click(function(){
	$("#rightcontentsbox p").hide();
	$("#carouselWrap").hide();
	$("#rightcontentsbox ").load("../Information/Contact_Us.php",function(){
		$("#return").hide();
		$("#send").hide();
	$("#confirm").click(function(){
		$("p.error").remove();
		$("tr td").removeClass("error");
		$(":text,textarea").filter(".validate").each(function(){
			

			$(this).filter(".required").each(function(){
				if($(this).val()==""){
					$(this).parent().prepend("<p class='error'>Required</p>");
				}
			});
			

			$(this).filter(".number").each(function(){
				if($(this).val()==""){
					$(this).parent().prepend("<p class='error'>Required</p>");
				}
				if(isNaN($(this).val())){
					$(this).parent().prepend("<p class='error'>Number Only</p>");
				}
			});
			

			$(this).filter(".mail").each(function(){
				if($(this).val()==""){
					$(this).parent().prepend("<p class='error'>Required</p>");
				}
				if($(this).val() && !$(this).val().match(/.+@.+\..+/g)){
					$(this).parent().prepend("<p class='error'>Please enter a valid email address.</p>");
				}
			});
			
		});


		if($("p.error").size() > 0){
				
				$("p.error").parent().addClass("error");
				return false;
		}else{
		$("span").hide();
		$("#return").show();
		$("#confirm").hide();
		$("#send").show();
   document.getElementById("name").readOnly = true;
   document.getElementById("address").readOnly = true;
   document.getElementById("city").readOnly = true;
   document.getElementById("state").readOnly = true;
   document.getElementById("zip").readOnly = true;
   document.getElementById("country").readOnly = true;
   document.getElementById("email").readOnly = true;
   document.getElementById("phone").readOnly = true;
   document.getElementById("model").readOnly = true;
   document.getElementById("serial").readOnly = true;
   document.getElementById("comment").readOnly = true;
}

	});

	$("#return").click(function(){
   document.getElementById("name").readOnly = false;
   document.getElementById("address").readOnly = false;
   document.getElementById("city").readOnly = false;
   document.getElementById("state").readOnly = false;
   document.getElementById("zip").readOnly = false;
   document.getElementById("country").readOnly = false;
   document.getElementById("email").readOnly = false;
   document.getElementById("phone").readOnly = false;
   document.getElementById("model").readOnly = false;
   document.getElementById("serial").readOnly = false;
   document.getElementById("comment").readOnly = false;
   		$("#return").hide();
		$("#confirm").show();
		$("#send").hide();

});




});

	});
});



$(function(){
	$("#leftmenubox  .repairservice a").click(function(){
	$("#rightcontentsbox p").hide();
	$("#carouselWrap").hide();
	$("#rightcontentsbox ").load("../Information/Repair_Service.html div",function(){
	$("ul.panel li:not("+$("ul.tab li a.selected").attr("href")+")").hide();
	$("ul.tab li a").click(function(){
		$("ul.tab li a").removeClass("selected");
		$(this).addClass("selected");
		$("ul.panel li").slideUp("slow");
		$($(this).attr("href")).slideDown("slow");
		return false;
	});
});





	});
});

$(function(){
	$("#clean_room").click(function(){
	$("#rightcontentsbox p").hide();
	$("#carouselWrap").hide();
	$("#rightcontentsbox ").load("../Information/Connection_Guide.html div",function(){
	$("ul.panel li:not("+$("ul.tab li a.selected").attr("href")+")").hide();
	$("ul.tab li a").click(function(){
		$("ul.tab li a").removeClass("selected");
		$(this).addClass("selected");
		$("ul.panel li").slideUp("slow");
		$($(this).attr("href")).slideDown("slow");
		return false;
	});
});

	});
});

$(function(){
	$("#leftmenubox  .connection a").click(function(){
	$("#rightcontentsbox p").hide();
	$("#carouselWrap").hide();
	$("#rightcontentsbox ").load("../Information/Connection_Guide.html",function(){
	$("ul.panel li:not("+$("ul.tab li a.selected").attr("href")+")").hide();
	$("ul.tab li a").click(function(){
		$("ul.tab li a").removeClass("selected");
		$(this).addClass("selected");
		$("ul.panel li").slideUp("slow");
		$($(this).attr("href")).slideDown("slow");
		return false;
	});
});

	});
});

$(function(){
	$("#leftmenubox  .firmware a").click(function(){
	$("#rightcontentsbox p").hide();
	$("#carouselWrap").hide();
	$("#rightcontentsbox ").load("../Information/Firmware_Update.php div",function(){
	$("ul.panel li:not("+$("ul.tab li a.selected").attr("href")+")").hide();
	$("ul.tab li a").click(function(){
		$("ul.tab li a").removeClass("selected");
		$(this).addClass("selected");
		$("ul.panel li").slideUp("slow");
		$($(this).attr("href")).slideDown("slow");
		return false;
	});
});
	});
});



/*
$(function(){
	$("#leftmenubox  .asc a").click(function(){
	$("#rightcontentsbox p").hide();
	$("#carouselWrap").hide();
	$("#rightcontentsbox ").load("../Information/ASC_1.php div",function(){ 

			$("select").change(function(){ 

					ajax_search();

			});
	
		
	});

	function ajax_search(){

		var search_val=$("#search_state").val(); 
		$.post("../Information/ASC_Search.php", {search_state : search_val}, function(data){
		if (data.length>0){

	$("#asc_title").slideUp("slow");
			$("#search_results").html(data); 
	$("th:nth-child(odd)").addClass("odd");
	$("tr:nth-child(even)").addClass("even");
	
	$("tr:not(:first-child)").mouseover(function(){
		$(this).addClass("hover");
	}).mouseout(function(){
		$(this).removeClass("hover");

	});


		}


	})

}

	});

});
*/


$(function(){
	$("#leftmenubox  .asc a").click(function(){
	$("#rightcontentsbox p").hide();
	$("#carouselWrap").hide();
	$("#rightcontentsbox ").load("../Information/search_map.html",function(){ 

			$(document).ready(function(){ 

					apiready();

			})
	

  function apiready() {
    var script = document.createElement("script");
    script.type = "text/javascript";
    script.src = "http://maps.google.com/maps/api/js?sensor=false&callback=load";

    document.body.appendChild(script);
  }

		
	});

	});

});






function disp(){

	window.alert("Firmware Information and Download\n\nIMPORTANT - PLEASE READ CAREFULLY\n\nPlease review and accept the following license agreement to proceed and download the software.\n\nBy installing, copying, downloading, accessing, or otherwise using the software you agree to be bound by the terms and conditions as Stated Below:\n\nI. You are granted the right to download, install, and use a copy of the firmware provided for the use of updating software on the product.\nII. You may not modify, reverse engineer, decompile, or disassemble the software.\nIII. You may not use the software for any purpose other than software updating.\nIV. This software is provided AS-IS without warranty of any kind.In no event shall FUNAI be liable for any special, incidental, indirect or consequential damages and losses arising out of the use of this software.\nV. You agree that the software may not be shipped, transferred or exported into any country or used in any manner prohibited by United States Export Administration Act or any other applicable export laws or regulations. ");

}


$(function(){
	$("a.PrivacyPoricy").click(function(){
		$("#PrivacyPoricy").fadeIn("fast");
		return false;
	});
	
	$("#PrivacyPoricy a.close").click(function(){
		$("#PrivacyPoricy").fadeOut("fast");
		return false;
	});
	
	
	$("#PrivacyPoricy dl dt").mousedown(function(e){
		
		$("body").bind('selectstart', function(){
			return false;
		});
		
		$("#PrivacyPoricy")
			.data("clickPointX" , e.pageX - $("#PrivacyPoricy").offset().left)
			.data("clickPointY" , e.pageY - $("#PrivacyPoricy").offset().top);
		
		$(document).mousemove(function(e){
			$("#PrivacyPoricy").css({
				top:e.pageY  - $("#PrivacyPoricy").data("clickPointY")+"px",
				left:e.pageX - $("#PrivacyPoricy").data("clickPointX")+"px"
			});
		});
		
	}).mouseup(function(){
		$("body").unbind('selectstart');
		$(document).unbind("mousemove");
		
	});
});

$(function(){
	$("a.Term").click(function(){
		$("#Term").fadeIn("fast");
		return false;
	});
	
	$("#Term a.close").click(function(){
		$("#Term").fadeOut("fast");
		return false;
	});
	
	
	$("#Term dl dt").mousedown(function(e){
		
		$("body").bind('selectstart', function(){
			return false;
		});
		
		$("#Term")
			.data("clickPointX" , e.pageX - $("#Term").offset().left)
			.data("clickPointY" , e.pageY - $("#Term").offset().top);
		
		$(document).mousemove(function(e){
			$("#Term").css({
				top:e.pageY  - $("#Term").data("clickPointY")+"px",
				left:e.pageX - $("#Term").data("clickPointX")+"px"
			});
		});
		
	}).mouseup(function(){
		$("body").unbind('selectstart');
		$(document).unbind("mousemove");
		
	});
});
	


$(function(){
			$("body").append("<div id='glayLayer'></div><div id='overLayer'></div>");
			
			$("#glayLayer").click(function(){
				$(this).hide()
				$("#overLayer").fadeOut("slow");
			});
			
			$("a.modal").click(function(){
				$("#glayLayer").fadeIn("slow");
				$("#overLayer").fadeIn("slow").html("<img src='"+$(this).attr("href")+"' />");
				return false;
			});
			
			if($.browser.msie && $.browser.version<7){
				$(window).scroll(function(){
					$("#glayLayer").css('top',$(document).scrollTop());
					$("#overLayer").css('top',($(document).scrollTop()+$(window).height()/2) +"px");
				});
			}
			
		});






