/* Cufon */

Cufon.replace('#nav > li > a, #breadcrumb', {  fontFamily: 'serverstream-one', hover: true });

Cufon.replace('h1, h2, h3, .telephone', {  fontFamily: 'serverstream-two', hover: true }); 

/* Subnav */

jQuery(function(){

jQuery('ul#nav').superfish({delay:500,animation:{opacity:'show',height:'show'},speed:'fast',autoArrows:false,dropShadows:false,hoverClass:'sfHover'});

});

$(document).ready(function() {
 
 /* Drop logo */
 
if($('body').is('#home')){

$("#logo").css("top", "-46px");
$("#nav, #search").css("display", "none");
$("#header .telephone").css("display", "none");

setTimeout(function() {
$("#logo").animate({ 
        top: "25px"
      }, 500 );
      
}, 450);

setTimeout(function() {
$('#nav, #search').fadeIn('slow', function() { });
}, 550);

setTimeout(function() {
$('#header .telephone').fadeIn('slow', function() { });
}, 1000);

}

/* Home Product Background */


$('#home-products .column').hover(function(){
$(this).addClass("hovered");
$('div', this).addClass("hovered");
}, function(){
$(this).removeClass("hovered");
$('div', this).removeClass("hovered");
});


$('#hosting .products .column').hover(function(){
$(this).addClass("hovered");
$('div', this).addClass("hovered");
}, function(){
$(this).removeClass("hovered");
$('div', this).removeClass("hovered");
});
});

 
/* Home Hero Carousel */

$(function() {
$('#hero').cycle({
fx:     'fade',
speed:  'slow',
timeout: 9000,
pager:  '.heronav-inner',
prev:   '#previo', 
next:   '#nextio', 
before: function() { if (window.console) console.log(this.src); }
});
});

/* Product Tabs */

$(function() {
$('#tabs').tabs({ fx: { opacity: 'show', duration:'normal'} });
});


/* Lightbox */

$(function() {
$('a[rel=lightbox]').lightBox(); 
});
 

/* Inputs */

$(document).ready(function() {

$("input[type=text][title]").each(function() {
$(this).val($(this).attr("title"));
if($.trim($(this).val()) == "")
$(this).val($(this).attr("title"));
$(this)
.focus(function() {
if($(this).val() == $(this).attr("title")) $(this).val("");
})
.blur(function() {
if($.trim($(this).val()) == "") $(this).val($(this).attr("title"));
});

});
    
});

/* Pricing table */

$(function() {
$('#layout1 #pricing table tr:odd td').css("background-color","#f6f6f6");
});

/* Dropdowns */


$(function() {
if($('#enquiry_type').length){
$('#enquiry_type').selectbox();
}
if($('#best_time').length){
$('#best_time').selectbox();
}
});
 
/* Validation */

$().ready(function() {
	
var container = $('div.errors');
if($("#contact-form, #callback-form, #partners-register").length){
var validator = $("#contact-form, #callback-form, #partners-register").validate({
errorContainer: container,
errorLabelContainer: $("ol", container),
wrapper: 'li',
meta: "validate",
submitHandler: function(form){ sendemail(form);}
});
}
});

/* Jim Added for Google Analytics */

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-4943862-3']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'https://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();


