///////////////////////////////////////////////////////////////
//
//  File: global power systems solutions javascript
//  Author: Craig Nelson / Classic Labs
//

  Event.observe(window, "load", function () {
    var anchors = $$("a");
    anchors.each(function (e) {
      if (e.getAttribute("rel") == "external") {
        e.target = "_blank";
      }
    });
  });
  
  // estimate form
	Event.observe(window, 'load', function() {
	  if ($('request-a-bid')) {
  	  var els = $$('#request-a-bid .forms');
  	  els.each(function(e) {
  	    if (!e.hasClassName('error')) {
  	      Event.observe(e, 'focus', function(event) {
    	      e.style.backgroundColor = '#fff';
    	      e.style.color = '#000';
    	      e.previous().down('span.indicator').style.visibility = 'visible';
    	    });
    	    Event.observe(e, 'blur', function(event) {
    	      e.style.backgroundColor = '#444';
    	      e.style.color = '#fff';
    	      e.previous().down('span.indicator').style.visibility = 'hidden';
    	    });
  	    }
  	  });
  	}
	});
  // --estimate form