/* Site Layouts/Content 
----------------------------------------------------------------------------------------------------------------------------------- */

$(document).ready(function() {
	$("a.lightbox").zoomimage({
		controls: false,
		border: 10,
		centered: true
	});
	$("#sitemap a.currentPage").each(function(){
	    $(this).parents("ul.sitemap").add($(this).find("+ ul")).show();
	});
	// centers 2 line long side bar navigation elements vertically
	$("#sidebar .side-navigation ul li ul li a").each(function(){
		$(this).css({"height":"auto", "padding":"0px", "paddingLeft":"53px"});
		if($(this).innerHeight()>30){
			$(this).css({height:"38px", paddingTop:"18px", paddingBottom:"18px"})
		}else{
			$(this).css({height:"46px", paddingTop:"28px"})
		}
		$(this).css({paddingLeft:"53px"});
	});
});

// from: http://www.johnandcailin.com/blog/john/using-jquery-place-prompt-text-your-exposed-drupal-filters

function inlineFieldLabel (label, inputid)
{
  var fieldLabel = label;         // string to put in your text input
  var textInput = $(inputid)  // your text input field
 

  /* add the field label css class to the form field and set the value */
	if(textInput.val() == "" || textInput.val() == fieldLabel){
	  textInput.addClass("unset").val(fieldLabel);
	}

  /* remove the placeholder string when field gets focus */
  textInput.focus(function()
   {
      if(this.value == fieldLabel )
      {
         $(this).removeClass("unset").val("");
      };
   });

  /* add the field label string when field looses focus */
  textInput.blur(function()
   {
      if(this.value == "")
      {
         $(this).addClass("unset").val(fieldLabel );
      };
   });

}

/* sIFR configuration
----------------------------------------------------------------------------------------------------------------------------------- */

var neutraDemi = { src: '/media/swf/neutra_demi.swf' };
var neutraText = { src: '/media/swf/neutra_text.swf' };

sIFR.activate(neutraText, neutraDemi);

sIFR.replace(neutraText, {
      selector: '#main-content .inside #content h1'
      ,css: {
        '.sIFR-root': { 'color': '#6a7b0c', 'font-size': '30px'}
      }
	  ,tuneHeight: '-3'
		,offsetTop: '2'
      ,wmode: 'transparent'
    });

sIFR.replace(neutraText, {
      selector: '#sidebar .side-navigation h3'
      ,css: {
        '.sIFR-root': { 'color': '#6a7b0c', 'font-size': '24px'}
      }
	  ,tuneHeight: '-5'
    ,wmode: 'transparent'
    });

sIFR.replace(neutraDemi, {
      selector: '#main-content .inside #content .withbg'
      ,css: {
        '.sIFR-root': { 'color': '#b9c818', 'font-size': '19px', 'text-transform': 'uppercase', 'letter-spacing': 1}
      }
	  ,tuneHeight: '-9'
      ,wmode: 'transparent'
    });

