document.write('<script language="javascript" src="/inc/lib/jquery/jquery.lazyload.js"></script>');
var _GLOBAL = {};

function process(o) {
	var $target = o.tagName == 'FORM' ? $(':submit', o) : (o.tagName == 'INPUT'
			&& (o.type == 'button' || o.type == 'submit') || o.tagName == 'A') ? $(o) : null;

	if (!$target) {
		alert('不支持的对象类型')
		return;
	}

	if (!$target.data('processimg')) {
		$target.data('processimg',
				$('<img alt="加载中" style="margin-left:5px;vertical-align:middle;display:none" src="/images/loading.gif" />')
						.insertAfter($target))
	}

	if ($target[0].tagName == 'A') {
		$target.toggle()
	} else {
		$target[0].disabled = !$target[0].disabled;
	}

	$target.data('processimg').toggle();
}

function lazyload(selector, event) {
	$(selector).lazyload({
				effect : "fadeIn",
				event : event
			})
}

function inticheckcode(obj, callback) {
	var $input = $(obj);
	$input.addClass('gray')
	$(obj).focus(function() {
		if (!$(this).data('showcheckcode')) {
			$input.removeClass('gray').val('')
			$(this).data('showcheckcode', true)
			$(this).after($('<img alt="点击刷新" style="margin-left:2px;vertical-align:middle;cursor:pointer" />').click(
					function() {
						this.src = "/checkcode.php?" + new Date().getTime();
						$input.focus();
					}).click())

		}

	})
	return $input;
}
function setHomepage() {
	if (document.all) {
		document.body.style.behavior = 'url(#default#homepage)';
		document.body.setHomePage(location.href);
	} else if (window.sidebar) {
		if (window.netscape) {
			try {
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
			} catch (e) {
				alert("this action was aviod by your browser，if you want to enable，please enter about:config in your address line,and change the value of signed.applets.codebase_principal_support to true");
			}
		}
		var prefs = Components.classes['@mozilla.org/preferences-service;1']
				.getService(Components.interfaces.nsIPrefBranch);
		prefs.setCharPref('browser.startup.homepage',location.href);
	}
}

$(function() {
			// 统计
			$.get('/music.php?action=getcount', null, function(json) {
						if (json) {
							$('#todayupdatemusic').html(json.todayupdatemusic);
							$('#totalmusic').html(json.totalmusic);
						}
					}, 'json')
		})