// JavaScript Document
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


$(document).ready(function(){
	Macs.rollover.init();
	//MM_preloadImages();
});

Macs = {};
Macs.rollover = {
   init: function()
   {
      this.preload();
      $(".navRO").hover(
         function () { $(this).css( 'background-image', Macs.rollover.newimage($(this).css('background-image')) ); },
         function () { $(this).css( 'background-image', Macs.rollover.oldimage($(this).css('background-image')) ); }
      );
   },
   preload: function()
   {
      $(window).bind('load', function() {
         $('navRO').each( function( key, elm ) { $('<img>').css( 'background-image', Macs.rollover.newimage( $(this).css('background-image') ) ); });
      });
   },
   newimage: function( src )
   {
	  var a = src.search(/(\.[a-z\"\)]+)$/);
	  var b = src.match(/(\.[a-z\"\)]+)$/)[0];
	  var x = src.substring(0,  a) + '_Hover' + b;
	  return x;
   },
   oldimage: function( src )
   {	
	  var x =src.replace(/_Hover\./, '.');
	  return x;
   }
};



function testSlide()
{
$("#SliderContent").animate({ left: "-800"}, 1500 );
return false;
}



function showCorpFSG() { $('#CorpStageDefault').css('display', 'none');$('#CorpStageFSG').css('display', 'block');return false;}
function showCorpMgmt() { $('#CorpStageDefault').css('display', 'none');$('#CorpStageMgmt').css('display', 'block');return false;}
function showCorpPeople() { $('#CorpStageDefault').css('display', 'none');$('#CorpStagePeople').css('display', 'block');return false;}
function showCorpLiasion() { $('#CorpStageDefault').css('display', 'none');$('#CorpStageLiasion').css('display', 'block');return false;}
function showCorpOffice() { $('#CorpStageDefault').css('display', 'none');$('#CorpStageOffice').css('display', 'block');return false;}
function showCorpSpirit() { $('#CorpStageDefault').css('display', 'none');$('#CorpStageSpirit').css('display', 'block');return false;}


function hideCorpFSG() { $('#CorpStageFSG').css('display', 'none');$('#CorpStageDefault').css('display', 'block');return false;}
function hideCorpMgmt() { $('#CorpStageMgmt').css('display', 'none');$('#CorpStageDefault').css('display', 'block');return false;}
function hideCorpPeople() { $('#CorpStagePeople').css('display', 'none');$('#CorpStageDefault').css('display', 'block');return false;}
function hideCorpLiasion() { $('#CorpStageLiasion').css('display', 'none');$('#CorpStageDefault').css('display', 'block');return false;}
function hideCorpOffice() { $('#CorpStageOffice').css('display', 'none');$('#CorpStageDefault').css('display', 'block');return false;}
function hideCorpSpirit() { $('#CorpStageSpirit').css('display', 'none');$('#CorpStageDefault').css('display', 'block');return false;}




function displayStep(WhichStep)
{
	var	Identifier  = '';
	Identifier = '#StepsLine'+WhichStep+' .StepsDetails';
	if ($(Identifier).css('display') != 'none') {
		$(Identifier).slideUp('slow');
		Identifier = '#StepsLine'+WhichStep+' .StepsTitle a';
		$(Identifier).attr('title','Learn more...');
		$(Identifier).html('Learn more...');	
	} else {
		for(var x=0;x<7;x++)
		{
			Identifier = '#StepsLine'+x+' .StepsDetails';
			if (($(Identifier).css('display') != 'none') && (WhichStep != x))
			{
				$(Identifier).slideUp('slow');
				Identifier = '#StepsLine'+x+' .StepsTitle a';
				$(Identifier).attr('title','Learn more...');
				$(Identifier).html('Learn more...');
			}
		}
		Identifier = '#StepsLine'+WhichStep+' .StepsDetails';
		$(Identifier).slideDown('slow');
		Identifier = '#StepsLine'+WhichStep+' .StepsTitle a';
		$(Identifier).attr('title','Less...');
		$(Identifier).html('Less...');
	}
	return false;
}


function displayFAQ(WhichStep)
{
	var	Identifier  = '';
	Identifier = '#FaqLine'+WhichStep+' .FaqDetails';
	if ($(Identifier).css('display') != 'none') {
		$(Identifier).slideUp('slow');
		Identifier = '#FaqLine'+WhichStep+' .FaqStepTitle a';
		$(Identifier).attr('title','Answer...');
		$(Identifier).html('Answer...');	
	} else {
		for(var x=0;x<11;x++)
		{
			Identifier = '#FaqLine'+x+' .FaqDetails';
			if (($(Identifier).css('display') != 'none') && (WhichStep != x))
			{
				$(Identifier).slideUp('slow');
				Identifier = '#FaqLine'+x+' .FaqStepTitle a';
				$(Identifier).attr('title','Answer...');
				$(Identifier).html('Answer...');
			}
		}
		Identifier = '#FaqLine'+WhichStep+' .FaqDetails';
		$(Identifier).slideDown('slow');
		Identifier = '#FaqLine'+WhichStep+' .FaqStepTitle a';
		$(Identifier).attr('title','Close...');
		$(Identifier).html('Close...');
	}
	return false;
}
