
/*
if (jQuery) {  
   console.log(' jQuery is loaded '); 
} else {
   console.log('  jQuery is not loaded');
}

*/




$(document).ready(function() {
	
	/*$("#callback").validate();
	$("#emailus").validate();
	
	
	$("#commentForm").validate();*/
	
/*----------------------------- Contact Page -------------------------------*/	






$('#contactBottomContent2').hide();

	$('.contactTab2').click(function(){
		$('#contactBottomContent2').fadeIn(800);
		$('#contactBottomContent1').hide();
		});
		
	$('.contactTab1').click(function(){
		$('#contactBottomContent1').fadeIn(800);
		$('#contactBottomContent2').hide();
		});
	
	
	
						//-------CONTACT FORM
					
						$('#cfsubmit').click(function(){
							cfname = $('#cfname').val();
							cfemail = $('#cfname').val();
							cftel = $('#cfname').val();
							cfcomments = $('#cfname').val();
							cfname = $('#cfname').val();
							});
					
						//-------END CONTACT
	
	
	
	$('#galleryNav').load('gallery_nav.html');
      
      $('#wrapper').prepend('<div id="modalParent2"><div id="modalForm2"><table width="531" class="regular1" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td><img width="482" height="47" src="images/modal1.png"></td><td><img width="49" height="47" id="modalclose2" src="images/modal2.png"></td></tr><tr><td colspan="2"><table width="531" cellspacing="0" cellpadding="0" border="0" id="formTable"><tbody><tr><td colspan="3"><table width="530" border="0" cellspacing="0" cellpadding="0"><tr><td colspan="7" align="center">Please select your nearest centre</td></tr><tr><td width="38">&nbsp;</td><td width="143"><a href="http://mypetstop.co.uk/downloads/price_list1_catboarding.pdf"><img src="images/smallprice_denton.jpg" id="smallD"></a></td><td width="12">&nbsp;</td><td width="143"><a href="http://mypetstop.co.uk/downloads/price_list1_catboarding.pdf"><img src="images/smallprice_tingley.jpg" id="smallT"></a></td><td width="12">&nbsp;</td><td width="143"><a href="downloads/washington_smallanimal_prices.pdf"><img src="images/smallprice_washington.jpg" id="smallW"></a></td><td width="37">&nbsp;</td></tr></table></td></tr></tbody></table></td></tr><tr><td colspan="2"><img width="531" height="32" src="images/modal4.png"></td></tr></tbody></table></div></div>');
                            
                           
	
	
	$('.smallprices').click(function(){
//console.log('small');
		$('#modalParent2').fadeIn('slow');
	})
	
	
		
	$('#gotoadd').change(function(){
			var theval = $('#gotoval').val();
			
			$('#reLocation').val(theval);
			
				$(':input','#myform')	.not(':button, :submit, :reset, :hidden').val('').removeAttr('checked').removeAttr('selected');
	
	$('#modalback').fadeIn('slow');
	$('#modalParent').fadeIn('slow');
	$('#modalback').fadeTo('slow', 0.8);
		})
		
		
		/*-----IF IE------*/
	
	
	
	
	$('#startVid').click(function(){
	$('#modalback').show();
	$('#modalParent').show();
	$('#modalback').fadeTo('slow', 0.8);
		})
	
	
/*----------------------------- Contact Page -------------------------------*/	







$('#loadNav').load('ajax/newnav.html');




$('.basket').click(function(){
		alert('please call');
		//$('.basketModal').fadeIn('slow');
	})



/*-----------------------------------Direction Change-----------------------------------------*/

$('#start1').click(function(){
$('.dirChange').hide();
$('#directionChange1').show();
});
$('#start2').click(function(){
$('.dirChange').hide();
$('#directionChange2').show();
});
$('#start3').click(function(){
$('.dirChange').hide();
$('#directionChange3').show();
});
$('#start4').click(function(){
$('.dirChange').hide();
$('#directionChange4').show();
});

/*-----------------------------------END Direction Change-----------------------------------------*/

$('.quoteHover').mouseenter(function(){
		$(this).css('background', '#94bee5');
		
	
   $('.browserMenuBox').fadeIn(200);
  // $('#modalCover').fadeIn(200);
	});
		
		$('.quoteHover').mouseleave(function(){
		$(this).css('background' , '#7AB1E0');
		
  $('.browserMenuBox').fadeOut('slow');
  // $('#modalCover').fadeOut('slow');
	});
	
	
	 $('.browserMenuBox').mouseenter(function(){
  $(this).mouseenter(function(){
	 $(this).show(); 
	  	})
	});
	
	
	///-------------------------------------
	
	
		$('.serviceHover').mouseenter(function(){
		$(this).css('background', '#f99b1c');
		
	
   $('.browserMenuBox2').fadeIn(200);
  // $('#modalCover').fadeIn(200);
	});
		
		$('.serviceHover').mouseleave(function(){
		
		$(this).css('background' , '#7AB1E0');
   $('.browserMenuBox2').fadeOut('slow');
  // $('#modalCover').fadeOut('slow');
	});
	
	
	 $('.browserMenuBox2').mouseenter(function(){
  $(this).mouseenter(function(){
	 $(this).show(); 
	  	})
	});
	
 

	
	///-------------------------------------
	
	
		$('.priceHover').mouseenter(function(){
		$(this).css('background', '#c23063');
		
	
   $('.browserMenuBox3').fadeIn(200);
  // $('#modalCover').fadeIn(200);
	});
		
		$('.priceHover').mouseleave(function(){
		$(this).css('background' , '#7AB1E0');
		
		
   $('.browserMenuBox3').fadeOut('slow');
  // $('#modalCover').fadeOut('slow');
	});
	
	
	 $('.browserMenuBox3').mouseenter(function(){
  $(this).mouseenter(function(){
	 $(this).show(); 
	  	})
	});
	
	///-------------------------------------
	
	
		$('.centresHover').mouseenter(function(){
		$(this).css('background', '#ef444b');
		
	
   $('.browserMenuBox4').fadeIn(200);
  // $('#modalCover').fadeIn(200);
	});
		
		$('.centresHover').mouseleave(function(){
		$(this).css('background' , '#7AB1E0');
		
		
   $('.browserMenuBox4').fadeOut('slow');
  // $('#modalCover').fadeOut('slow');
	});
	
	
	 $('.browserMenuBox4').mouseenter(function(){
  $(this).mouseenter(function(){
	 $(this).show(); 
	  	})
	});
	
	///-------------------------------------
	
	
		$('.aboutHover').mouseenter(function(){
		$(this).css('background', '#ad8cc1');
		
	
   $('.browserMenuBox5').fadeIn(200);
  // $('#modalCover').fadeIn(200);
	});
		
		$('.aboutHover').mouseleave(function(){
		$(this).css('background' , '#7AB1E0');
		
		
   $('.browserMenuBox5').fadeOut('slow');
  // $('#modalCover').fadeOut('slow');
	});
	
	
	 $('.browserMenuBox5').mouseenter(function(){
  $(this).mouseenter(function(){
	 $(this).show(); 
	  	})
	});
	///-------------------------------------
	
	
		$('.reviewHover').mouseenter(function(){
		$(this).css('background', '#ad8cc1');
		//console.log('hit');
	
   $('.browserMenuBox6').fadeIn(200);
  // $('#modalCover').fadeIn(200);
	});
		
		$('.reviewHover').mouseleave(function(){
		$(this).css('background' , '#7AB1E0');
		
		
   $('.browserMenuBox6').fadeOut('slow');
  // $('#modalCover').fadeOut('slow');
	});
	
	
	 $('.browserMenuBox6').mouseenter(function(){
  $(this).mouseenter(function(){
	 $(this).show(); 
	  	})
	});
	
	
	////-------------------------------------------------
	
 $('#revStars').val(5);
 
 $('#1star').click(function(){
	 	$('#revStars').val(1);
		$('#1star').attr('src', 'images/starratefull.png');
		$('#2star').attr('src', 'images/starrateempty.png');
		$('#3star').attr('src', 'images/starrateempty.png');
		$('#4star').attr('src', 'images/starrateempty.png');
		$('#5star').attr('src', 'images/starrateempty.png');
	 });
 $('#2star').click(function(){
	 	$('#revStars').val(2);
		$('#1star').attr('src', 'images/starratefull.png');
		$('#2star').attr('src', 'images/starratefull.png');
		$('#3star').attr('src', 'images/starrateempty.png');
		$('#4star').attr('src', 'images/starrateempty.png');
		$('#5star').attr('src', 'images/starrateempty.png');
	 });
 $('#3star').click(function(){
	 	$('#revStars').val(3);
		$('#1star').attr('src', 'images/starratefull.png');
		$('#2star').attr('src', 'images/starratefull.png');
		$('#3star').attr('src', 'images/starratefull.png');
		$('#4star').attr('src', 'images/starrateempty.png');
		$('#5star').attr('src', 'images/starrateempty.png');
	 });
 $('#4star').click(function(){
	 	$('#revStars').val(4);
		$('#1star').attr('src', 'images/starratefull.png');
		$('#2star').attr('src', 'images/starratefull.png');
		$('#3star').attr('src', 'images/starratefull.png');
		$('#4star').attr('src', 'images/starratefull.png');
		$('#5star').attr('src', 'images/starrateempty.png');
	 });
 $('#5star').click(function(){
	 	$('#revStars').val(5);
		$('#1star').attr('src', 'images/starratefull.png');
		$('#2star').attr('src', 'images/starratefull.png');
		$('#3star').attr('src', 'images/starratefull.png');
		$('#4star').attr('src', 'images/starratefull.png');
		$('#5star').attr('src', 'images/starratefull.png');
	 });

/*bodywidth = document.documentElement.clientWidth;
bodyheight =$(window).height();
*/

var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    bodywidth = window.innerWidth;
    bodyheight = window.innerHeight;

bodywidth  = ((bodywidth/2)-350);
bodyheight  = ((bodyheight/2)-300);





  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    bodywidth = document.documentElement.clientWidth;
    bodyheight = document.documentElement.clientHeight;

bodywidth  = ((bodywidth/2)-550);
bodyheight  = ((bodyheight/2)-300);




  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    bodywidth = document.body.clientWidth;
    bodyheight = document.body.clientHeight;
  }



$('#modalForm').css('margin-left' , bodywidth);
$('#modalForm').css('margin-top' , bodyheight);


$('#addRevClick').click(function(){
	$(':input','#myform')	.not(':button, :submit, :reset, :hidden').val('').removeAttr('checked').removeAttr('selected');
	
	$('#modalback').fadeIn('slow');
	$('#modalParent').fadeIn('slow');
	$('#modalback').fadeTo('slow', 0.8);
	});
	
	$('#modalclose').click(function(){
		$('#modalback').fadeOut('slow');
	$('#modalParent').fadeOut('slow');
		})
	$('#modalclose2').click(function(){
		$('#modalback').fadeOut('slow');
	$('#modalParent2').fadeOut('slow');
		})
		
		$('#revTweet1').show();
		
		cyclet=setTimeout("revTweetCycle(0)",4000);
		

});



function revTweetCycle(num){
	
		 clearTimeout(cyclet);
	$('#revFade').removeClass('firstRevTweet');
	
			next = num+1;
			
			if(num ==5){
				next = 1;
				}
				
				$('#revTweet'+num).fadeOut(1250);
			
			$('#revTweet'+next).fadeIn(1250);
			
			revTweetCyclet=setTimeout("revTweetCycle("+next+")",10000);
}












