// DEFINE SIFR FONTS
var gotham_bold = {
  src: template_url+'/gothambold2.swf'
};
sIFR.useStyleCheck = true;
sIFR.activate(gotham_bold);

var gotham_medium = {
  src: template_url+'/gothammed.swf'
};
sIFR.useStyleCheck = true;
sIFR.activate(gotham_medium);

// IMAGE ROTATIONS
var current_image = 0;
var num_images = 0;

$(function(){
	
	// ACTIVATE SIFR FONTS
	
	sIFR.replace(gotham_bold, {
      selector: 'h1,h2'
      ,css: {
        '.sIFR-root': { 'color': '#000000' },
        '.green':{'color':'#00621C'}
      },
      wmode:'transparent',
      ratios:[9, 1.16, 17, 1.09, 18, 1.08, 24, 1.05, 25, 1.06, 30, 1.04, 32, 1.05, 37, 1.03, 39, 1.04, 40, 1.02, 41, 1.04, 58, 1.03, 97, 1.02, 1.01],
      offsetTop:0,
      tuneHeight:-7
    });
	sIFR.replace(gotham_bold, {
      selector: '#submenu li.parent'
      ,css: {
        '.sIFR-root': { 'color': '#FFFFFF'},
        '.selected':{'color':'#000000','cursor':'default'},
        'a':{'color':'#FFFFFF','text-decoration':'none','text-align':'right'},
        'a:hover':{'color':'#000000'}
      },
      wmode:'transparent',
      tuneHeight:-4,
      thickness:-150
    });
    sIFR.replace(gotham_medium, {
      selector: '#submenu li.child'
      ,css: {
        '.sIFR-root': { 'color': '#FFFFFF','font-size':'12px'},
        '.selected':{'color':'#000000','cursor':'default'},
        'a':{'color':'#FFFFFF','text-decoration':'none','text-align':'right'},
        'a:hover':{'color':'#000000'}
      },
      wmode:'transparent',
      tuneHeight:-4,
      thickness:-200,
      sharpness:-200
    });
    
    // LOAD ON-TIME DELIVERY FLASH
    
	var so = new SWFObject(template_url+'/ontime-delivery20.swf','ontimeswf','107','107','9');
    so.addParam('allowscriptaccess','always');
    so.write('ontimeswf');

    // IMAGE ROLLOVERS
    
	$(".rollover").mouseover(function(){
		var on = $(this).attr('on');
		var off = $(this).attr('off');
		
		if (on && off && on != '' && off != '' && on != off) {
			$(this).attr('src',on);
		}
	});
	$(".rollover").mouseout(function(){
		var on = $(this).attr('on');
		var off = $(this).attr('off');
		
		if (on && off && on != '' && off != '' && on != off) {
			$(this).attr('src',off);
		}
	});
	
	$(".rotate_image").each(function(){
		num_images += 1;
	});
	
	if (num_images > 0) {
		setInterval(function(){
			current_image += 1;
			if (current_image >= num_images) current_image = 0;
			
			$(".rotate_image").hide();
			$(".rotate_image[n='"+current_image+"']").fadeIn('medium');
			
		},5000);
	}
	
	
});
