//fancybox MAPS Home Page
$(function() {
    $(".MAPS").fancybox({
	'zoomSpeedIn': 300, 
	'zoomSpeedOut': 300, 
	'overlayShow': true,
	'imageScale': true,
	'enableEscapeButton': true
    });
    
    $('div.imagelist dl').css('margin-left','185px');
    $('.virtualpage2').css('height','110px');
    
    
    var safari = $.browser.safari;
    if(!safari) {
        $(".MAPS").hover(function() {
            $(this).stop().fadeTo("fast", 0.3)
        }, function() {
            $(this).stop().fadeTo("fast", 1)
        });
        
        $('div.imageGallery > div > a').hover(function() {
            $(this).stop().fadeTo("fast", 0.3)
            }, function() {
                $(this).stop().fadeTo("fast", 1)
        });
    } 


//fancybox MAPS2 Fire Page	 
	 
	$(".MAPS2").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'autoScale'     	: false,
		'type'				: 'iframe',
		'width'				: 695,
		'height'			: 510,
		'titlePosition' 	: 'inside',
		'scrolling'   		: 'no'
	});
	
	var safari = $.browser.safari;
    if(!safari) {
        $(".MAPS2").hover(function() {
            $(this).stop().fadeTo("fast", 0.3)
        }, function() {
            $(this).stop().fadeTo("fast", 1)
        });
        
        $('div.imageGallery > div > a').hover(function() {
            $(this).stop().fadeTo("fast", 0.3)
            }, function() {
                $(this).stop().fadeTo("fast", 1)
        });
    }    
	  
//fancybox FIRE_MAPS Fire Page	 
	 
	$(".FIRE_MAPS").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'autoScale'     	: false,
		'type'				: 'iframe',
		'width'				: 750,
		'height'			: 700,
		'titlePosition' 	: 'over',
		'scrolling'   		: 'no'
	});
	
	function formatTitle(title, currentArray, currentIndex, currentOpts) {
	    return '<div id="tip7-title"><span><a href="javascript:;" onclick="$.fancybox.close();"><img src="/data/closelabel.gif" /></a></span>' + (title && title.length ? '<b>' + title + '</b>' : '' ) + 'Image ' + (currentIndex + 1) + ' of ' + currentArray.length + '</div>';
	}
	
	var safari = $.browser.safari;
    if(!safari) {
        $(".FIRE_MAPS").hover(function() {
            $(this).stop().fadeTo("fast", 0.3)
        }, function() {
            $(this).stop().fadeTo("fast", 1)
        });
        
        $('div.imageGallery > div > a').hover(function() {
            $(this).stop().fadeTo("fast", 0.3)
            }, function() {
                $(this).stop().fadeTo("fast", 1)
        });
    }     
	 
//fancybox NCA_FIRE_MAPS Fire Page	 
	 
	$(".NCA_FIRE_MAPS").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'autoScale'     	: false,
		'type'				: 'iframe',
		'width'				: 650,
		'height'			: 540,
		'titlePosition' 	: 'over',
		'scrolling'   		: 'no'
	});
	
	function formatTitle(title, currentArray, currentIndex, currentOpts) {
	    return '<div id="tip7-title"><span><a href="javascript:;" onclick="$.fancybox.close();"><img src="/data/closelabel.gif" /></a></span>' + (title && title.length ? '<b>' + title + '</b>' : '' ) + 'Image ' + (currentIndex + 1) + ' of ' + currentArray.length + '</div>';
	}
	
	var safari = $.browser.safari;
    if(!safari) {
        $(".NCA_FIRE_MAPS").hover(function() {
            $(this).stop().fadeTo("fast", 0.3)
        }, function() {
            $(this).stop().fadeTo("fast", 1)
        });
        
        $('div.imageGallery > div > a').hover(function() {
            $(this).stop().fadeTo("fast", 0.3)
            }, function() {
                $(this).stop().fadeTo("fast", 1)
        });
    }     
	 
  
//fancybox CA_FIRE_MAPS Fire Page	 
	 
	$(".CA_FIRE_MAPS").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'autoScale'     	: false,
		'type'				: 'iframe',
		'width'				: 650,
		'height'			: 640,
		'titlePosition' 	: 'over',
		'scrolling'   		: 'no'
	});
	
	function formatTitle(title, currentArray, currentIndex, currentOpts) {
	    return '<div id="tip7-title"><span><a href="javascript:;" onclick="$.fancybox.close();"><img src="/data/closelabel.gif" /></a></span>' + (title && title.length ? '<b>' + title + '</b>' : '' ) + 'Image ' + (currentIndex + 1) + ' of ' + currentArray.length + '</div>';
	}
	
	var safari = $.browser.safari;
    if(!safari) {
        $(".CA_FIRE_MAPS").hover(function() {
            $(this).stop().fadeTo("fast", 0.3)
        }, function() {
            $(this).stop().fadeTo("fast", 1)
        });
        
        $('div.imageGallery > div > a').hover(function() {
            $(this).stop().fadeTo("fast", 0.3)
            }, function() {
                $(this).stop().fadeTo("fast", 1)
        });
    }     
	 
//fancybox US_FIRE_MAPS Fire Page	 
	 
	$(".US_FIRE_MAPS").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'autoScale'     	: false,
		'type'				: 'iframe',
		'width'				: 800,
		'height'			: 700,
		'titlePosition' 	: 'over',
		'scrolling'   		: 'no'
	});
	
	function formatTitle(title, currentArray, currentIndex, currentOpts) {
	    return '<div id="tip7-title"><span><a href="javascript:;" onclick="$.fancybox.close();"><img src="/data/closelabel.gif" /></a></span>' + (title && title.length ? '<b>' + title + '</b>' : '' ) + 'Image ' + (currentIndex + 1) + ' of ' + currentArray.length + '</div>';
	}
	
	var safari = $.browser.safari;
    if(!safari) {
        $(".US_FIRE_MAPS").hover(function() {
            $(this).stop().fadeTo("fast", 0.3)
        }, function() {
            $(this).stop().fadeTo("fast", 1)
        });
        
        $('div.imageGallery > div > a').hover(function() {
            $(this).stop().fadeTo("fast", 0.3)
            }, function() {
                $(this).stop().fadeTo("fast", 1)
        });
    } 
		
//fancybox SSCon (Sunrise / Sunset / Solar Position Calculator) Page	 
	 
	$(".SSCon").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'autoScale'     	: false,
		'type'				: 'iframe',
		'width'				: 800,
		'height'			: 700,
		'titlePosition' 	: 'over',
		'scrolling'   		: 'yes'
	});
	
	function formatTitle(title, currentArray, currentIndex, currentOpts) {
	    return '<div id="tip7-title"><span><a href="javascript:;" onclick="$.fancybox.close();"><img src="/data/closelabel.gif" /></a></span>' + (title && title.length ? '<b>' + title + '</b>' : '' ) + 'Image ' + (currentIndex + 1) + ' of ' + currentArray.length + '</div>';
	}
	
	var safari = $.browser.safari;
    if(!safari) {
        $(".SSCon").hover(function() {
            $(this).stop().fadeTo("fast", 0.3)
        }, function() {
            $(this).stop().fadeTo("fast", 1)
        });
        
        $('div.imageGallery > div > a').hover(function() {
            $(this).stop().fadeTo("fast", 0.3)
            }, function() {
                $(this).stop().fadeTo("fast", 1)
        });
    } 		

//fancybox Lightning Probability Forecast Maps - Fire Page	 
	 
	$(".LPF_MAPS").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'autoScale'     	: false,
		'type'				: 'iframe',
		'width'				: 700,
		'height'			: 570,
		'titlePosition' 	: 'over',
		'scrolling'   		: 'no'
	});
	
	function formatTitle(title, currentArray, currentIndex, currentOpts) {
	    return '<div id="tip7-title"><span><a href="javascript:;" onclick="$.fancybox.close();"><img src="/data/closelabel.gif" /></a></span>' + (title && title.length ? '<b>' + title + '</b>' : '' ) + 'Image ' + (currentIndex + 1) + ' of ' + currentArray.length + '</div>';
	}
	
	var safari = $.browser.safari;
    if(!safari) {
        $(".LPF_MAPS").hover(function() {
            $(this).stop().fadeTo("fast", 0.3)
        }, function() {
            $(this).stop().fadeTo("fast", 1)
        });
        
        $('div.imageGallery > div > a').hover(function() {
            $(this).stop().fadeTo("fast", 0.3)
            }, function() {
                $(this).stop().fadeTo("fast", 1)
        });
    }
  
 //fancybox HEAT_INDEX_MAP Home Page	 
	 
	$(".HEAT_INDEX_MAP").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'autoScale'     	: false,
		'type'				: 'iframe',
		'width'				: 950,
		'height'			: 790,
		'titlePosition' 	: 'over',
		'scrolling'   		: 'no'
	});
	
	function formatTitle(title, currentArray, currentIndex, currentOpts) {
	    return '<div id="tip7-title"><span><a href="javascript:;" onclick="$.fancybox.close();"><img src="/data/closelabel.gif" /></a></span>' + (title && title.length ? '<b>' + title + '</b>' : '' ) + 'Image ' + (currentIndex + 1) + ' of ' + currentArray.length + '</div>';
	}
	
	var safari = $.browser.safari;
    if(!safari) {
        $(".HEAT_INDEX_MAP").hover(function() {
            $(this).stop().fadeTo("fast", 0.3)
        }, function() {
            $(this).stop().fadeTo("fast", 1)
        });
        
        $('div.imageGallery > div > a').hover(function() {
            $(this).stop().fadeTo("fast", 0.3)
            }, function() {
                $(this).stop().fadeTo("fast", 1)
        });
    }
	
	//fancybox Caltrans Live Traffic Cameras Home Page	 
	 
	$(".Caltrans").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'autoScale'     	: false,
		'type'				: 'iframe',
		'width'				: 660,
		'height'			: 523,
		'titlePosition' 	: 'over',
		'scrolling'   		: 'no'
	});
	
	function formatTitle(title, currentArray, currentIndex, currentOpts) {
	    return '<div id="tip7-title"><span><a href="javascript:;" onclick="$.fancybox.close();"><img src="/data/closelabel.gif" /></a></span>' + (title && title.length ? '<b>' + title + '</b>' : '' ) + 'Image ' + (currentIndex + 1) + ' of ' + currentArray.length + '</div>';
	}
	
	var safari = $.browser.safari;
    if(!safari) {
        $(".Caltrans").hover(function() {
            $(this).stop().fadeTo("fast", 0.3)
        }, function() {
            $(this).stop().fadeTo("fast", 1)
        });
        
        $('div.imageGallery > div > a').hover(function() {
            $(this).stop().fadeTo("fast", 0.3)
            }, function() {
                $(this).stop().fadeTo("fast", 1)
        });
    }      
 	 

 	 
});
