if ($j.browser.msie && ($j.browser.version == "6.0")) {
}
else {
	Cufon.replace('#tagline', { 
		fontFamily: 'Century Gothic',
		hover: false
	});
	
	Cufon.replace('h2', { 
		fontFamily: 'Century Gothic',
		hover: true
	});
	
	Cufon.replace('.detail h3', { 
		fontFamily: 'Century Gothic',
		hover: false
	});
	
	Cufon.replace('h4', { 
		fontFamily: 'Century Gothic',
		hover: false
	});
	
	Cufon.replace('.services h3', { 
		fontFamily: 'Century Gothic',
		hover: false
	});
	
	Cufon.replace('#nav>li>span>a', { 
		fontFamily: 'Century Gothic',
		hover: true
	});
	
	Cufon.replace('.learn a', { 
		fontFamily: 'Century Gothic',
		hover: true
	});
}

$j(document).ready(function() {
	//home
	$j("#bottom-col ul .learn a").prepend("+ ");
	$j(".product-lists li:last-child").addClass("last");
	$j(".lists li:last-child").addClass("last");
	$j("#intro").corner("5px");
	$j("#slideshow").cycle();
	
	$j.each($j.browser, function(i, val) {
	   if(i=="mozilla" && $j.browser.version.substr(0,3)=="1.9") {
	      $j("#intro .title").corner("top 5px");
	     }
	});
	
	$j(".product-lists li").each(function(i){
		var imgSrc = $j(this).children(".imgholder").children().attr("src");
		$j(this).children(".imgholder").css("background","url('"+imgSrc+"') 55% 50% no-repeat");
		$j(this).children(".imgholder").children().attr("src","");
	});
	
	//products
	$j(".products li").each(function(i){
		var title = $j(this).children().children("h3").text();
		var url = $j(this).children().children(".learn").children("a").attr("href");
		var target = $j(this).children().children(".learn").children("a").attr("target");
		var id = $j(this).children().children(".learn").attr("id");
		var nav = $j(this).parents("#wrapper").find("#navbar li._nav_products");
		var total = $j(".products li").length - 1;
		$j(nav).append('<li class="_statusPublic _nav_products-'+title+'"><span class="_navItem"><a id="'+id+'" class="navLink" href="'+url+'" target="'+target+'">'+title+'</a></span></li>');
		if(i == total) {
			$j("#navbar li._nav_products").children("li").wrapAll("<ul></ul>");
		}
		if($j(".detail").attr("id") == id) {
			$j("._navItem a#"+id).parent().parent().addClass("active")
		}
	});
	
	//services
	$j(".services li").each(function(i){
		var imgSrc = $j(this).children(".imgholder").children().attr("src");
		$j(this).children(".imgholder").css("background","url('"+imgSrc+"') 55% 0% no-repeat");
		$j(this).children(".imgholder").children().attr("src","");
		
		var title = $j(this).children().children("h3").text();
		var url = $j(this).children().children(".learn").children("a").attr("href");
		var target = $j(this).children().children(".learn").children("a").attr("target");
		var id = $j(this).children().children(".learn").attr("id");
		var nav = $j(this).parents("#wrapper").find("#navbar li._nav_services");
		var total = $j(".services li").length - 1;
		$j(nav).append('<li class="_statusPublic _nav_products='+title+'"><span class="_navItem"><a id="'+id+'" class="navLink" href="'+url+'" target="'+target+'">'+title+'</a></span></li>');
		if(i == total) {
			$j("#navbar li._nav_services").children("li").wrapAll("<ul></ul>");
		}
		if($j(".detail").attr("id") == id) {
			$j("._navItem a#"+id).parent().parent().addClass("active")
		}
	});
	
	//clients
	$j(".clients li").each(function(i){
		var imgSrc = $j(this).children(".imgholder").children(".logoholder").children().children().attr("src");
		//console.log(imgSrc);
		$j(this).children(".imgholder").children(".logoholder").css("background","url('"+imgSrc+"') 50% no-repeat");
		$j(this).children(".imgholder").children(".logoholder").children().children().attr("src","");
		if(i % 3 == '2') {
			$j(this).addClass("last");
		}
	});
	
	//resources
	$j(".accordion").accordion({
		autoHeight: false
	});
	
	//news
	$j(".lists.news li").last().addClass("last");
	
	//contact
	$j(".contactInfo").append('<img src="_assets/images/contact-line.png" border="0" />');
	$j("#contactform li").each(function(){
		$j(this).children("fieldset").last().addClass("last");
	});
	
	//navigation
	$j("#nav li ul").parent().addClass("_parentNav");
	$j("#nav li li:last-child").addClass("last");
	$j("#nav li li li a").prepend("&raquo; ");
	
	//tabs
	$j(".tabs").tabs({
		show: function(event, ui) {
			$j("#wrapper .ui-state-default a").css("opacity","0.7");
			$j("#wrapper .ui-state-active a").css("opacity","1");
		}
	});

});












