﻿jQuery(document).ready(function() {


	jQuery(".input_findAStoreTxtbox").click(function() {
		this.value = "";

		jQuery(this).removeClass("input_findAStoreTxtbox");
	});

	//Professionals menu
	var src = "/portals/1/skins/main/images/btnProfessionals_on.png";
	var src2 = "/portals/1/skins/main/images/btnProfessionals_off.png";
	try {
		jQuery("#" + imgProfessional).attr("src", src2)

		jQuery("#professionalWrapper").mouseover(function() {
			jQuery("#" + imgProfessional).attr("src", src)
			//jQuery("#professionalDivWrapper").css("height", "115px");
			jQuery("#professionalDivWrapper").css("width", "250px");
			jQuery("#professionalDivWrapper").stop().animate(
                { height: '175px' }, // animation
                200, // duration
                function() { jQuery("#professionalDivWrapper").css({ "display": "block" }) } // do after animation
            );

		});

		jQuery("#professionalWrapper").mouseout(function() {
			jQuery("#professionalDivWrapper").stop().animate(
                { height: '0px' }, // animation 
                200, // duration
                function() { // do after animation
                	jQuery("#" + imgProfessional).attr("src", src2);
                	jQuery("#professionalDivWrapper").css({ "display": "none" });
                }
            );
		});

		//Homeowners menu
		var srcHomeownerOn = "/portals/1/skins/main/images/btnHomeowners_on.png";
		var srcHomeownerOff = "/portals/1/skins/main/images/btnHomeowners_off.png";

		jQuery("#" + imgHomeowners).mouseover(function() {
			jQuery("#" + imgHomeowners).attr("src", srcHomeownerOn);
		});

		jQuery("#" + imgHomeowners).mouseout(function() {
			jQuery("#" + imgHomeowners).attr("src", srcHomeownerOff);
		});

	} catch (err) { }
});

function findModalWidth()
{
	if(jQuery('#contentWrapper').is(':visible'))
	{
	    var modalWidth = jQuery('#contentWrapper').children("#modalContent").children("div:first").width();
	    jQuery("#modalCancelWrapper").css("width", modalWidth + 55);
	}
}

function pageLoad() {
    jQuery(".colorboxPhoto").each(function() {
        myRef = jQuery(this).parent().attr("href");
        jQuery(this).colorbox({ href: myRef, photo: true, close: "Close" });
    });

    jQuery(".colorboxInline").each(function() {
        myRef = jQuery(this).parent().attr("href");
        jQuery(this).colorbox({ href: myRef, inline: true, width: "558px", close: "Close" });
    });
}
