/* <![CDATA[ */
 
var link = "http://www.amazon.com/TRUE-ADVENTURES-ABERNATHY-BOYS-ebook/dp/B003YUCQH8/ref=sr_1_6?ie=UTF8&qid=1296686059&sr=8-6";


function SelectAll(id)
{
    document.getElementById(id).focus();
    document.getElementById(id).select();
}
function kindle(){
 window.open(link,'_newtab');

}
var backgroundColor = 'red';
var existingBgColor = 'white';
	
 
 
function get(tr){
	//alert(hehehhe);
	if(tr == 1){

	}else{
		
		window.location = tr + "/getfile.php?state=2";
	}
}

  $(document).ready(function (){
 
$('#click').blink({delay:300});
$('#blink2').blink({delay:300});

 

	$(".prodDetails").fancybox({
    'titleShow'		: false,
	padding:5,
    'transitionIn'	: 'elastic',
    'transitionOut'	: 'elastic'
  });

				
$('#quick').fancybox({
	'scrolling'		: 'no',
	'titleShow'		: false,
	'onClosed'		: function() {
	    $("#login_error").hide();
	}
});	
$("#quickform").bind("submit", function() {

	if ($("#CaptchaTxt").val().length < 1 ) {
	    $("#CaptchaTxtError").show();
	    $.fancybox.resize();
	    return false;
	}
$(this).submit();
 
	return false;
});


			
			$(".video").click(function() {
	$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'elastic',
			'transitionOut'	: 'elastic',
			'title'			: this.title,
			'width'		: 680,
			'height'		: 495,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			   	 'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});

	return false;
	});
	
	$(".gallery a span").ready(function(){
    $(".gallery a span").animate({opacity:"0.50",speed:"fast"});
	});
	
	$(".gallery a").hover(function() {
		$(this).find('span').addClass("hover").stop()
			.animate({
        opacity: '0.5'
        
			}, 1000);
		
		} , function() {
		$(this).find('span').removeClass("hover").stop()
			.animate({
        opacity: '1'
			}, 2000);
	});
	
	/* Pajinate Script */
	$('#category').pajinate({
		num_page_links_to_display : 5,
		items_per_page : 9	
	});
	
  	$("body").ready(function(){
			$("body").animate({opacity:"0.2",speed:"fast"});
			$("body").animate({opacity:"1",speed:"fast"});
		});
/*Jquery Fancybox */ 
$(".fancypic2").fancybox().hover(function() {
$(this).click();
});

  $(".fancypic").fancybox({
    'titleShow'		: true,
	titlePosition:'inside',
    'transitionIn'	: 'elastic',
    'transitionOut'	: 'elastic'
  });


               jQuery.validator.addMethod("phoneUS", function(phone_number, element) {
    phone_number = phone_number.replace(/\s+/g, ""); 
  return this.optional(element) || phone_number.length > 9 &&
    phone_number.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/);
}, "Please specify a valid phone number");
  jQuery.validator.addMethod("lettersonly", function(value, element) {
    return this.optional(element) || /^[a-z\s]+$/i.test(value);
  }, "Letters only please");  
       $("#Contact_Form").validate({
    rules: {
      NameTxt:{
        required: true,
      lettersonly:true
      },
      EmailTxt: {
        required: true,
        email: true
      },
     CountryLst: "required",
    MessageTxt: "required",
    PhoneNum: {
         phoneUS: true
      },
     FaxNum: {
         phoneUS: true
      },
      SubjectTxt: "required",
      CaptchaTxt: "required"
    }
  });
     
      });
(function($)
{
	$.fn.blink = function(options)
	{
		var defaults = { delay:500 };
		var options = $.extend(defaults, options);
		
		return this.each(function()
		{
			var obj = $(this);
			setInterval(function()
			{
 				
				if($(obj).hasClass('colorwhite') )
				{
					$(obj).removeClass('colorwhite').addClass('colorgold');
				}
				else
				{
					$(obj).removeClass('colorgold').addClass('colorwhite');
				}
			}, options.delay);
		});
	}
}(jQuery))	  
/* ]]> */
