


/* preload ...always at top or Safari chokes */


function preloader(){
                document.getElementById("preloader").style.display = "none";
                document.getElementById("outerwrapper").style.display = "block";
				
        }//preloader
        window.onload = preloader;






/* email obfuscation */

	
	function emailmix(username, dispname){
	document.write('<a id="email" href="' + 'mailto:' + username + '@' + "tony-johnson" + '.' + "com" + '">' + dispname + '</a>');
	}	



/* max characters on contect text area */

function limitText(limitField, limitNum) {
    if (limitField.value.length > limitNum) {
        limitField.value = limitField.value.substring(0, limitNum);
    } 


}



/* initiate jquery functions that require dom ready */



$(document).ready(function() {
						   
						   
		


    $('#webslides').cycle({
		fx: 'scrollHorz',
		speed:   700, 
    timeout: 0,
	pager:  '#webcontrols',
	
	next:   '#next', 
    prev:   '#prev'
		
	});
	
	
$('#printslides').cycle({
		fx: 'scrollHorz',
		speed:   700, 
    timeout: 0,
	pager:  '#printcontrols',
	
	next:   '#next2', 
    prev:   '#prev2'
		
	});
	
	
	
	
/* contact form */
	

	$('#contactform').ajaxForm(function(data) {
				
	if (data==1){
				
	$('#success').fadeIn("slow");
					
					
	$('#bademail').fadeOut("fast");
					
					
	$('#contactform').resetForm();
					
				}
				
	else if (data==2){
					$('#badserver').fadeIn("slow");
			}
			else if (data==3)
				{
			$('#bademail').fadeIn("slow");
				}
			});




/* chair info hover */



$("#wassilychair a").hover(function() {
									
		$(this).next("em").animate({opacity: "show"}, "3000");
	}, function() {
		$(this).next("em").animate({opacity: "hide"}, "2000");
	});




});




