function getPage(color, start)
{

 
  ajax('google.php?q='+encodeURIComponent(jQuery('#search').val())+'&imgcolor='+color+'&start='+start,'container','none');
  

}


$(document).ready(function() {
	
	
	$("#topnav li").prepend("<span></span>"); //Throws an empty span tag right before the a tag
	
	$("#topnav li").each(function() { //For each list item...
		var linkText = $(this).find("a").html(); //Find the text inside of the a tag
		$(this).find("span").show().html(linkText); //Add the text in the span tag
	}); 
	
	$("#topnav li").hover(function() {	//On hover...
		$(this).find("span").stop().animate({ 
			marginTop: "-40" //Find the span tag and move it up 40 pixels
		}, 250);
	} , function() { //On hover out...
		$(this).find("span").stop().animate({
			marginTop: "0" //Move the span back to its original state (0px)
		}, 250);
	});
	
	
	$("#topnav1 li").prepend("<span></span>"); //Throws an empty span tag right before the a tag
	
	$("#topnav1 li").each(function() { //For each list item...
		var linkText = $(this).find("a").html(); //Find the text inside of the a tag
		$(this).find("span").show().html(linkText); //Add the text in the span tag
	}); 
	
	$("#topnav1 li").hover(function() {	//On hover...
		$(this).find("span").stop().animate({ 
			marginTop: "-40" //Find the span tag and move it up 40 pixels
		}, 250);
	} , function() { //On hover out...
		$(this).find("span").stop().animate({
			marginTop: "0" //Move the span back to its original state (0px)
		}, 250);
	});

 
    $("#config").click(function(){$("#options").fadeTo("fast",0).slideDown("slow").fadeTo("slow",1);});
	
	$("#search").keypress(function(e){if(e.keyCode==13||e.keyCode==10){ 
	
	getPage('all',0);
	//alert('san') 
	
	}});
	
	
	$("#all").click(function(e){ getPage('all',0); });
	$("#red").click(function(e){ getPage('red',0); });
	$("#orange").click(function(e){ getPage('orange',0); });
	$("#yellow").click(function(e){ getPage('yellow',0); });
	$("#green").click(function(e){ getPage('green',0); });
	$("#teal").click(function(e){ getPage('teal',0); });
	$("#blue").click(function(e){ getPage('blue',0); });
	$("#purple").click(function(e){ getPage('purple',0); });
	$("#pink").click(function(e){ getPage('pink',0); });
	$("#white").click(function(e){ getPage('white',0); });
	$("#gray").click(function(e){ getPage('gray',0); });
	$("#black").click(function(e){ getPage('black',0); });
	$("#brown").click(function(e){ getPage('brown',0); });
	
});

