

$(document).ready(function(){

var image1=new Image(88,31);
var image2=new Image(88,31);
image1.src="images/html_blue.png";
image2.src="images/css_blue.png";

$("div.top_section img").click(function(){
window.location = "http://theorniphile.info/index.html";
});

$("p.call_out_box").css({"borderRadius":"3px", "boxShadow":"3px 3px 2px #a1a1a1"});

$(".container").css({"borderBottomRightRadius":"5px", "borderBottomLeftRadius":"5px", "borderTopRightRadius":"3px", "borderTopLeftRadius":"3px"});

$(".bird_group a img, .bird_group_alt a img").hover(function(){
$(this).css("opacity", 0.8);
}, function(){
$(this).css("opacity", 1.0);
});

$("div.top_section img").hover(function(){
$(this).css("opacity", 0.8);
$(this).attr("title", "Home");
}, function(){
$(this).css("opacity", 1.0);
});

var d = new Date()
var y = d.getFullYear();
$("#copyright").html("&#169; " +  y + " The Orniphile");

$("div.what_to_see ul li:eq(0) a").hover(function(){
$("span#waterfowl").css("fontWeight", "bold");
}, function(){
$("span#waterfowl").css("fontWeight", "normal");
});

$("div.what_to_see ul li:eq(1) a").hover(function(){
$("span#shorebirds").css("fontWeight", "bold");
}, function(){
$("span#shorebirds").css("fontWeight", "normal");
});

$("div.what_to_see ul li:eq(2) a").hover(function(){
$("span#otherwaterbirds").css("fontWeight", "bold");
}, function(){
$("span#otherwaterbirds").css("fontWeight", "normal");
});

$("div.what_to_see ul li:eq(3) a").hover(function(){
$("span#raptors").css("fontWeight", "bold");
}, function(){
$("span#raptors").css("fontWeight", "normal");
});

$("div.what_to_see ul li:eq(4) a").hover(function(){
$("span#passerines").css("fontWeight", "bold");
}, function(){
$("span#passerines").css("fontWeight", "normal");
});

$("div.what_to_see ul li:eq(5) a").hover(function(){
$("span#other_critters").css("fontWeight", "bold");
}, function(){
$("span#other_critters").css("fontWeight", "normal");
});

$("p#bookmark").html("<a href='' title='Add this site to your favorites'>Bookmark this Web site<img src='images/plus.gif' alt='Plus'></a>");

$("p#bookmark a").click(function(){

var bookmark_url="http://theorniphile.info/";
var text_description="The Orniphile";
if (navigator.appName=="Microsoft Internet Explorer" && parseInt(navigator.appVersion) >=4 && navigator.platform.indexOf("Win") > -1 && navigator.appVersion.indexOf("SlimBrowser") < 0)
{
window.external.AddFavorite(bookmark_url,text_description);
}

else
{
alert("For PC users, press the Control (Ctrl) and \"D\" keys on your keyboard to bookmark this site. For Mac users, press the Command (Apple) and \"D\" keys on your keyboard.");
return false;
}
});

$("div.menu1 ul li a, div.menu2 ul li a").hover(function(){
$("p#menu_display_area").fadeTo(200, 1.00);
}, function(){
$("p#menu_display_area").fadeTo(100, 0.00);
});

$("div.menu1 ul li:eq(0) a").hover(function(){
$("p#menu_display_area").html("- A selection of my bird and insect photographs -");
}, function(){
$("p#menu_display_area").html("- A selection of my bird and insect photographs -");
});

$("div.menu1 ul li:eq(1) a").hover(function(){
$("p#menu_display_area").html("- Account of Illinois' first Whooping Crane since 1958 -");
}, function(){
$("p#menu_display_area").html("- Account of Illinois' first Whooping Crane since 1958 -");
});

$("div.menu1 ul li:eq(2) a").hover(function(){
$("p#menu_display_area").html("- The photo quiz I wrote for the January/February 2006 issue of Birding magazine - ");
}, function(){
$("p#menu_display_area").html("- The photo quiz I wrote for the January/February 2006 issue of Birding magazine - ");
});

$("div.menu1 ul li:eq(3) a").hover(function(){
$("p#menu_display_area").html("- The nightjar identification article I wrote for Meadowlark magazine -");
}, function(){
$("p#menu_display_area").html("- The nightjar identification article I wrote for Meadowlark magazine -");
});

$("div.menu2 ul li:eq(0) a").hover(function(){
$("p#menu_display_area").html("- A guide to birding the Montrose Point Area in Chicago -");
}, function(){
$("p#menu_display_area").html("- A guide to birding the Montrose Point Area in Chicago -");
});

$("div.menu2 ul li:eq(1) a").hover(function(){
$("p#menu_display_area").html("- A selection of interesting and informative birding Web sites -");
}, function(){
$("p#menu_display_area").html("- A selection of interesting and informative birding Web sites -");
});

$("div.menu2 ul li:eq(2) a").hover(function(){
$("p#menu_display_area").html("- Photos of Thayer's and Iceland Gulls -");
}, function(){
$("p#menu_display_area").html("- Photos of Thayer's and Iceland Gulls -");
});

$("div.menu2 ul li:eq(3) a").hover(function(){
$("p#menu_display_area").html("- Account of the second inland North American record of this species -");
}, function(){
$("p#menu_display_area").html("- Account of the second inland North American record of this species -");
});

$("div.menu2 ul li:eq(4) a").hover(function(){
$("p#menu_display_area").html("- Using a digital camera with a Questar telescope for photography -");
}, function(){
$("p#menu_display_area").html("- Using a digital camera with a Questar telescope for photography -");
});

$("img#libh").click(function(){
$("span#quiz1").html("Answer: Little Blue Heron");
$("img#libh").attr({"title":"Little Blue Heron", "alt":"Little Blue Heron"});
});

$("img#sewr").click(function(){
$("span#quiz2").html("Answer: Sedge Wren");
$("img#sewr").attr({"title":"Sedge Wren", "alt":"Sedge Wren"});
});

$("img#bbsa").click(function(){
$("span#quiz3").html("Answer: Buff-breasted Sandpiper");
$("img#bbsa").attr({"title":"Buff-breasted Sandpiper", "alt":"Buff-breasted Sandpiper"});
});

$("p#digiscoping a").click(function(){
var first_part = "http://www.google.com/search?btnG=Google+Search&q=";
var second_part = "digiscoping";
window.location.href= first_part + second_part;
return false;
});

$(".digiscoping_image img, img#montrose_image, .gallery_species img, img.gull_image_large, img.crane_image_large, img.montrose_close_up, .pic1 img, .pic2 img, .pic3 img, .pic3_alt img").bind("contextmenu", function(e){
return false;
});

$(".digiscoping_image img, img#montrose_image, .gallery_species img, img.gull_image_large, img.crane_image_large, img.montrose_close_up, .pic1 img, .pic2 img, .pic3 img, .pic3_alt img").mousedown(function(e){
return false;
});

$("a.to_top").click(function(){
$(document).scroll(0, 0);
});

$(".montrose_images img").hover(function(){
$(this).css("border","1px solid #616161");
}, function(){
$(this).css("border","1px solid white");
});

$(".montrose_images img#montrose_beach").click(function(){
$("img#montrose_image").attr({"title":"Montrose Beach","alt":"Montrose Beach", "src":"images/montrose_beach.jpg"});
$("p#description").html("View of Montrose Beach looking west. Note the green gunk in the foreground. Shorebirds love to feed in this stuff.");
});


$(".montrose_images img#montrose_dunes").click(function(){
$("img#montrose_image").attr({"title":"Montrose Dunes","alt":"Montrose Dunes", "src":"images/montrose_dunes.jpg"});
$("p#description").html("Montrose Dunes. The dunes vegetation can be very good for sparrows, especially Nelson's Sharp-taileds.");
});

$(".montrose_images img#montrose_magic_hedge").click(function(){
$("img#montrose_image").attr({"title":"The Magic Hedge","alt":"The Magic Hedge", "src":"images/montrose_magic_hedge.jpg"});
$("p#description").html("View of The Magic Hedge looking west.");
});

$(".montrose_images img#montrose_meadow").click(function(){
$("img#montrose_image").attr({"title":"The Meadow","alt":"The Meadow", "src":"images/montrose_meadow.jpg"});
$("p#description").html("The Meadow. The grass can be good for American Bitterns, Short-eared Owls, and LeConte's Sparrows.");
});

$("img#valid_html").hover(function(){
$("#display_area").html("This graphic indicates that the HTML used for this Web site has been validated and is free of syntax errors.");
}, function(){
$("#display_area").html("");
});

$("img#valid_css").hover(function(){
$("#display_area").html("This graphic indicates that the CSS used for this Web site has been validated and is free of syntax errors.");
}, function(){
$("#display_area").html("");
});

$("img#valid_css").hover(function(){
$(this).attr("src", "images/css_blue.png");
}, function(){
$(this).attr("src", "images/css_gold.png");
});

$("img#valid_html").hover(function(){
$(this).attr("src", "images/html_blue.png");
}, function(){
$(this).attr("src", "images/html_gold.png");
});

if(navigator.platform.indexOf("Win") > -1 && navigator.appName == "Microsoft Internet Explorer")
{
$("#targ").html("Save Target As");
}

if(navigator.platform.indexOf("Win") > -1 && navigator.appName == "Netscape")
{
$("#targ").html("Save Link As");
}

if(navigator.platform.indexOf("Win") > -1 && navigator.appName == "Opera")
{
$("#targ").html("Save Linked Content As");
}

if(navigator.appVersion.indexOf("Mac") > -1 && navigator.appName == "Netscape")
{
$("#targ").html("Download Linked File");
$("#where").css("display", "none");
}

$("area#harbor").hover(function(){
$("#montroseHarbor").css("background", "yellow");
}, function(){
$("#montroseHarbor").css("background", "white");
});

$("area#pond").hover(function(){
$("#golfCoursePond").css("background", "yellow");
}, function(){
$("#golfCoursePond").css("background", "white");
});

$("area#hill").hover(function(){
$("#cricketHill").css("background", "yellow");
}, function(){
$("#cricketHill").css("background", "white");
});

$("area#launch").hover(function(){
$("#wilsonBoatLaunch").css("background", "yellow");
}, function(){
$("#wilsonBoatLaunch").css("background", "white");
});

$("area#hedge").hover(function(){
$("#theMagicHedge").css("background", "yellow");
}, function(){
$("#theMagicHedge").css("background", "white");
});

$("area#beach").hover(function(){
$("#montroseBeach").css("background", "yellow");
}, function(){
$("#montroseBeach").css("background", "white");
});

$("area#meadow").hover(function(){
$("#montroseMeadow").css("background", "yellow");
}, function(){
$("#montroseMeadow").css("background", "white");
});

$("area#dunes").hover(function(){
$("#montroseDunes").css("background", "yellow");
}, function(){
$("#montroseDunes").css("background", "white");
});


$("area#pier").hover(function(){
$("#fishhookPier").css("background", "yellow");
}, function(){
$("#fishhookPier").css("background", "white");
});

$("div.bird_group h3").css({"borderTopLeftRadius":"2px", "borderBottomLeftRadius":"2px"});

$(".gull_image img").click(function(){
var newWin = window.open('larus_crassirostris.html', 'gull_win', 'width=600,height=550,title=yes,resizeable=yes,status=no,toolbar=no,scrollbars=yes,left=50,top=10');
newWin.focus();
});

$(".crane_image img").click(function(){
var newWin = window.open('grus_americana.html', 'crane_win', 'width=600,height=550,title=yes,resizeable=yes,status=no,toolbar=no,scrollbars=yes,left=50,top=10');
newWin.focus();
});

$(".montrose_aerial_photo img").click(function(){
var newWin = window.open('montrose/montrose_closeup.html','closeup_win','height=440, width=450,location=no,srollbars=yes,status=no,top=50,left=500');
newWin.focus();
});

$("body.pop_up button").click(function(){
window.close(this);
});

$(".gallery_species p:contains(Photo Gallery)").prepend("Return to the");

$(".gallery_species p:contains(Iceland Gull Photos)").prepend("Return to");

$("p:contains(The Montrose Primer)").prepend("Return to ");

$("span#crane_meta_info").hover(function(e){
$("span#park_info").css({"display":"block", "top":e.pageY - 60, "left":e.pageX - 200});
}, function(){
$("span#park_info").css("display", "none");
});


});
