var EditionsToolTip="The WEBpackaging Showcase Editions are focused regional and sector specific online showcases communicating the latest packaging developments."

var AdvertiseToolTip="Connect with packaging buyers and generate new business opportunities using the powerful WEBpackaging online communications platform." 

var SubscribeToolTip="Register for the free WEBpackaging eNewsletters and gain access to the full knowledge pool by upgrading to a Premium Access Subscription."

var AccountToolTip="Manage all aspects of your WEBpackaging user account - including changing your contact details or changing your password."

var AboutToolTip="WEBpackaging has been connecting packaging buyers and suppliers since 1996 - find out more about the powerful communication platform here."

var ContactToolTip="To get in touch with WEBpackaging call +34 91 5590901, or click here to locate your regional contact and fill in our online contact form."



var edition = '';
var isOverTab = false;
var isOverMenu = false;


function hideTab()
{
  if(!isOverTab && !isOverMenu)
  { 
    $('#'+edition+'Editions').fadeOut('fast');
  }
}


function tabOver()
{
  isOverTab = true;
}
function tabOut()
{
  isOverTab = false;
  prepareClose()
}


function menuOver()
{
  isOverMenu = true;
}
function menuOut()
{
  isOverMenu = false;
  prepareClose()
}



function prepareClose()
{
  setTimeout(hideTab, 500)
}



function showTab()
{
  if (edition != 'Global')
    $('#GlobalEditions').hide();	
  if (edition != 'NorthAmerica')
	$('#NorthAmericaEditions').hide();
  if (edition != 'Europe')
	$('#EuropeEditions').hide();
  if (edition != 'Asia')
	$('#AsiaEditions').hide();
  if (edition != 'SouthAmerica')
	$('#SouthAmericaEditions').hide();
  if (edition != 'Australia')
	$('#AustraliaEditions').hide();
  if (edition != 'Africa')
	$('#AfricaEditions').hide();

  tabOver();
  $('#'+edition+'Editions').fadeIn('fast');
  $('#'+edition+'Editions').hover(menuOver,menuOut)
}


function bindMenuEvent()
{
  
 $("#mainMenuItemGlobal a").hoverIntent(showTabglobal,tabOut);
 $("#mainMenuItemNorthAmerica a").hoverIntent(showTabnorthAmerica,tabOut);
 $("#mainMenuItemEurope a").hoverIntent(showTabeurope,tabOut);
 $("#mainMenuItemAsia a").hoverIntent(showTabasia,tabOut);
/* $("#mainMenuItemSouthAmerica a").hoverIntent(showTabsouthAmerica,tabOut);
 $("#mainMenuItemAustralia a").hoverIntent(showTabaustralia,tabOut);
 $("#mainMenuItemAfrica a").hoverIntent(showTabafrica,tabOut);
*/
 
 $("#topLevelMenu .ListItem0").hover(showToolTipEditions,hideToolTip);
 $("#topLevelMenu .ListItem1").hover(showToolTipAdvertise,hideToolTip);
 $("#topLevelMenu .ListItem2").hover(showToolTipSubscribe,hideToolTip);
 $("#topLevelMenu .ListItem3").hover(showToolTipAccount,hideToolTip);
 $("#topLevelMenu .ListItem4").hover(showToolTipAbout,hideToolTip);
 $("#topLevelMenu .ListItem5").hover(showToolTipContact,hideToolTip);


}



$(document).ready(function(){

  $("#rightHeader a").hoverIntent(
    function(){
      $("#rightHeader a img").animate({paddingLeft:"0px"})
    }
    ,
    function(){
    $("#rightHeader a img").animate({paddingLeft:"248px"})
    })


    $("#relatedSuppliers").change(function () {
      var str = "";
      $("#relatedSuppliers option:selected").each(function () {
        str += $(this).attr("value") + "/";
       });
      document.location.href=jquerySiteURL + "/suppliers/" + str
     })
     


});

function showNorthAmericaMap()
{
 
  var theImg = new Image();
  theImg.src = jqueryFilesPath + "/global/images/graphics/maps/northamericaMap_over.jpg"

  $("#globalPackagingMapImage").attr("src",theImg.src)
}

function showSouthAmericaMap()
{
  var theImg = new Image();
  theImg.src = jqueryFilesPath + "/global/images/graphics/maps/southamericaMap_over.jpg"
  $("#globalPackagingMapImage").attr("src",theImg.src)
}

function showAsiaMap()
{
  var theImg = new Image();
  theImg.src = jqueryFilesPath + "/global/images/graphics/maps/AsiaMap_over.jpg"
  $("#globalPackagingMapImage").attr("src",theImg.src)
}

function showAustraliaMap()
{
  var theImg = new Image();
  theImg.src = jqueryFilesPath + "/global/images/graphics/maps/AustraliaMap_over.jpg"
  $("#globalPackagingMapImage").attr("src",theImg.src)
}

function showAfricaMap()
{
  var theImg = new Image();
  theImg.src = jqueryFilesPath + "/global/images/graphics/maps/AfricaMap_over.jpg"
  $("#globalPackagingMapImage").attr("src",theImg.src)
}

function showEuropeMap()
{
  var theImg = new Image();
  theImg.src = jqueryFilesPath + "/global/images/graphics/maps/EuropeMap_over.jpg"
  $("#globalPackagingMapImage").attr("src",theImg.src)
}


function showGlobalMap()
{
  var theImg = new Image();
  theImg.src = jqueryFilesPath +"/global/images/graphics/maps/blueglobalMap.jpg" 
  $("#globalPackagingMapImage").attr("src",theImg.src)
}




function showTabglobal(){edition ='Global';showTab();}
function showTabnorthAmerica(){edition ='NorthAmerica';showTab();}
function showTabeurope(){edition ='Europe';showTab();}
function showTabasia(){edition ='Asia';showTab();}
function showTabsouthAmerica(){edition ='SouthAmerica';showTab();}
function showTabaustralia(){edition ='Australia';showTab();}
function showTabafrica(){edition ='Africa';showTab();}




function showToolTipEditions()
{
    $("#topLeveToolTip").text(EditionsToolTip).attr("class","EditionsToolTip").fadeIn("slow")
}
function showToolTipAdvertise()
{
    $("#topLeveToolTip").text(AdvertiseToolTip).attr("class","AdvertiseToolTip").fadeIn("slow")
}
function showToolTipSubscribe()
{
    $("#topLeveToolTip").text(SubscribeToolTip).attr("class","SubscribeToolTip").fadeIn("slow")
}

function showToolTipAccount()
{
    $("#topLeveToolTip").text(AccountToolTip).attr("class","AccountToolTip").fadeIn("slow")
}

function showToolTipAbout()
{
    $("#topLeveToolTip").text(AboutToolTip).attr("class","AboutToolTip").fadeIn("slow")
}

function showToolTipContact()
{
   $("#topLeveToolTip").text(ContactToolTip).attr("class","ContactToolTip").fadeIn("slow")
}

function hideToolTip()
{
  $("#topLeveToolTip").fadeOut("fast")
}

/***EUROPE***/


function showGreenEuropeMap()
{
  var theImg = new Image();
  theImg.src = jqueryFilesPath + "/global/images/graphics/maps/europeMap.jpg"
  $("#europeMapImage").attr("src",theImg.src)
} 

function showUKMap()
{
  var theImg = new Image();
  theImg.src = jqueryFilesPath + "/global/images/graphics/maps/europeMap_Uk-Ireland.jpg"
  $("#europeMapImage").attr("src",theImg.src)
}


function showFranceMap()
{
  var theImg = new Image();
  theImg.src = jqueryFilesPath + "/global/images/graphics/maps/europeMap_france.jpg"
  $("#europeMapImage").attr("src",theImg.src)
}

function showAustriaMap()
{
  var theImg = new Image();
  theImg.src = jqueryFilesPath + "/global/images/graphics/maps/europeMap_austria-switzerland.jpg"
  $("#europeMapImage").attr("src",theImg.src)
}


function showBeneluxMap()
{
  var theImg = new Image();
  theImg.src = jqueryFilesPath + "/global/images/graphics/maps/europeMap_benelux.jpg"
  $("#europeMapImage").attr("src",theImg.src)
}


function showEasternMap()
{
  var theImg = new Image();
  theImg.src = jqueryFilesPath + "/global/images/graphics/maps/europeMap_easterneurope.jpg"
  $("#europeMapImage").attr("src",theImg.src)
}

function showGermanyMap()
{
  var theImg = new Image();
  theImg.src = jqueryFilesPath + "/global/images/graphics/maps/europeMap_germany.jpg"
  $("#europeMapImage").attr("src",theImg.src)
}

function showIberiaMap()
{
  var theImg = new Image();
  theImg.src = jqueryFilesPath + "/global/images/graphics/maps/europeMap_iberia.jpg"
  $("#europeMapImage").attr("src",theImg.src)
}

function showRussiaMap()
{
  var theImg = new Image();
  theImg.src = jqueryFilesPath + "/global/images/graphics/maps/europeMap_rusia.jpg"
  $("#europeMapImage").attr("src",theImg.src)
}


function showItalyMap()
{
  var theImg = new Image();
  theImg.src = jqueryFilesPath + "/global/images/graphics/maps/europeMap_italy.jpg"
  $("#europeMapImage").attr("src",theImg.src)
}

function showScandinaviaMap()
{
  var theImg = new Image();
  theImg.src = jqueryFilesPath + "/global/images/graphics/maps/europeMap_scandinavia.jpg"
  $("#europeMapImage").attr("src",theImg.src)
}
