/* ==================================================== *
 * TITLE   : Miracle League  | jqloads.js               *
 * AUTHOR  : Kevin Scholl    | kscholl@comcast.net      *
 * CREATED : 20 Nov 2006     | UPDATED: 08 Dec 2006     *
 * ==================================================== */

/* ==================================================== *
 * JQUERY PSEUDO-ONLOADS
 * ==================================================== */

$(document).ready(function(){
													 
  // hide the quicknav blocks
	$("#qnSearch, #qnLogin").hide();

  // quicknav links
	$("a.showSearch").click(function(){
    $(this).ctrlQuickNav("#qnSearch");
		return false;
		});
	$("a.showLogin").click(function(){
    $(this).ctrlQuickNav("#qnLogin");
		return false;
		});
													 
	// set input field actions
	$("#srchTerms, #loginUsername, #loginPassword")
	  .focus(function() {
			$(this).css("color","#333");
			if(this.value == this.defaultValue) {
				this.value = "";
				// if(this.id == "loginPassword") $(this).attr("type","password");
				}
			})
		.blur(function() {
			$(this).css("color","#999");
			if(this.value == "") {
				this.value = this.defaultValue;
				// if(this.id == "loginPassword") $(this).attr("type","text");
				}
			});

  // home blurb
	$("a#intro2Desc").click(function(){
    $("#homeBlurb01").fadeOut("normal",function(){
      $("#homeBlurb02").fadeIn("normal");
		  });
		return false;
		});
	$("a#desc2Intro").click(function(){
    $("#homeBlurb02").fadeOut("normal",function(){
      $("#homeBlurb01").fadeIn("normal");
		  });
		return false;
		});

	// open large photos in a popup window
//  $(".thumbStrip a").click(function(){
//		closePopWin(POPWIN); 	// closes an existing popup window if user opens
//	                        // new window before closing existing window	
//													
//		var myImg = new Image();
//		myImg.src = $(this).attr("href");
//		var w     = "";
//		var h     = "";
//		
//		if ($(this).attr("href").indexOf("?")) {
//			w = $(this).attr("href").slice(-7,-4);
//			h = $(this).attr("href").slice(-3);
//			viewPhoto(myImg.src,w,h);
//			}
//		else {
//			viewPhoto(myImg.src);
//			}
//		return false;
		
//		var msg   = "The enlarged image will open in a popup window. Select [OK] to continue, or [Cancel] to view the image in the main window (use the Back button in your browser to return to this page).";
//		if (confirm(msg)) {
//			viewPhoto(myImg.src,myImg.width,myImg.height);
//			return false;
//			}
//		});

// close any popup window when page unloads
  $(window).unload(function(){
		closePopWin(POPWIN);
		});

	});
