/**
* Account-related Javascript routines for 44I
*
* Copyright (c)2008 44 Interactive. All Rights Reserved.
*
* SVN File: $Id: account.js 217 2008-07-28 19:06:27Z Mike Neugebauer $
* @author $Author: Mike Neugebauer $
* @version $Revision: 217 $
* @lastrevision $Date: 2008-07-28 14:06:27 -0500 (Mon, 28 Jul 2008) $
* @modifiedby $LastChangedBy: Mike Neugebauer $
* @lastmodified $LastChangedDate: 2008-07-28 14:06:27 -0500 (Mon, 28 Jul 2008) $
* @filesource $URL: svn+ssh://miken@svnhost.44i-dev.com/svnhome/base/branches/motormarket/js/account.js $
*/

jQuery(document).ready(function() {
	
	setitup( "#kitch" );
	setitup( "#bath" );
	setitup( "#bar" );

});


function setitup( divid )
{
	
    $( divid + " .thumbnails a").mouseover(function()
        {
        $( divid + " .caption_text").html( '' );
        var imageSource = $(this).children("img").attr("src");
		var imageAlt = $(this).children("img").attr("alt");
        $( divid + " .loader").addClass("loading");
        $( divid + " .orig").remove();

          showImage(divid, imageSource,imageAlt);
          return false;
        });
}


function showImage(divid,src,alttxt)
{
	
	$( divid + " .loader img").fadeOut("normal")
	                .remove();
	
	var largeImage = new Image();
	
	$(largeImage).load(function()
	             	{
	                $(largeImage).hide();
	                $( divid + " .loader").removeClass("loading")
	                            .html(largeImage);
	                $(largeImage).fadeIn("fast");
	                });
	$(largeImage).attr( "src", src ).attr( "width", 360 ).attr( "height", 240 );
	$( divid + " .caption_text").html( alttxt );

}

