﻿/*
前台专用JS
*/

/* ===============UI相关：开始=============== */
$(document).ready(function() {
    AddFormClass();
});

function AddFormClass() {
	$("input:submit:not([class]),input:button:not([class])").addClass("SkinButton");
	$("input:file:not([class])").addClass("SkinUpload");
	$("input:text:not([class]),input:password:not([class])").addClass("SkinTextBox");
	$("input:checkbox:not([class])").addClass("SkinCheckBox");
}

/*针对class含UI-MouseOver的ul，鼠标移动到li后会变色*/
$(document).ready(function() {
	$("ul.UI-MouseOver li").mouseover(function() {
		$(this).addClass("MouseOver");
	});
	$("ul.UI-MouseOver li").mouseout(function() {
		$(this).removeClass("MouseOver");
	});
});
/* ===============UI相关：结束=============== */





//查看会员信息
function  ViewUserInfo(userID) {
	$.fn.colorbox({ innerWidth: 400, innerHeight: 200, title: "查看会员信息", opacity: 0.65, iframe: true, href: GLOBAL_RootPath + "/Front/User/UserInfo.aspx?UserID=" + userID });
}

//我的信息面板
function  ShowControlPanel(tab) {
	var url=GLOBAL_RootPath + "/Front/User/ControlPanel.aspx";
	if (tab!=undefined && tab!="") {
		url = url + "?Tab=" + tab;
	}
	$.fn.colorbox({ innerWidth: 610, innerHeight: 420, title: "个人设置", opacity: 0.65, iframe: true, href: url,onClosed:function(){location=location;} });
}

//显示短信列表
//参数defaultTab：systembox privatebox sendbox send
//参数systemPMType
function ShowPMList(defaultTab,systemPMType) {
	var url = GLOBAL_RootPath + "/Front/PM/Default.aspx";
	if (defaultTab!=undefined) {
		url = GLOBAL_RootPath + "/Front/PM/Default.aspx?DefaultTab=" + defaultTab;
		if (systemPMType!=undefined) {
			url = url + "&SystemPMType=" + systemPMType;
		}
	}
	$.fn.colorbox({ innerWidth: 600, innerHeight: 440, title: "站内短信", opacity: 0.65, iframe: true, href: url });
}

//发送站内短信给指定会员名
function SendPMToUsername(toUsername) {
	$.fn.colorbox({ innerWidth: 600, innerHeight: 430, title: "站内短信", opacity: 0.65, iframe: true, href: GLOBAL_RootPath + "/Front/PM/Default.aspx?DefaultTab=Send&ToUsername=" + toUsername });
}

//登录
function ShowLoginModal() {
	$.fn.colorbox({ innerWidth: 350, innerHeight: 165, title: "登 录", opacity: 0.65, iframe: true, href: GLOBAL_RootPath + "/Front/User/Login.aspx" });
}

//注册
function ShowRegModal() {

	$.fn.colorbox({ innerWidth: 400, innerHeight: 240, title: "注册账号", opacity: 0.65, iframe: true, href: GLOBAL_RootPath + "/Front/User/Reg.aspx" });
}


//查IP功能
$(function() {
	$(".CheckIPLink").click(function() {
		var ip=$(this).attr("ipaddress");
		var url=GLOBAL_RootPath + "/Front/Misc/CheckIP.aspx?IP=" + ip;
		ModalPopup(url,330,100,"IP来源查询");
	});
});

