// JavaScript Document
jQuery.fn.hint = function() {
				return this.each(function(){
					var t = $(this); // get jQuery version of 'this'
					var title = t.attr('title'); // get it once since it won't change
					
					if (title) { // only apply logic if the element has the attribute
						
						// on focus, set value to blank if current value matches title attr
						t.focus(function(){
							if (t.val() == title) {
							  t.val('');
							  t.removeClass('blur');
							}
						})

						// on blur, set value to title attr if text is blank
						t.blur(function(){
							if (t.val() == '') {
							  t.val(title);
							  t.addClass('blur');
							}
						})

						// clear the pre-defined text when form is submitted
						t.parents('form:first()').submit(function(){
							if (t.val() == title) {
								t.val('');
								t.removeClass('blur');
							}
						});

						// now change all inputs to title
						t.blur();
					}
				})				
			}

$(function(){ 
	$('input:text').hint();
})

$(document).ready(function(){  
		if (document.getElementById) {
			var alltags = document.all? document.all : document.getElementsByTagName("*");
			for (i=0; i < alltags.length; i++) {
			  if (alltags[i].className == "emailCloak") {
				var oldText = alltags[i].firstChild;
			  	var emailAddress = alltags[i].firstChild.nodeValue;
			  	var user = emailAddress.substring(0, emailAddress.indexOf("("));
			  	var website = emailAddress.substring(emailAddress.indexOf(")")+1, emailAddress.length);
			  	var newText = user+"@"+website;
			  	var a = document.createElement("a");
			  	a.href = "mailto:"+newText;
				var address = document.createTextNode(newText);
				a.appendChild(address);
				alltags[i].replaceChild(a,oldText);
			  }
			}
		}
});

$(document).ready(function(){ 
  if (!document.getElementsByTagName) return false;
  var lnks = document.getElementsByTagName("a");
  for (var i=0; i<lnks.length; i++) {
    if (lnks[i].getAttribute("class") == "popup") {
      lnks[i].onclick = function() {
        wpopUp(this.getAttribute("href"));
        return false;
      }
    }
  }
});


function wpopUp(winURL,width,height) {
  var wwidth = (width) ? width : 700;
  var wheight = (height) ? height : 480;
  window.open(winURL,"popup","scrollbars=1,resizable=1,width=" + wwidth + ",height=" + wheight);
}