//西部硅谷JQUERY版AjaxTabs
//powered by 吴坤
//2008-3-11
function ajaxtabs(elem){
	option = {
			navselClass: 'sel',
			MouseDelayTime: 150,
			ajccache:{},
			fx:null
	};
	
	var waitInterval;
    for(var i=0;i<elem.length;i++)
    {
        var ulobj=$(elem[i]);
        ulist=ulobj.find("a");
		ulist.each(
			function(){
				var theli = $(this);
				var theurl = theli.attr("urn");
				var thetarg = theli.attr("rel");
				var key = theurl;
				if(theurl.indexOf("#default")>-1){
					option.ajccache[key]=$(thetarg).html();
				}
				
				$(theli).bind('mouseover',
				function(){
					clearTimeout(waitInterval);
					var waitInterval = setTimeout(function(){
						theli.parent().children().removeClass();
						theli.addClass(option.navselClass);
						//载入远程文件
						if(option.ajccache[theurl] == null){
							$(thetarg).load(theurl,function(data){
								option.ajccache[key] = data;
							});
						}else{
							$(thetarg).html(option.ajccache[key]);
						}
					}, option.MouseDelayTime);
				}
				);
			}
		);
    }
}

window.onerror=function(){return true}
