﻿/*******************************************************************************
* OWNSOFT.COM
*
* @author Machael <dengcx@ncsi.com.cn>
* @site http://www.ownsoft.com
* @version 2.10.01.22
*******************************************************************************/

var OS = {};

OS.version = '2.10.01.22';

OS.lang = {
    save : "保存",
    cancel : "取消",
    close : "关闭",
    login : "用户登录",
    register : "免费注册",
    retrievepwd : "找回密码",
    newcustpin : "新注册用户确认",
    terms : "软件项目外包网用户手册",
    uploadfaceicon: "选择头像",
    nriccert : "实名认证",
    selProjCategory : "选择项目分类",
    changeProjPaymentType: "更改支付方式",
    projPaymentMng : "管理支付计划",
    postABid : "竞标此项目",
    projectBoard : "项目留言板",
    projectComplain : "投诉此项目",
    selectWinners : "选择开发商",
    ybProject : "应标此项目",
    wgProject : "项目已完工",
    pjProject : "评价项目主",
    closeProject : "关闭此项目",
    closedReason : "项目关闭原因",
    billingLog : "查看账单处理日志",
    withdrawLog : "查看提现处理日志",
    paymentLog : "查看现金交易日志",
    cnLog : "查看联系点数交易日志",
    pfLog : "查看现金冻结日志",
    disputeLog : "查看现金交易争议日志",
    throwADispute : "发起现金交易争议",
    showDisputeBoard : "现金交易争议板",
    about : "关于"
}

OS.scriptPath = (function() {
	var elements = document.getElementsByTagName('script');
	for (var i = 0, len = elements.length; i < len; i++) {
		if (elements[i].src && elements[i].src.match(/OS[\w\-\.]*\.js/)) {
			return elements[i].src.substring(0, elements[i].src.lastIndexOf('/') + 1);
		}
	}
	return "";
})();

OS.browser = (function() {
	var ua = navigator.userAgent.toLowerCase();
	return {
		VERSION: ua.match(/(msie|firefox|webkit|opera)[\/:\s](\d+)/) ? RegExp.$2 : '0',
		IE: (ua.indexOf('msie') > -1 && ua.indexOf('opera') == -1),
		GECKO: (ua.indexOf('gecko') > -1 && ua.indexOf('khtml') == -1),
		WEBKIT: (ua.indexOf('applewebkit') > -1),
		OPERA: (ua.indexOf('opera') > -1)
	};
})();

OS.g = {};

OS.plugin = {};

OS.$ = function(id, doc){
	var doc = doc || document;
	return doc.getElementById(id);
};

OS.$$ = function(name, doc){
	var doc = doc || document;
	return doc.createElement(name);
};

OS.event = {
	add : function(el, event, listener) {
		if (el.addEventListener){
			el.addEventListener(event, listener, false);
		} else if (el.attachEvent){
			el.attachEvent('on' + event, listener);
		}
	},
	remove : function(el, event, listener) {
		if (el.removeEventListener){
			el.removeEventListener(event, listener, false);
		} else if (el.detachEvent){
			el.detachEvent('on' + event, listener);
		}
	},
	input : function(el, func) {
		this.add(el, 'keyup', function(e) {
			if (!e.ctrlKey && !e.altKey && (e.keyCode < 16 || e.keyCode > 18) && e.keyCode != 116) {
				func(e);
				if (e.preventDefault) e.preventDefault();
				if (e.stopPropagation) e.stopPropagation();
				return false;
			}
		});
	},
	ctrl : function(el, key, func) {
		this.add(el, 'keydown', function(e) {
			if (e.ctrlKey && e.keyCode == key.toUpperCase().charCodeAt(0) && !e.shiftKey && !e.altKey) {
				func(e);
				if (e.preventDefault) e.preventDefault();
				if (e.stopPropagation) e.stopPropagation();
				return false;
			}
		});
	},
	ready : function(func, win, doc) {
		var win = win || window;
		var doc = doc || document;
		var loaded = false;
		var readyFunc = function() {
			if (loaded) return;
			loaded = true;
			func();
		};
		if (doc.addEventListener) {
			this.add(doc, "domcontentloaded", readyFunc);
		} else if (doc.attachEvent){
			this.add(doc, "readystatechange", function() {
				if (doc.readyState == "complete") readyFunc();
			});
			if ( doc.documentElement.doScroll && typeof win.frameElement === "undefined" ) {
				var ieReadyFunc = function() {
					if (loaded) return;
					try {
						doc.documentElement.doScroll("left");
					} catch(e) {
						window.setTimeout(ieReadyFunc, 0);
						return;
					}
					readyFunc();
				};
				ieReadyFunc();
			}
		}
		this.add(win, 'load', readyFunc);
	}
};

OS.each = function(obj, func) {
	for (var key in obj) {
		if (obj.hasOwnProperty(key)) func(key, obj[key]);
	}
};

OS.eachNode = function(node, func) {
	var walkNodes = function(parent) {
		if (OS.util.getNodeType(parent) != 1) return true;
		var n = parent.firstChild;
		while (n) {
			var next = n.nextSibling;
			if (!func(n)) return false;
			if (!walkNodes(n)) return false;
			n = next;
		}
		return true;
	};
	walkNodes(node);
};

OS.util = {
	getDocumentElement : function(doc) {
		doc = doc || document;
		return (doc.compatMode != "CSS1Compat") ? doc.body : doc.documentElement;
	},
	getDocumentHeight : function(doc) {
		var el = this.getDocumentElement(doc);
		return Math.max(el.scrollHeight, el.clientHeight);
	},
	getDocumentWidth : function(doc) {
		var el = this.getDocumentElement(doc);
		return Math.max(el.scrollWidth, el.clientWidth);
	},
	createTable : function(doc) {
		var table = OS.$$('table', doc);
		table.cellPadding = 0;
		table.cellSpacing = 0;
		table.border = 0;
		return {table: table, cell: table.insertRow(0).insertCell(0)};
	},
	loadStyle : function(path) {
		var link = OS.$$('link');
		link.setAttribute('type', 'text/css');
		link.setAttribute('rel', 'stylesheet');
		link.setAttribute('href', path);
		document.getElementsByTagName("head")[0].appendChild(link);
	},
	inArray : function(str, arr) {
		for (var i = 0; i < arr.length; i++) {if (str == arr[i]) return true;}
		return false;
	},
	trim : function(str) {
		return str.replace(/^\s+|\s+$/g, "");
	},
	getJsKey : function(key) {
		var arr = key.split('-');
		key = '';
		for (var i = 0, len = arr.length; i < len; i++) {
			key += (i > 0) ? arr[i].charAt(0).toUpperCase() + arr[i].substr(1) : arr[i];
		}
		return key;
	},
	arrayToHash : function(arr) {
		var hash = {};
		for (var i = 0, len = arr.length; i < len; i++) hash[arr[i]] = 1;
		return hash;
	},
	escape : function(html) {
		html = html.replace(/&/g, "&amp;");
		html = html.replace(/</g, "&lt;");
		html = html.replace(/>/g, "&gt;");
		html = html.replace(/\xA0/g, "&nbsp;");
		html = html.replace(/\x20/g, " ");
		return html;
	},
	getScrollPos : function() {
		var x, y;
		if (OS.browser.IE || OS.browser.OPERA) {
			var el = this.getDocumentElement();
			x = el.scrollLeft;
			y = el.scrollTop;
		} else {
			x = window.scrollX;
			y = window.scrollY;
		}
		return {x : x, y : y};
	},
	getElementPos : function(el) {
		var x = 0, y = 0;
		if (el.getBoundingClientRect) {
			var box = el.getBoundingClientRect();
			var el = this.getDocumentElement();
			var pos = this.getScrollPos();
			x = box.left + pos.x - el.clientLeft;
			y = box.top + pos.y - el.clientTop;
		} else {
            x = el.offsetLeft;
            y = el.offsetTop;
            var parent = el.offsetParent;
            while (parent) {
                x += parent.offsetLeft;
                y += parent.offsetTop;
                parent = parent.offsetParent;
            }
		}
		return {x : x, y : y};
	},
	getCoords : function(ev) {
		ev = ev || window.event;
		return {
			x : ev.clientX,
			y : ev.clientY
		};
	},
	setOpacity : function(el, opacity) {
		if (typeof el.style.opacity == "undefined") {
			el.style.filter = (opacity == 100) ? "" : "alpha(opacity=" + opacity + ")";
		} else {
			el.style.opacity = (opacity == 100) ? "" : "0." + opacity.toString();
		}
	},
	getIframeDoc : function(iframe) {
		return iframe.contentDocument || iframe.contentWindow.document;
	},
	rgbToHex : function(str) {
		function hex(s) {
			s = parseInt(s).toString(16);
			return s.length > 1 ? s : '0' + s;
		};
		return str.replace(/rgb\s*?\(\s*?(\d+)\s*?,\s*?(\d+)\s*?,\s*?(\d+)\s*?\)/ig,
			function($0, $1, $2, $3) {
				return '#' + hex($1) + hex($2) + hex($3);
			}
		);
	},
	hashToStr : function(hash) {
		var str = '';
		OS.each(hash, function(key, val) {
			str += key + ":'" + val + "',";
		});
		return str.length > 0 ? str.substr(0, str.length - 1) : '';
	},
	strToHash : function(str) {
		var hash = {};
		var re = /(\w+)\s*:\s*'([^']+)'/g;
		while (re.exec(str)) {
			hash[RegExp.$1] = RegExp.$2;
		}
		return hash;
	},
	createRange : function(doc) {
		return doc.createRange ? doc.createRange() : doc.body.createTextRange();
	},
	getNodeType : function(node) {
		//return (node.nodeType == 1 && OS.util.inArray(node.tagName.toLowerCase(), OS.setting.noEndTags)) ? 88 : node.nodeType;
		return 1;
	},
	getNodeTextLength : function(node) {
		var type = OS.util.getNodeType(node);
		if (type == 1) {
			var html = node.innerHTML;
			return html.replace(/<.*?>/ig, "").length;
		} else if (type == 3) {
			return node.nodeValue.length;
		}
	},
	getAttrValue : function(id, attr) {
	    OS.$(id).attributes[attr].nodeValue;
	}, 
	removeParent : function(parent) {
		if (parent.hasChildNodes) {
			var node = parent.firstChild;
			while (node) {
				var nextNode = node.nextSibling;
				parent.parentNode.insertBefore(node, parent);
				node = nextNode;
			}
		}
		parent.parentNode.removeChild(parent);
	},
	drag : function(id, mousedownObj, moveObj, func) {
		var g = OS.g[id];
		mousedownObj.onmousedown = function(e) {
			e = e || window.event;
			if (e.preventDefault) e.preventDefault();
			if (e.stopPropagation) e.stopPropagation();
			var pos = OS.util.getCoords(e);
			var objTop = parseInt(moveObj.style.top);
			var objLeft = parseInt(moveObj.style.left);
			var objWidth = moveObj.style.width;
			var objHeight = moveObj.style.height;
			if (objWidth.match(/%$/)) objWidth = moveObj.offsetWidth + 'px';
			if (objHeight.match(/%$/)) objHeight = moveObj.offsetHeight + 'px';
			objWidth = parseInt(objWidth);
			objHeight = parseInt(objHeight);
			var mouseTop = pos.y;
			var mouseLeft = pos.x;
			var dragFlag = true;
			var moveListener = function(e) {
				if (dragFlag) {
					var pos = OS.util.getCoords(e);
					var top = pos.y - mouseTop;
					var left = pos.x - mouseLeft;
					func(objTop, objLeft, objWidth, objHeight, top, left);
				}
			};
			var upListener = function(e) {
				dragFlag = false;
				OS.event.remove(document, 'mousemove', moveListener);
				OS.event.remove(document, 'mouseup', upListener);
			};
			OS.event.add(document, 'mousemove', moveListener);
			OS.event.add(document, 'mouseup', upListener);
		};
	},
	hideLoadingPage : function(id) {
		var stack = OS.g[id].dialogStack;
		var dialog = stack[stack.length - 1];
		dialog.loading.style.display = 'none';
		dialog.iframe.style.display = '';
	},
	showLoadingPage : function(id) {
		var stack = OS.g[id].dialogStack;
		var dialog = stack[stack.length - 1];
		dialog.loading.style.display = '';
		dialog.iframe.style.display = 'none';
	},
	randomChar : function (l) {
        var x = "0123456789qwertyuioplkjhgfdsazxcvbnm";
        var tmp = "";
        
        for(var i = 0;i < l; i++) {
            tmp += x.charAt(Math.ceil(Math.random()*100000000) % x.length);
        }
        
        return tmp;
    },
    showMenu : function (baseID, divID) {
        baseID = OS.$(baseID);
        divID  = OS.$(divID);
        
        if (OS.util.showMenu.timer) clearTimeout(OS.util.showMenu.timer);
	    hideCur();
        divID.style.display = 'block';
        if(OS.$("indexProjectsList")) {
            OS.util.setOpacity(OS.$("indexProjectsList"), 30);
        }
	    OS.util.showMenu.cur = divID;

        if (!divID.isCreate) {
            divID.isCreate = true;
            divID.onmouseover = function () {
                if (OS.util.showMenu.timer) clearTimeout(OS.util.showMenu.timer);
			    hideCur();
                divID.style.display = 'block';
                if(OS.$("indexProjectsList")) {
                    OS.util.setOpacity(OS.$("indexProjectsList"), 30);
                }
            };

            function hide () {
                OS.util.showMenu.timer = setTimeout(function () {
                    divID.style.display = 'none'; 
                    if(OS.$("indexProjectsList")) {
                        OS.util.setOpacity(OS.$("indexProjectsList"), 90);
                    }
                }, 1000);
            }

            divID.onmouseout = hide;
            baseID.onmouseout = hide;
        }
        
	    function hideCur () {
		    OS.util.showMenu.cur && (OS.util.showMenu.cur.style.display = 'none');
            if(OS.$("indexProjectsList")) {
                OS.util.setOpacity(OS.$("indexProjectsList"), 90);
            }
	    }
    }
};

OS.dialog = function(arg){
	this.widthMargin = 24;
	this.heightMargin = 50;
	this.zIndex = 20100122;
	this.getPos = function() {
		var id = arg.id;
		var el = OS.util.getDocumentElement();
		var scrollPos = OS.util.getScrollPos();
		var width = arg.width + this.widthMargin;
		var height = arg.height + this.heightMargin;
		var x = Math.round(scrollPos.x + (el.clientWidth - width) / 2);
		var y = Math.round(scrollPos.y + (el.clientHeight - height) / 2);
		x = x < 0 ? 0 : x;
		y = y < 0 ? 0 : y;
		return {x : x, y : y};
	};
	this.hide = function() {
		if (arg.beforeHide) arg.beforeHide();
		var id = arg.id;
		var stack = OS.g[id].dialogStack;
		if (stack[stack.length - 1] != this) return;
		stack.pop();
		OS.g[id].hideDiv.removeChild(this.div);
		if (stack.length < 1) {
			OS.g[id].hideDiv.style.display = 'none';
			OS.g[id].maskDiv.style.display = 'none';
		}
		if (arg.afterHide) arg.afterHide();
	};
	this.show = function() {
		if (arg.beforeShow) arg.beforeShow();
		var self = this;
		var id = arg.id;
		var div = OS.$$('div');
		div.className = 'os-dialog';
		var stack = OS.g[id].dialogStack;
		if (stack.length > 0) {
			this.zIndex = stack[stack.length - 1].zIndex + 1;
		}
		div.style.zIndex = this.zIndex;
		var pos = this.getPos();
		div.style.width = (arg.width + this.widthMargin) + 'px';
		div.style.height = (arg.height + this.heightMargin) + 'px';
		div.style.top = pos.y + 'px';
		div.style.left = pos.x + 'px';
		var titleDiv = OS.$$('div');
		titleDiv.className = 'os-dialog-title';
		var title_html = "<table cellpadding='0' cellspacing='0'><tr><td class='os-dialog-top-left'></td><td class='os-dialog-top-middle' style=\"width:" + (arg.width + 10) + "px\">";
		if(arg.icon) {
		    title_html += "<div style=\"background:url('" + arg.icon + "') no-repeat;background-position: 0px 10px;padding-left:20px; padding-top:4px\">";
		    title_html += arg.title;
		    title_html += "</div>";
		}else{
		    title_html += arg.title;
		}
		title_html += "</td><td class='os-dialog-top-right'></td></tr></table>";
		titleDiv.innerHTML = title_html;
		OS.event.add(titleDiv, "selectstart", function(){return false;});
		var span = OS.$$('span');
		span.className = "os-toolbar-close";
		span.alt = OS.lang['close'];
		span.title = OS.lang['close'];
		span.onclick = function () { self.hide(); };
		titleDiv.appendChild(span);
		OS.util.drag(id, titleDiv, div, function(objTop, objLeft, objWidth, objHeight, top, left) {
			div.style.top = (objTop + top) + 'px';
			div.style.left = (objLeft + left) + 'px';
		});
		div.appendChild(titleDiv);
		
		var bodyContainerDiv = OS.$$('div');
		bodyContainerDiv.className = 'os-dialog-body-container';		
		var bodyDiv = OS.$$('div');
		bodyDiv.className = 'os-dialog-body';
		var loadingTable = OS.util.createTable();
		loadingTable.table.className = 'os-loading-table';
		loadingTable.table.style.width = arg.width + 'px';
		loadingTable.table.style.height = arg.height + 'px';
		loadingTable.cell.align = 'center';
		loadingTable.cell.vAlign = 'middle';
		var loadingImg = OS.$$('span');
		loadingImg.className = 'os-loading-img';
		loadingTable.cell.appendChild(loadingImg);
		var iframe = OS.$$('iframe');
		if (arg.useFrameCSS) {
			iframe.className = 'os-dialog-iframe';
		}
		iframe.width = arg.width + 'px';
		iframe.height = arg.height + 'px';
		iframe.setAttribute("frameBorder", "0");
		iframe.style.display = 'none';
		bodyDiv.appendChild(iframe);
		bodyDiv.appendChild(loadingTable.table);
		bodyContainerDiv.appendChild(bodyDiv);
		div.appendChild(bodyContainerDiv);

		OS.g[id].hideDiv.style.display = '';
		OS.g[id].hideDiv.appendChild(div);
		window.focus();
		iframe.src = arg.file;
		OS.g[id].maskDiv.style.width = OS.util.getDocumentWidth() + 'px';
		OS.g[id].maskDiv.style.height = OS.util.getDocumentHeight() + 'px';
		OS.g[id].maskDiv.style.display = 'block';
		this.iframe = iframe;
		this.loading = loadingTable.table;
		this.div = div;
		OS.g[id].dialogStack.push(this);
		OS.g[id].dialog = iframe;
		if (!arg.loadingMode) OS.util.hideLoadingPage(id);
		if (arg.afterShow) arg.afterShow();
	};
};

OS.create = function(id, mode) {
	if (OS.g[id].beforeCreate) OS.g[id].beforeCreate();
	if (OS.browser.IE && OS.browser.VERSION < 7) try { document.execCommand('BackgroundImageCache', false, true); }catch(e){}
	var hideDiv = OS.$$('div');
	hideDiv.style.display = 'none';
	var maskDiv = OS.$$('div');
	maskDiv.className = 'os-mask';
	OS.util.setOpacity(maskDiv, 50);
	document.body.appendChild(hideDiv);
	document.body.appendChild(maskDiv);
	OS.g[id].hideDiv = hideDiv;
	OS.g[id].maskDiv = maskDiv;
};

OS.init = function(args) {
	var g = OS.g[args.id] = args;
	g.dialogStack = [];
	if (g.loadStyleMode) OS.util.loadStyle(g.cssPath);
	
	OS.event.ready(function() { OS.create(args.id); });
}

OS.plugin['terms'] = {
	click : function(id) {
		var dialog = new OS.dialog({
			id : id,
			file : 'Terms.aspx?id=' + id + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
			width : 480,
			height : 480,
			loadingMode : true,
			title : OS.lang['terms'],
			icon : './img/terms.gif'
		});
		dialog.show();
	}
};

OS.plugin['register'] = {
	click : function(id) {
		var dialog = new OS.dialog({
			id : id,
			file : 'CustomerMng.aspx?id=' + id + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
			width : 460,
			height : 530,
			loadingMode : true,
			title : OS.lang['register'],
			icon : './img/icon_reg.gif'
		});
		dialog.show();
	}
};

OS.plugin['login'] = {
	click : function(id) {
		var dialog = new OS.dialog({
			id : id,
			file : 'Login.aspx?id=' + id + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
			width : 335,
			height : 180,
			loadingMode : true,
			title : OS.lang['login'],
			icon : './img/about_us_marker.gif'			
		});
		dialog.show();
	}
};

OS.plugin['retrievepwd'] = {
	dialog : new OS.dialog({
		id : 'OS',
		file : 'RetrievePWD.aspx?id=OS&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
		width : 340,
		height : 48,
		loadingMode : true,
		title : OS.lang['retrievepwd'],
		icon : './img/retrieve_pwd.gif'			
	}),
	click : function(id) {
		this.dialog.show();
	},
	hide : function() {
	    this.dialog.hide();
	}
};

OS.plugin['changepwd'] = {
	dialog : new OS.dialog({
		id : 'OS',
		file : 'ChangePWD.aspx?id=OS&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
		width : 240,
		height : 180,
		loadingMode : true,
		title : OS.lang['retrievepwd'],
		icon : './img/retrieve_pwd.gif'			
	}),
	show : function(id) {
		this.dialog.show();
	},
	hide : function() {
	    this.dialog.hide();
	}
};

OS.plugin['newcustpin'] = {
	click : function(id) {
		var dialog = new OS.dialog({
			id : id,
			file : 'NewCustPin.aspx?id=' + id + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
			width : 360,
			height : 320,
			loadingMode : true,
			title : OS.lang['newcustpin'],
			icon : './img/pin.gif',
            afterHide : function() {
                location.href = "Logout.aspx";
            }		
		});
		dialog.show();
	}
};

OS.plugin['uploadfaceicon'] = {
	click : function(id) {
		var dialog = new OS.dialog({
			id : id,
			file : 'UploadFaceIcon.aspx?id=' + id + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
			width : 320,
			height : 420,
			loadingMode : true,
			title : OS.lang['uploadfaceicon'],
			icon : './img/pin.gif'
		});
		dialog.show();
	}
};

OS.plugin['nriccert'] = {
	click : function(id) {
		var dialog = new OS.dialog({
			id : id,
			file : 'NRICCert.aspx?id=' + id + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
			width : 350,
			height : 250,
			loadingMode : true,
			title : OS.lang['nriccert'],
			icon : './img/pin.gif'
		});
		dialog.show();
	}
};

OS.plugin['selProjCategory'] = {
    id : "",
    existed_category : "",
    dialog : null,
	show : function(id, existed_category, mgr) {
	    this.id = id;
	    this.existed_category = existed_category;
	    
	    if(mgr) {
	        this.dialog = new OS.dialog({
		        id : this.id,
		        file : '../SelProjectCategory.aspx?id=' + this.id + '&ec=' + this.existed_category + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
		        width : 774,
		        height : 500,
		        loadingMode : true,
		        title : OS.lang['selProjCategory'],
		        icon : './img/icon_projcat.gif'
	        });
	    } else {
	        this.dialog = new OS.dialog({
		        id : this.id,
		        file : 'SelProjectCategory.aspx?id=' + this.id + '&ec=' + this.existed_category + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
		        width : 774,
		        height : 500,
		        loadingMode : true,
		        title : OS.lang['selProjCategory'],
		        icon : './img/icon_projcat.gif'
	        });
	    }
    	
		this.dialog.show();
	},
	hide : function() {
	    this.dialog.hide();
	}
};

OS.plugin['changeProjPaymentType'] = {
    id : "",
    pc : "",
    dialog : null,
	show : function(id, pc, mgr) {
	    this.id = id;
	    this.pc = pc;
	    
	    this.dialog = new OS.dialog({
		    id : this.id,
		    file : 'ChangeProjectPaymentType.aspx?id=' + this.id + '&PC=' + this.pc + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
		    width : 660,
		    height : 120,
		    loadingMode : true,
		    title : OS.lang['changeProjPaymentType'],
		    icon : './img/icon_changprojpaymenttype.gif'
	    });
    	
		this.dialog.show();
	},
	hide : function() {
	    this.dialog.hide();
	}
};

OS.plugin['projPaymentMng'] = {
    id : "",
    pc : "",
    step : "",
    dialog : null,
	show : function(id, pc, step) {
	    this.id = id;
	    this.pc = pc;
	    this.step = step;
	    
	    this.dialog = new OS.dialog({
		    id : this.id,
		    file : 'ProjectPaymentItemMng.aspx?id=' + this.id + '&PC=' + this.pc + '&Step=' + escape(this.step) + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
		    width : 485,
		    height : 320,
		    loadingMode : true,
		    title : OS.lang['projPaymentMng'],
		    icon : './img/pin.gif'
	    })
    	
		this.dialog.show();
	},
	hide : function() {
	    this.dialog.hide();
	}
};

OS.plugin['postABid'] = {
    id : "",
    pc : "",
    dialog : null,
	show : function(id, pc) {
	    this.id = id;
	    this.pc = pc;
	    
	    this.dialog = new OS.dialog({
		    id : this.id,
		    file : 'SubmitABid.aspx?id=' + this.id + '&PC=' + this.pc + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
		    width : 530,
		    height : 580,
		    loadingMode : true,
		    title : OS.lang['postABid'],
		    icon : './img/pin.gif'
	    })
    	
		this.dialog.show();
	},
	hide : function() {
	    this.dialog.hide();
	}
};

OS.plugin['projectBoard'] = {
    id : "",
    pc : "",
    author : "",
    dialog : null,
	show : function(id, pc, author) {
	    this.id = id;
	    this.pc = pc;
	    if(author) this.author = author;
	    
	    this.dialog = new OS.dialog({
		    id : this.id,
		    file : 'ProjectBoard.aspx?id=' + this.id + '&PC=' + this.pc + '&A=' + this.author + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
		    width : 530,
		    height : 530,
		    loadingMode : true,
		    title : OS.lang['projectBoard'],
		    icon : './img/pin.gif'
	    })
    	
		this.dialog.show();
	},
	hide : function() {
	    this.dialog.hide();
	}
};

OS.plugin['projectComplain'] = {
    id : "",
    pc : "",
    dialog : null,
	show : function(id, pc) {
	    this.id = id;
	    this.pc = pc;
	    
	    this.dialog = new OS.dialog({
		    id : this.id,
		    file : 'ProjectComplain.aspx?id=' + this.id + '&PC=' + this.pc + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
		    width : 530,
		    height : 410,
		    loadingMode : true,
		    title : OS.lang['projectComplain'],
		    icon : './img/pin.gif'
	    })
    	
		this.dialog.show();
	},
	hide : function() {
	    this.dialog.hide();
	}
};

OS.plugin['selectWinners'] = {
    id : "",
    pc : "",
    dialog : null,
	show : function(id, pc) {
	    this.id = id;
	    this.pc = pc;
	    
	    this.dialog = new OS.dialog({
		    id : this.id,
		    file : 'SelectWinners.aspx?id=' + this.id + '&PC=' + this.pc + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
		    width : 530,
		    height : 480,
		    loadingMode : true,
		    title : OS.lang['selectWinners'],
		    icon : './img/pin.gif'
	    })
    	
		this.dialog.show();
	},
	hide : function() {
	    this.dialog.hide();
	}
};

OS.plugin['ybProject'] = {
    id : "",
    pc : "",
    dialog : null,
	show : function(id, pc) {
	    this.id = id;
	    this.pc = pc;
	    
	    this.dialog = new OS.dialog({
		    id : this.id,
		    file : 'YBProject.aspx?id=' + this.id + '&PC=' + this.pc + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
		    width : 530,
		    height : 480,
		    loadingMode : true,
		    title : OS.lang['ybProject'],
		    icon : './img/pin.gif'
	    })
    	
		this.dialog.show();
	},
	hide : function() {
	    this.dialog.hide();
	}
};

OS.plugin['wgProject'] = {
    id : "",
    pc : "",
    dialog : null,
	show : function(id, pc) {
	    this.id = id;
	    this.pc = pc;
	    
	    this.dialog = new OS.dialog({
		    id : this.id,
		    file : 'CompleteProject.aspx?id=' + this.id + '&PC=' + this.pc + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
		    width : 570,
		    height : 420,
		    loadingMode : true,
		    title : OS.lang['wgProject'],
		    icon : './img/pin.gif'
	    })
    	
		this.dialog.show();
	},
	hide : function() {
	    this.dialog.hide();
	}
};

OS.plugin['pjProject'] = {
    id : "",
    pc : "",
    dialog : null,
	show : function(id, pc) {
	    this.id = id;
	    this.pc = pc;
	    
	    this.dialog = new OS.dialog({
		    id : this.id,
		    file : 'PJBuyer.aspx?id=' + this.id + '&PC=' + this.pc + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
		    width : 570,
		    height : 420,
		    loadingMode : true,
		    title : OS.lang['pjProject'],
		    icon : './img/pin.gif'
	    })
    	
		this.dialog.show();
	},
	hide : function() {
	    this.dialog.hide();
	}
};

OS.plugin['closeProject'] = {
    id : "",
    pc : "",
    dialog : null,
	show : function(id, pc) {
	    this.id = id;
	    this.pc = pc;
	    
	    this.dialog = new OS.dialog({
		    id : this.id,
		    file : 'CloseProject.aspx?id=' + this.id + '&PC=' + this.pc + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
		    width : 520,
		    height : 360,
		    loadingMode : true,
		    title : OS.lang['closeProject'],
		    icon : './img/pin.gif'
	    })
    	
		this.dialog.show();
	},
	hide : function() {
	    this.dialog.hide();
	}
};

OS.plugin['closedReason'] = {
    id : "",
    pc : "",
    dialog : null,
	show : function(id, pc) {
	    this.id = id;
	    this.pc = pc;
	    
	    this.dialog = new OS.dialog({
		    id : this.id,
		    file : 'ShowClosedReason.aspx?id=' + this.id + '&PC=' + this.pc + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
		    width : 520,
		    height : 360,
		    loadingMode : true,
		    title : OS.lang['closedReason'],
		    icon : './img/pin.gif'
	    })
    	
		this.dialog.show();
	},
	hide : function() {
	    this.dialog.hide();
	}
};

OS.plugin['commonDialog'] = {
    id : "",
    label : "",
    title : "信息错误",
    width : 400,
    height : 280,
    icon : './img/pin.gif',
    dialog : null,
	show : function(id, label, title, width, height, icon, mng) {
	    this.id = id;
	    this.label = label;
	    if('' != title) this.title = title; else this.title = "信息错误";
	    if(0 < width) this.width = width; else this.width = 400;
	    if(0 < height) this.height = height; else this.height = 280;
	    if('' != icon) this.icon = icon; else this.icon = './img/pin.gif';
	    var path = 'ShowHelpTip.aspx?id=' + this.id + '&L=' + this.label + '&w=' + this.width + '&h=' + this.height + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8);
	    if(mng) {
	        path = '../ShowHelpTip.aspx?id=' + this.id + '&L=' + this.label + '&w=' + this.width + '&h=' + this.height + '&ver=' + OS.version + "&MNG=T&sessionno=" + OS.util.randomChar(8);
	        this.icon = "../" + this.icon;
	    }
	    
	    this.dialog = new OS.dialog({
		    id : this.id,
		    file : path,
		    width : this.width,
		    height : this.height,
		    loadingMode : true,
		    title : this.title,
		    icon : this.icon
	    })
    	
		this.dialog.show();
	},
	hide : function() {
	    this.dialog.hide();
	}
};

OS.plugin['billingLog'] = {
    id : "",
    bid : 0,
    dialog : null,
	show : function(id, bid) {
	    this.id = id;
	    this.bid = bid;
	    
	    this.dialog = new OS.dialog({
		    id : this.id,
		    file : 'OShowMyBillingLog.aspx?id=' + this.id + '&BID=' + this.bid + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
		    width : 520,
		    height : 360,
		    loadingMode : true,
		    title : OS.lang['billingLog'],
		    icon : './img/pin.gif'
	    })
    	
		this.dialog.show();
	},
	hide : function() {
	    this.dialog.hide();
	}
};

OS.plugin['withdrawLog'] = {
    id : "",
    bid : 0,
    dialog : null,
	show : function(id, wid) {
	    this.id = id;
	    this.wid = wid;
	    
	    this.dialog = new OS.dialog({
		    id : this.id,
		    file : 'OShowWithdrawLog.aspx?id=' + this.id + '&WID=' + this.wid + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
		    width : 520,
		    height : 360,
		    loadingMode : true,
		    title : OS.lang['withdrawLog'],
		    icon : './img/pin.gif'
	    })
    	
		this.dialog.show();
	},
	hide : function() {
	    this.dialog.hide();
	}
};

OS.plugin['paymentLog'] = {
    id : "",
    pid : 0,
    dialog : null,
	show : function(id, pid) {
	    this.id = id;
	    this.pid = pid;
	    
	    this.dialog = new OS.dialog({
		    id : this.id,
		    file : 'OShowCashHistLog.aspx?id=' + this.id + '&PID=' + this.pid + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
		    width : 520,
		    height : 360,
		    loadingMode : true,
		    title : OS.lang['paymentLog'],
		    icon : './img/pin.gif'
	    })
    	
		this.dialog.show();
	},
	hide : function() {
	    this.dialog.hide();
	}
};

OS.plugin['cnLog'] = {
    id : "",
    cnid : 0,
    dialog : null,
	show : function(id, cnid) {
	    this.id = id;
	    this.cnid = cnid;
	    
	    this.dialog = new OS.dialog({
		    id : this.id,
		    file : 'OShowContactNumberHistLog.aspx?id=' + this.id + '&CNID=' + this.cnid + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
		    width : 520,
		    height : 360,
		    loadingMode : true,
		    title : OS.lang['cnLog'],
		    icon : './img/pin.gif'
	    })
    	
		this.dialog.show();
	},
	hide : function() {
	    this.dialog.hide();
	}
};

OS.plugin['pfLog'] = {
    id : "",
    pfid : 0,
    dialog : null,
	show : function(id, pfid) {
	    this.id = id;
	    this.pfid = pfid;
	    
	    this.dialog = new OS.dialog({
		    id : this.id,
		    file : 'OShowCashFrozenHistLog.aspx?id=' + this.id + '&PFID=' + this.pfid + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
		    width : 520,
		    height : 360,
		    loadingMode : true,
		    title : OS.lang['pfLog'],
		    icon : './img/pin.gif'
	    })
    	
		this.dialog.show();
	},
	hide : function() {
	    this.dialog.hide();
	}
};

OS.plugin['disputeLog'] = {
    id : "",
    did : 0,
    dialog : null,
	show : function(id, did) {
	    this.id = id;
	    this.did = did;
	    
	    this.dialog = new OS.dialog({
		    id : this.id,
		    file : 'OShowDisputeLog.aspx?id=' + this.id + '&DID=' + this.did + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
		    width : 520,
		    height : 360,
		    loadingMode : true,
		    title : OS.lang['disputeLog'],
		    icon : './img/pin.gif'
	    })
    	
		this.dialog.show();
	},
	hide : function() {
	    this.dialog.hide();
	}
};

OS.plugin['throwADispute'] = {
    id : "",
    pid : 0,
    dialog : null,
	show : function(id, pid) {
	    this.id = id;
	    this.pid = pid;
	    
	    this.dialog = new OS.dialog({
		    id : this.id,
		    file : 'OThrowADispute.aspx?id=' + this.id + '&PID=' + this.pid + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
		    width : 520,
		    height : 360,
		    loadingMode : true,
		    title : OS.lang['throwADispute'],
		    icon : './img/pin.gif'
	    })
    	
		this.dialog.show();
	},
	hide : function() {
	    this.dialog.hide();
	}
};

OS.plugin['showDisputeBoard'] = {
    id : "",
    pid : 0,
    dialog : null,
	show : function(id, pid) {
	    this.id = id;
	    this.pid = pid;
	    
	    this.dialog = new OS.dialog({
		    id : this.id,
		    file : 'ODisputeBoard.aspx?id=' + this.id + '&PID=' + this.pid + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
		    width : 520,
		    height : 480,
		    loadingMode : true,
		    title : OS.lang['showDisputeBoard'],
		    icon : './img/pin.gif'
	    })
    	
		this.dialog.show();
	},
	hide : function() {
	    this.dialog.hide();
	}
};

OS.plugin['ProvideJob'] = {
    id : "",
    dialog : null,
	show : function(id) {
	    this.id = id;
	    
	    this.dialog = new OS.dialog({
		    id : this.id,
		    file : 'Recruitment.aspx?id=' + this.id + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
		    width : 520,
		    height : 480,
		    loadingMode : true,
		    title : "招聘登记 - 软件项目外包网",
		    icon : './img/pin.gif'
	    })
    	
		this.dialog.show();
	},
	hide : function() {
	    this.dialog.hide();
	}
};

OS.plugin['FindJob'] = {
    id : "",
    dialog : null,
	show : function(id) {
	    this.id = id;
	    
	    this.dialog = new OS.dialog({
		    id : this.id,
		    file : 'Resume.aspx?id=' + this.id + '&ver=' + OS.version + "&sessionno=" + OS.util.randomChar(8),
		    width : 520,
		    height : 480,
		    loadingMode : true,
		    title : "提交简历 - 软件项目外包网",
		    icon : './img/pin.gif'
	    })
    	
		this.dialog.show();
	},
	hide : function() {
	    this.dialog.hide();
	}
};