showMarkets = false
$(document).ready(function(){

if (getMicrositeName()=='home')
{
  backLink=$.cookies.get('backlink')
  backText=$.cookies.get('backText')
  
  if (backLink == 'personal-care-packaging' ||
backLink == 'healthcare-packaging' ||
backLink == 'household-packaging' ||
backLink == 'food-and-beverage' )
  {

     $('#identifyPagehome').html('Return to<br /><a href="'+jQuerySiteURL + '/' + backLink + '/">'+backText+'</a>')
     $('input[name="clause"]').val(backLink)
     $('.identifyPageClass').css(
       {
         'text-transform':'none',
'line-height':'12px',
'padding-top':'0',
'font-size':'60%'})

     $('.identifyPageClass a').css(
         {'text-transform':'uppercase',
          'text-decoration':'none'})


     $('#identifyPagehome').attr('id','identifyPage'+backLink)
     $('#identifyhome').attr('id','identify'+backLink)
  }
}
else
{
  $.cookies.set('backlink',getMicrositeName())
  $.cookies.set('backText',jQueryMicrositeName)
}

$('.choose_section').hover(
function()
{

  $('#menu_header_sections').fadeIn('fast');
  $('#contactUs').fadeOut('fast')
  showMarkets = true;
}
,
 function()
{
  showMarkets = false;
  setTimeout(hideMarkets,2000);
})

$('#menu_header_sections').hover(function(){showMarkets = true},function(){showMarkets = false;
  setTimeout(hideMarkets,2000);})
})

function hideMarkets()
{
  if (!showMarkets)
  { 
    $('#menu_header_sections').fadeOut('fast');
    $('#contactUs').fadeIn('fast')
  }
}




function isFilled()
{
if (document.getElementById('search_id').value == '' ||  document.getElementById('search_id').value == 'SEARCH')
 {
  document.getElementById('search_id').value='';
  document.getElementById('search_id').focus();
  return false;
 }
 else
     return true;   
}

function Show_Text(theID)
{


idList=new Array();
idList = theID.split(",");
for (i=0; i<idList.length; i++)
{
 if (document.getElementById(idList[i]).style.display == 'block')
  document.getElementById(idList[i]).style.display='none';    
 else 
  document.getElementById(idList[i]).style.display='block';  

}
}

function getMicrositeName()
{
 theMicrosite = document.location.href.split('/')[3].toLowerCase();
 if (theMicrosite == "" )
   theMicrosite = 'home';
 return theMicrosite;
}