$(function(){
	var scr = $("#js-src").attr('src');
	scr = scr.replace(/js\/header_nav.js/g,"");
	var i = 0;
	
	var loadTxt = function() {
		i++;
		if(i >= 4) {
			new Spry.Widget.MenuBar("header-nav");
		}
	}
	jQuery.get(scr+"js/products.txt",function(text){
		$("#header-products").html($("#header-products").html()+text);
		loadTxt();
	});
	jQuery.get(scr+"js/customer.txt",function(text){
		$("#header-customer").html($("#header-customer").html()+text);
		loadTxt();
	});
	jQuery.get(scr+"js/csr.txt",function(text){
		$("#header-csr").html($("#header-csr").html()+text);
		loadTxt();
	});
	jQuery.get(scr+"js/company.txt",function(text){
		$("#header-company").html($("#header-company").html()+text);
		loadTxt();
	});
	jQuery.get(scr+"js/recruit.txt",function(text){
		$("#header-recruit").html($("#header-recruit").html()+text);
		loadTxt();
	});
});
