// JavaScript Document

<!-- 
	 
function cc()
{
 /* check for a cookie */
  if (document.cookie == "") 
  {
    /* if a cookie is not found - alert user -
     change cookieexists field value to false */
    alert("COOKIES need to be enabled before using this contact form!");

    /* If the user has Cookies disabled an alert will let him know 
        that cookies need to be enabled to log on.*/ 

    document.Form1.cookieexists.value ="false"  
  } else {
   /* this sets the value to true and nothing else will happen,
       the user will be able to log on*/
    document.Form1.cookieexists.value ="true"
  }
}

/* Set a cookie to be sure that one exists.
   Note that this is outside the function*/
document.cookie = 'killme' + escape('nothing')


function getUrlVars()
{
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
    return vars;
}

var error = getUrlVars()["action"];
 
$(document).ready(function() { 
	$('ul.sf-menu').superfish({ 
		delay:       750,                            // .75 second delay on mouseout 
		animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
		speed:       'normal',                          // normal animation speed 
		autoArrows:  false,                           // disable generation of arrow mark-up 
	});
	
	var active_color = '#000'; // Colour of user provided text
	var inactive_color = '#888'; // Colour of default text
	
	  $("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];
	      }
	    });
	  });

	if (error == "error1" || error == "error2" || error == "error3" || error == "error4" || error == "error5") {  
		$("#uscitno").show();
	}
	else {
		$("#uscitno").hide();		
	}
	
  $(function(){
    $(".uscit").click(function(){
      if($(this).val() === "No")
        $("#uscitno").show("fast");
      else
        $("#uscitno").hide("fast");
    });
  });	

});



// -->
