function form_swap_values(){
    swapValues = [];
    jQuery(".swap_value").each(function(i){
        swapValues[i] = jQuery(this).val();
        jQuery(this).focus(function(){
            if (jQuery(this).val() == swapValues[i]) {jQuery(this).val("");}}).blur(function(){
            if (jQuery.trim(jQuery(this).val()) == "") {jQuery(this).val(swapValues[i]);}});
    });
}   

function form_input_classes(){}

var localDomains = Array();
localDomains[0] = "pvmgt.com";
localDomains[1] = "pvmgt.org";
localDomains[2] = "142.245.8.134";



function outgoing_links(){

  jQuery('a').each(function() {
    var $a = jQuery(this);
    var href = $a.attr('href');

    // strip the host name down, removing subdomains or www
    var host = window.location.host.replace(/^(([^\/]+?\.)*)([^\.]{4,})((\.[a-z]{1,4})*)$/, '$3$4');
    
    if (href != null) {

      // see if the link is external -- location.host method
      if ( (href.match(/^http/)) && (! href.match(host)) && (! href.match(/^javascript/)) ) {
      
      	for (d in localDomains)
      		if (href.match(localDomains[d]))
      			return;
      
        // add thickbox code
        $a.addClass('thickbox').addClass('external');
        $a.attr('href', '#TB_inline?height=280&width=450&inlineId=tb_external');
        tb_init('a.thickbox');
      
        // on click, add external link code to the thickbox  
        $a.click(function () { 
          jQuery('#tb_external_thelink')
           .before('<p id="tb_external_thelink"><a href="' + href + '">' + href + '</a></p>')
           .remove();
        });
      }
    }
  
  });

}

jQuery(document).ready(function() {

  form_swap_values();
  form_input_classes();
  outgoing_links();
  
});



