flashExpressInstaller = '/assets/swf/expressInstall';

homeBanner = $.flash({
	swf: '/assets/swf/homeBanner.swf',
	width: 955,
	height: 352,
	params: {
		scale: 'noscale',
		menu: 'false'
	}
})

flashGallery = $.flash({
	swf: '/assets/swf/gallery.swf',
	width: 724,
	height: 561,
	bgcolor: '#ffffff',
	params: {
		scale: 'noscale',
		menu: 'false'
	},
	flashvars:
	{
		debug:'true',
		xmlPath: "/assets/xml/photo_gallery.xml",
		imageWidth: "500",
		imageHeight: "500",
		oversizeImages: "scaleDown",
		thumbDirection: 'horizontal',
		thumbWidth: "110",
		thumbHeight: "110",
		thumbSpacingX: "28",
		thumbSpacingY: "28",
		borderWidth: "2",
		borderColor: "0x072058",
		controlPanelHeight: "32",
		controlColor: "0xFFFFFF",
		controlOverColor: "0x999999",
		controlDisabledColor: "0xCCCCCC",
		titleFontSize: "12",
		controlPanelPadding: "12",
		loadingWheelColor: "0x444444",
		selectorColor: "0x861616",
		selectorThickness: "2",
		selectorMargin: "7",
		shadowAmount: "0.3"
	}
});

$(document).ready(function(){
	
	$('#homeFlash').html(homeBanner);
	$('#photoWrap').html(flashGallery);
	
    // hover function for inputs and images
        $('.hover').hover(function(){
    		$(this).attr('src', $(this).attr('src').replace(/\.(\w{3})/g, "Hover.$1"));
    	},function() {
    		$(this).attr('src', $(this).attr('src').replace(/Hover\.(\w{3})/g, ".$1"));
    	});
 /*   goneForGood = true;
    function hoverOff(el) {	    
        $(el).mouseout(function(){
            goneForGood = true;
            setTimeout(function(){  
                if(goneForGood) {
                    $(el).children('ul').removeClass('on');
                }
     		}, 500);
 
        });
    }
    
	$('#navWrap ul li').hover(function() {
	  //  alert('sdfsd');
	  el = $(this)
	    $(el).children('ul').addClass('on');
	    goneForGood = false;
	}, function () {
        hoverOff(el)
	}); */
	
// homepage
    $('#cTwoRight .homeBlock').css({cursor: "pointer"}).hover(function() {
        $(this).addClass('bHover');
    }, function() {
        $(this).removeClass('bHover');
    }).click(function(){
        window.location = $(this).children().children().children('a').attr('href');
    });

//ie rollovers

    $('#navWrap ul').children('li').hover(function() {
        if(first == 1) {
            $('#navWrap ul').children('li').children('ul').removeClass('ieHover');
            first = 0;
        }
        $(this).children('ul').addClass('ieHover');
    }, function () {
        $(this).children('ul').removeClass('ieHover');
    
    });
    
/*    $('#navWrap ul li ul').hover(function() {
     alert('woo');
    }, function() { 
        
    });*/
    
    // this makes the subnav of the on
    if($('.inner').length > 0) {
        first = 1;
        $('#navWrap').children('ul').children('li').each(function() {
           if($(this).hasClass('on') || $(this).hasClass('trail')) {
               $(this).children('ul').addClass('ieHover').addClass('starter');
           } 
        });
    }
    
    $('#navWrap').mouseleave(function(){
        $('#navWrap .starter').addClass('ieHover');
        first = 1
    });
    
});

