// JavaScript Document
jQuery(function(){

 //if ($.browser.webkit) {
 //   alert( "this is webkit!" );
 // }
//if ($.browser.msie) {
//    alert( "this is internet explorer!" );
//  }	
	
	
	//alert(navigator.userAgent);
	$('img.reflect').reflect({height: .5, opacity: .3});
	$('#merc, #bgImage').fadeTo('slow', .2);
	$('#mainHeader h1').textShadow();
	
	x = $(window).width();
	
	//$('#autoLink').click(function(){
		//alert('autolink clicked');
		$('#autoLink').click(function(){
			$('#rsb').fadeOut(2000);
			$('.maintext').slideUp(300, function(){
			  $('#mainHeader h1, .boldHeader').fadeTo(300,.1, function(){
				$('#mainHeader h1').html('&nbsp;').fadeIn(300, function(){
				  $('.boldHeader').html('Autos').css({'opacity':'.1'}).animate({opacity:1},300, function(){
				    $('#autoText').slideDown(300, function(){
					 $('.saleitem').hide().appendTo('#main').slideDown(1000, function(){
					   $('#mainHeader').css({'width': 'this.width'}).animate({width:this.width*19})
																});
																	}); 
																		});
																			});
																				});
																					});
			
			
			
		});//closes anonymous autolink function
			
		
		
		
		
		/*$(this).css({'background-color':'white','color':'red'});
		$('#header').fadeTo(900,.1);
		
			$('.maintext').fadeOut(700);
				$('#autoText').slideDown(1400);
					$('#rsb').slideUp(1500);
					$('#mainHeader h1').text('Autos For Sale').addClass('boldHeader').css({
														'font-family':'AirstreamRegular',
														'font-size':'3em'
								
														}) //had to duplicate font family and font size for some
			.animate({
				width: $(this).width() * 12.5, 
			},1500);
			$('#main').css({
					'float':'right',
					'margin-top':'-100px',
					'margin-right':'50px',
					'margin-bottom':'20px',
					'opacity':'.3',
			})
					.animate({
						width: $(this).width() * 12,
						opacity:'.9',
			},1000);
			
			$('.saleitem').css({'width':'30%','float':'left','margin-left':'15px','margin-bottom':'12px'}).appendTo('#main').hide().slideDown(1500);  */
			
			
		if ($.browser.msie) {
    		$('#main').css({
						'background-color':'rgb(13,13,13)',
						
			});
		}
		
	}); //ends #autoLink anonymous function triggered by the click event
	
	
	
	
//}); //ends doc ready handler





/*
var p = $('.triangle-l');
	var position = p.position();
	//alert(position.left + " left and top  " + position.top);

$('.triangle-l').position({
				my : 'top left',
				at : 'bottom center',
				of : '#main',
				offset : '-273% 15%'
	});
	$('.triangle-r').position({
				my : 'top right',
				at : 'bottom right',
				of : 'h1',
				offset : '269 16',
	}); 
*/
