//slide out the languages bar
function languages(){
    $("#languageholder").hover(function(){
        $("#languagelist").animate({opacity: "show"});
    }, function() {
        $("#languagelist").animate({opacity: "hide"});
    });
}

function nospam() {
	$('a.email').nospam({
	      replaceText: true,    // BOOLEAN, optional default false. If set to true, replaces matched elements' text with the e-mail address
	      filterLevel: 'normal' // STRING, optional accepts 'low' or 'normal', default 'normal'.
	                            // low: email/domain/tld
	                            // normal: dlt/niamod/liame (email/domain/tld reversed)
	});
}

function showQuestionDialog(){
	$("#contact").hide();

	$("#expand").click(function(){
			$("#contact").animate({height: "show"});
			$("#expand").animate({height: "hide"});
			$("#submit").animate({height: "show"});
	});
	$("#contactus").click(function(){
			$("#contact").animate({height: "show"});
			$("#expand").animate({height: "hide"});
			$("#submit").animate({height: "show"});
	});
	$("#contactfaq").click(function(){
			$("#contact").animate({height: "show"});
			$("#expand").animate({height: "hide"});
			$("#submit").animate({height: "show"});
	});

	$("#closeform").click(function(){
			$("#contact").animate({height: "hide"});	
			$("#expand").animate({height: "show"});
			$("#submit").animate({height: "hide"});
	});
}

function validateForm() {
	if (validate_email(document.cform.C_EmailAddress.value)==true) {
		return true;
	} else {
		return false;
	}
}

function validate_email(value) {
	with (value) {
		apos=value.indexOf("@");
		dotpos=value.lastIndexOf(".");
		if (apos<1||dotpos-apos<2) {
		  	return false;
		} else {
			return true;
		}
	}
}

function breadcrumbs(){
  sURL = new String;
  bits = new Object;
  var x = 0;
  var stop = 0;
  var output = "<a class=breadlink href=\"/\">Home</a>  >  ";
  sURL = location.href;
  sURL = sURL.slice(8,sURL.length);
  chunkStart = sURL.indexOf("/");
  sURL = sURL.slice(chunkStart+1,sURL.length)
  while(!stop){
    chunkStart = sURL.indexOf("/");
    if (chunkStart != -1){
      bits[x] = sURL.slice(0,chunkStart)
      sURL = sURL.slice(chunkStart+1,sURL.length);
    }else{
      stop = 1;
    }
    x++;
  }
  for(var i in bits){
    output += "<a class=breadlink href=\"";
    for(y=1;y<x-i;y++){
      output += "../";
    }
    output += bits[i] + "/\">" + bits[i] + "</a>  >  ";
  }
  document.write(output + document.title);
}

function pageInfo(){
	var pageTitle = document.title;
	var pageAddr = location.href;
}	

function showEmail(){
	pageInfo();
	$("#confirmform").hide();
	$("#emailform").show();
}

function hideEmail(){
	$("#emailform").hide();
	$("#confirmform").hide();
}

function showHide(){
	$(".qa").click(function(){
		$(".solution").slideToggle();
	});
}

