jQuery.noConflict();

jQuery(document).ready(function(){
	
	jQuery.ajaxSetup ({  
		cache: false
	});
	
	jQuery(".iconTip").tipTip({delay: 0, defaultPosition: "top", edgeOffset: 3});
	
	jQuery('#commissions').accordion({collapsible: 'true', autoHeight: 'false', active: 'false'});
	
	// ajax handling
	jQuery('a.ajax').livequery('click',function(event){
		jQuery('#loading').stop().animate({left:'80px'}, 300);
		event.preventDefault();
		jQuery.get(this.href,{},function(response){
			jQuery('#photoList').fadeOut('fast',function(){
				jQuery('#photoList').html(response);
				jQuery('#photoList').fadeIn('normal');
				jQuery('#loading').stop().fadeTo(500,0);
				jQuery('#loading').stop().animate({left:'0px'}, 200);
			});
		});
	});
	
	// rollovers
	jQuery('#logo').hover(function() {
        jQuery(this).stop().fadeTo(250,0.5);
    }, function() {
        jQuery(this).stop().fadeTo(500,1);
    });
    
    //jQuery('.menuItem').stop().animate({opacity: .8}, 0);
    jQuery('.menuItem').hover(function() {
        jQuery(this).stop().animate({color: '#333333'}, 500);
    }, function() {
        jQuery(this).stop().animate({color: '#797979'}, 500);
    });
    
    jQuery('.menuItemBig').hover(function() {
        jQuery(this).stop().animate({color: '#000000'}, 500);
    }, function() {
        jQuery(this).stop().animate({color: '#797979'}, 500);
    });
    
    jQuery('#commissions').accordion();
    
    var options = { 
		success: function() { 
			jQuery('#photoList').fadeOut("normal", function() {
				jQuery('#photoList').html("<div class='right-column fr' style='font-size: 14px'><span style='color: #222; font-size: 40px'>Success!</span><br/><span style='color: #555; font-size: 18px'>Your message has successfully been sent.<br/>Thank you for your question / comment / interest!</span><div style='margin-top: 10px'>You will be returned to the previous page shortly.</div></div><div class='clear'></div>");
				jQuery('#photoList').fadeIn('normal', function() {
					jQuery.get("inc/contact.php",{},function(response){
						jQuery('#photoList').delay(5000).fadeOut("normal", function() {
							jQuery('#photoList').html(response);
							jQuery('#photoList').fadeIn('normal');
							jQuery('#formLoading').stop().fadeTo(0,0);
						});
					});
				});
			});
		} 
	};
    
    jQuery('.submit').livequery('click',function(){
		jQuery('#contactForm').validate({
			submitHandler: function(form) {
				jQuery('.submit').hide();
				jQuery('#formLoading').stop().fadeTo(500,1);
				jQuery(form).ajaxSubmit(options);
			}
		});
	});
    
});
/*
var message="";

function clickIE4() {
	if (event.button==2) {
		alert(message);
		return false;
	}
}

function clickNS4(e) {
	if (document.layers||document.getElementById&&!document.all) {
		if (e.which==2||e.which==3) {
			alert(message);
			return false;
		}
	}
}

if (document.layers) {
	document.captureEvents(Event.MOUSEDOWN);
	document.onmousedown=clickNS4;
} else if (document.all&&!document.getElementById) {
	document.onmousedown=clickIE4;
}

document.oncontextmenu = new Function("return false")
*/
