// JavaScript Document
// resultlist narrow down search show/hide divs / form
<!-- jquery for this page -->
$(document).ready(function() { 
$('#formbox').hide(); 

$('div.comment').click(
	 function() { 
        var id = $(this).attr('id'); 
     $('#formbox_' + id).slideToggle(250);
	 $(this).toggleClass("active");
     // alert(id); 
     return false; 
     }); 

$('div.comment_n').click(
	 function() { 
        var id = $(this).attr('id'); 
     $('#formbox_' + id).slideToggle(250);
	 $(this).toggleClass("active_n");
     // alert(id); 
     return false; 
     }); 

}); 

// textfield value script
/**
 * Written by Rob Schmitt, The Web Developer's Blog
 * http://webdeveloper.beforeseven.com/
 */

/**
 * The following variables may be adjusted
 */
var active_color = '#000'; // Colour of user provided text
var inactive_color = '#666'; // Colour of default text

/**
 * No need to modify anything below this line
 */

$(document).ready(function() {
  $("input.default-value").css("color", inactive_color);
  var default_values = new Array();
  $("input.default-value").focus(function() {
    if (!default_values[this.id]) {
      default_values[this.id] = this.value;
    }
    if (this.value == default_values[this.id]) {
      this.value = '';
      this.style.color = active_color;
    }
    $(this).blur(function() {
      if (this.value == '') {
        this.style.color = inactive_color;
        this.value = default_values[this.id];
      }
    });
  });
});



// javascript to comply to strict html for external links
// origanal js from sitepoint
// JavaScript Document
function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;



