

//-----------------------------------------------
//	IE nav fix
//-----------------------------------------------
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
	
}
if (window.attachEvent) window.attachEvent("onload", sfHover);




//-----------------------------------------------
//	Open links in a tab
//-----------------------------------------------
function externalLinks() {
  if (!document.getElementsByTagName) return;
  var anchors = document.getElementsByTagName("a");
  for (var i=0; i<anchors.length; i++) {
    var anchor = anchors[i];
    if (anchor.getAttribute("href") &&
        anchor.getAttribute("rel") == "external")
      anchor.target = "_blank";
    }
}
window.onload = externalLinks;




//-----------------------------------------------
//	hide email from spam
//-----------------------------------------------
var user;
var domain;
var suffix;
function ehide(user, domain, suffix){
	document.write('<a href="' + 'mailto:' + user + '@' + domain + '.' + suffix + '" >' + user + '@' + domain + '.' + suffix + '</a>');
}




//-----------------------------------------------
//	cmxform	
//-----------------------------------------------
$(document).ready(function() {                
	if(jQuery.browser.mozilla) {
		$('.cmxform').hide().find('label:not(.nocmx)').each(function(){
			var $labelContent = $(this).html();
			var $labelWidth = $(this).css('width');
			$(this).empty();
			$(this).append('<span style="display: block; width: '+$labelWidth+';">');
			$(this).prepend('</span>');
			$(this).css('display', '-moz-inline-box');
			$(this).find('span').html($labelContent);
			$('.cmxform').show();
		});
	};             
});





//-----------------------------------------------
//	show top level rollover when rolling over
// dropdown
//-----------------------------------------------
$(document).ready(function() {
									
	$('#nav li ul li a').hover (
		function () {
			$(this).parent().parent().parent().children('a').addClass('active');
		}, function () {
			$(this).parent().parent().parent().children('a').removeClass('active');
		}
	);
									
});






//-----------------------------------------------
//	forms - show active class on input focus
//-----------------------------------------------
$(document).ready(function () {
									 
	$('form.cmxform input').focus (
		function () {
			$(this).addClass('focus');
		}
	);
	
	$('form.cmxform input').blur (
		function () {
			$(this).removeClass('focus');
		}
	);
									 
});





//-----------------------------------------------
//	curved panels
//-----------------------------------------------
$(document).ready(function() {  
									
	$('.footer .services').corner();
	$('.panel').corner();

});











