// javascripts and amendments to the jQuery plugin scripts

//slideshow speed
$.fn.cycle.defaults.speed   = 900;
$.fn.cycle.defaults.timeout = 6000;

$(function() {

	//fade in the entire page
	//$('#content-wrapper' ).fadeIn("slow");	
	
	//run the code between the pre tags
    $('pre code').each(function() {
        eval($(this).text());
    });
	
	//$(".ajaxcontactlink").attr("href", "javascript: void(0)")
	
	//AJAX form injection
	/*$(".ajaxcontactlink").click(function() {
		$( 'html, body' ).animate( { scrollTop: 0 }, 'slow' );
		if ( $("#contactbox").html() == "") {
			$("#contactbox").load("ajaxform.php").delay(500);
			$("#contactbox").slideDown("slow");
		} else {
			$("#contactbox").slideToggle("slow");
		}
	});*/
	
	
	//top menu animate
	$('#top_nav ul li a')
	.mouseover(function() {
		$(this).stop().animate( {backgroundPosition: "-170px 0px"},500 );
	})
	.mouseout(function(){
		$(this).stop().animate( {backgroundPosition: "0px 0px"},500 );
	});
	
	//footer menu animate
	$('#footerlinks li a')
	.mouseover(function() {
		$(this).parent().stop().animate( {paddingLeft: "30px"},150 );
	})
	.mouseout(function(){
		$(this).parent().stop().animate( {paddingLeft: "20px"},150 )
	});
	
	//footer imagelinks fade
	$("#footerlinks2 p a img").hover(
		function () 
		{
			$(this).stop().fadeTo("fast", 0.66);
		}, 
		function () 
		{
			$(this).stop().fadeTo("fast", 1.00);
		}
	);
	
	//add email
	var name = "info";
	var domain = "allroundprop";
	emailaddy = name + "@" + domain + ".co.za"
	emailmailto = "<a href='mailto:" + emailaddy + "? Subject=ARPS%20Website%20Enquiry'>" + emailaddy + "</a>"
	$(".addemail").html(emailmailto);
	
});
