/* for Internet Explorer - stops background flickering */
   /*@cc_on 
	@if (@_win32)
	try {
	  document.execCommand('BackgroundImageCache', false, true);
	} catch(e) {}
	@end
@*/
var jHover = {
	init : function(){
		$('.photo-collection').find('.zoomer').each(function(i){
			$(this).hover(
				function () {
					//$(this).addClass("zoom");
					$(this).css({ "position": "absolute", "width": "200px", "margin-top": "-75px", "margin-left": "-63px", "z-index": "100", "background-color": "#FFFFFF", "padding-top": "44px", "padding-right": "22px", "padding-bottom": "0", "padding-left": "22px", "border-width": "1px", "border-style": "solid", "border-color": "#CCCCCC" });
					$(this).children(".thumb").css({ "width": "200px" });
					$(this).children(".thumb").children('a').children('img').css({ "width": "200px", "height": "auto" });
					
					$(this).children(".copy").css({ "width": "200px" });
					$(this).children(".copy").children('.summary').css({ "position": "relative", "visibility": "visible", "background": "white", "left": "0px" });
					$(this).children(".copy").children('.facilities').css({ "position": "relative", "visibility": "visible", "background": "white", "top": "0px", "left": "0px" });
					$(this).children(".copy").children('.price').css({ "position": "absolute", "top": "18px", "left": "22px" });
					
				}
				,
				function () {
					//$(this).addClass("zoomer");
					$(this).css({ "position": "static", "width": "auto", "margin-top": "auto", "margin-left": "auto", "background-color": "#FFFFFF", "padding-top": "0px", "padding-right": "0px", "padding-bottom": "0", "padding-left": "0px", "border-width": "0px" });
					$(this).children(".thumb").css({ "width": "auto" });
					$(this).children(".thumb").children('a').children('img').css({ "width": "auto", "height": "90px" });
					
					$(this).children(".copy").css({ "width": "auto" });
					$(this).children(".copy").children('.summary').css({ "position": "absolute", "background": "black", "left": "-50000px" });
					$(this).children(".copy").children('.facilities').css({ "position": "absolute", "background": "black", "left": "-50000px" });
					$(this).children(".copy").children('.price').css({ "position": "relative", "top": "0px", "left": "0px" });
		
			});
			
		});
	}
};



var jAccordian = {
	init : function(){
		$('div.faq-module').find('div.faq-content').hide().end().find('h4').addClass("activated").hover(
			function(){
				$(this).bind("click", function(){
					var heading = $(this);
					var answers = $(this).next();
					if (answers.is(':visible')) {
						answers.slideUp("fast");
						heading.removeClass("dtactive");
					} else {
						answers.slideDown("fast")
						heading.addClass("dtactive");
					}
				});	 
			}
			,function(){
  			$(this).unbind( "click" );
		});
	}
};


$(document).ready(function(){
	jHover.init();
	jAccordian.init();
});
