$(document).ready(function() {
	// 导航切换
	$("#nav li").mouseover(function() {
				if ($(this).attr('class').indexOf('active') >= 0) {
					return false;
				}
				$(this).attr('class', $(this).attr('class') + '-active');
				$(this).siblings().each(function() {
							var c = $(this).attr('class');
							if (c.indexOf('active') >= 0) {
								$(this).attr('class', c.replace('-active', ''));
							}
						})
})

	$("#nav").mouseout(function() {
				$(this).children().children().each(function() {
							var c = $(this).attr('class');
							// alert(c);
							if ($(this).attr('active')) {
								if (c.indexOf('active') >= 0)
									return false;
								$(this).attr('class', c + '-active');
							} else {
								$(this).attr('class', c.replace('-active', ''));
							}
						})
			})
})

//添加收藏夹
function myAddPanel(title,url)
{
    if ((typeof window.sidebar == 'object') && (typeof window.sidebar.addPanel == 'function'))
    {
        window.sidebar.addPanel(title,url,"");
    }
    else
    {
        window.external.AddFavorite(url,title);
    }
}
//ie6 css 背景缓存
if (/*@cc_on @_jscript_version === 5.6 || @*/false) {
     try { 
         document.execCommand("BackgroundImageCache", false, true);
     } catch(err) {}
 }
 
//url 解析
 function url_par(href,argName,argValue){		
    if (!argName || !argValue)  return false;
    var url = href.split('?')[0]?href.split('?')[0]:href;
    var args = href.split('?')[0]?'?'+href.split('?')[1]:'';
    var reg = new RegExp('([\?&]?)' + argName + '=[^&]*[&$]?', 'gi');
    args = args.replace(reg, '$1');
    if (args == '' || args == null) {
        args += '?' + argName + '=' + argValue;
    }
    else 
        if (args.substr(args.length - 1, 1) == '?' || args.substr(args.length - 1, 1) == '&') {
            args += argName + '=' + argValue;
        }
        else {
            args += '&' + argName + '=' + argValue;
        }
        return url + args;
}
