/**
* @author  : K_Wasseem
* @URL     : http://7php.com
* @license : FREE (like free air)
* @optional: I'll appreciate a link back from your site if you do refer to my article ;)
*/


function getQuerystring(key, default_)
 {
   if (default_==null) default_=""; 
  key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
   var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
   var qs = regex.exec(window.location.href);
   if(qs == null)
     return default_;
   else
     return qs[1];
 }


jQuery(document).ready(function () {

	// set up rollover
	$("img.footerrollover").hover(
		function()
		{
			this.src = this.src.replace("_off","_on");
		},
		function()
		{
			this.src = this.src.replace("_on","_off");
		}
	);

	// set up rollover
	$("img.headerrollover").hover(
		function()
		{
			this.src = this.src.replace("_off","_on");
		},
		function()
		{
			this.src = this.src.replace("_on","_off");
		}
	);

    //if on the contact form, and the conditions apply, set the defaults
	if (getQuerystring("subject") != null){
		if ($("#field_8dyruz").val() == ""){
			$("#field_8dyruz").val(decodeURIComponent(getQuerystring("subject")));
			$("#field_77trof").val(decodeURIComponent(getQuerystring("message")));
		}
		//focus on teh first person
		$("#field_wpxc0r").focus();
	}

});
