var menuId = 0;
var menuName = "PeanutButter.swf";

function FlashHandler() {

  if(location.href.indexOf('aboutus/about-our-product.aspx') > 0 )
    {
        menuId = 1;
    }  

    if(location.href.indexOf('aboutus/about-sanitarium.aspx') > 0 )
    {
        menuId = 2;
    }    
   


if(location.href.indexOf('nutritionalfacts/nutritional-facts.aspx') > 0 )
    {
        menuId = 5;
    }  

    if(location.href.indexOf('nutritionalfacts/trans-fats.aspx') > 0 )
    {
        menuId = 5;
    }    

    if(location.href.indexOf('nutritionalfacts/allergy-information.aspx') > 0 )
    {
        menuId = 6;        

    }  

    if(location.href.indexOf('recipes/quicksnacks') > 0 )
    {
        menuId = 8;
    }    

    if(location.href.indexOf('recipes/meals') > 0 )
    {
        menuId = 9;

    }  

    if(location.href.indexOf('recipes/desserts') > 0 )
    {
        menuId = 10;

    } 

    var server= "http://" + location.hostname + "/";
    var flashPath = "flash/";    
    var xmlFile = "xmlFile.xml";   
    var virDirPath = "/";

    if(location.href.indexOf('localhost') > 0 )
    {
        flashPath = "peanutbutter/flash/";
        virDirPath = "peanutbutter/";
    }


    if(location.href.indexOf('fsdev') > 0 )
    {
        flashPath = "fsdev/peanutbutter/flash/";
        virDirPath = "fsdev/peanutbutter/";
    }

    if(location.href.indexOf('fslive') > 0 )
    {
        flashPath = "fslive/peanutbutterlive/flash/";
    } 

    var completeFlashPath = "/" +flashPath+menuName+ "?MenuItem=" +menuId+ "&XMLFile=" +server+flashPath+xmlFile+ "&NoCache=true&absURL=" +server+virDirPath;

	//alert(completeFlashPath);


	// <![CDATA[	
							
		var fo = new FlashObject(completeFlashPath, "mainnav", "294", "585", "7", "#FFFFFF");
		fo.write("flashNav");
	// ]]>

}


function FlashBannerHandler() {

    /*

    var server= "http://" + location.hostname + "/";
    var flashPath = "flash/";    




    if(location.href.indexOf('fsdev') > 0 )
    {
        flashPath = "fsdev/peanutbutter/flash/";
    }

    if(location.href.indexOf('fslive') > 0 )
    {
        flashPath = "fslive/peanutbutter/flash/";
    } 

    var completeFlashPath = "/" +flashPath+"banner.swf";



	// <![CDATA[	
							
		var fo = new FlashObject(completeFlashPath, "topBanner", "473", "65", "7", "#FFFFFF");
		fo.write("topBanner");
	// ]]>

    */
}