// JavaScript Document for Sony Bravia PS3 promote site

// Digi only input restriction
function onKeyPressNumbers(e) {
   var key = window.event ? e.keyCode : e.which; // IE and Netscape event
   var keychar = String.fromCharCode(key); // Takes the specified Unicode values and returns a string
   reg = /\D/; 
   return !reg.test(keychar);  //RegExpObject.test(string) 
}

function printWindow(){
	window.print();
}

// jQuery settings
$(document).ready(function(){
	$(".mainNavList li a").each(function () {
		$(this).append("<span></span>");
    });
	
    $(".mainNavList li a").hoverIntent(
      function () {
        $(this).children("span").fadeOut();
      }, 
      function () {
        $(this).children("span").fadeIn(); 
      });
	
	//faq
	$(".faq_list dd").wrapInner("<div class='faq_answer'></div>");
	$(".faq_list dt").click(function(){
		var thisAnswer = $(this).next("dd");
		var otherQuestions = $(this).siblings("dt").not($(this));
		$(this).addClass("question_bold");
		otherQuestions.removeClass("question_bold");
		$(this).siblings("dd").not(thisAnswer).hide();
		if (thisAnswer.is(":visible")){
			thisAnswer.hide();
		}else{
			thisAnswer.slideDown();
			
		}
	});

});
