$(document).ready(function() {
  
  var path = location.href;
  var spath = location.href.split( '/' );
  var newURL = location.protocol+"//"+location.host;
  if (spath[3]) { newURL += "/"+spath[3];}
  if (!spath[4]) { newURL += "/"; }
  if (spath[4]) { newURL += "/"+spath[4];}
  if (spath[5]) { newURL += "/"+spath[5]+"/"; }

  $("#submenu ul li a[href='" + [newURL] + "']").parents("li").addClass("active"); 
  $(".pagecontent_left ul li a[href='" + [path] + "']").addClass("active");
  
 
    $('acronym[title]').qtip({
		style: { 
			background: '#f8f5f0',
			color: '#333333',
      		border: {			
			radius: 0,
			color: '#dddac9'
		}
		}
	});
 
   $('a#sitetag[rel]').each(function()
   { 
      $(this).qtip(
      {
         content: {       
            text: '<img class="throbber" src="/resources/images/loader.gif" alt="Loading..." />',
            url: $(this).attr('rel'), // Use the rel attribute of each element for the url to load
            title: {
               text:  false, 
               button: 'Close',
			   color: '#FFFFFF'
            }
         },
         position: {
            corner: {
               target: 'bottomMiddle', // Position the tooltip above the link
               tooltip: 'topMiddle'
            },
            adjust: {
               screen: true // Keep the tooltip on-screen at all times
            }
         },
         show: { 
            when: 'click', 
            solo: true // Only show one tooltip at a time
         },
         hide: 'unfocus',
         style: {
			background: 'url(/resources/images/bg50.png)',			
			color: '#FFFFFF',
			tip: true, // Apply a speech bubble tip to the tooltip at the designated tooltip corner
            border: {
               width: 0,
               radius: 0,
			   color: '#333333'
            },
            width: 400 // Set the tooltip width
         }
		
      })
   });
  
  
});


function clearText(theField) {
   if (theField.defaultValue == theField.value)
   theField.value = '';
}

function addText(theField) {
   if (theField.value == '')
   theField.value = theField .defaultValue;
} 
