if (typeof PROXYPREFIX == 'undefined'){
	var PROXYPREFIX = '';
} var USERAGENT = navigator.userAgent.toLowerCase(), WSBase = {
	Browser : {
		IE : window.ActiveXObject && USERAGENT.indexOf('msie') != -1 ? true : false, 
		FF : USERAGENT.indexOf('firefox') == -1 ? false : true
	}, _conf : {
		masker : 'id_masker', 
		photos : 'id_photos'
	}, _func : {
		isobj : function(id){
			if (typeof id == 'object'){
				return id;
			} return document.getElementById(id) ? document.getElementById(id) : false
		}, sizer : function(o){
			var P = {W : Math.max(document.body.clientWidth, document.documentElement.clientWidth), H : Math.max(document.body.clientHeight, document.documentElement.clientHeight), S : Math.max(document.body.scrollTop, document.documentElement.scrollTop), w : 0, h : 0, x : 0, y : 0}, obj = WSBase._func.isobj(o); if (obj) {
				P.y = obj.offsetTop;
				P.x = obj.offsetLeft;
				P.w = obj.offsetWidth; 
				P.h = obj.offsetHeight;
				while ((obj = obj.offsetParent) != null){
					P.y += obj.offsetTop;
					P.x += obj.offsetLeft;
				} 
			} return P;
		}
	}, AJAX : {
		OPEN : function(o){
			var request = false; if (window.XMLHttpRequest) {
				request = new XMLHttpRequest(); if (request.overrideMimeType){
					request.overrideMimeType('text/xml');
				}
			} else if(window.ActiveXObject) {
				var versions = ['Microsoft.XMLHTTP', 'MSXML.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.7.0', 'Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.5.0', 'Msxml2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP']; for (var i = 0; i < versions.length; i++){
					try {
						request = new ActiveXObject(versions[i]); if (request){
							break;
						}
					} catch(err) {}
				}
			} if (request){
				request.open('POST', o.url.replace(/\&amp;/ig, '&'));
				request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
				request.send('in_ajax_submit=1');
				request.onreadystatechange = function(){
					if (request.readyState == 4){
						if (request.status == 200){
							var results = request.responseText;
							var sourcetype = results.substr(0, 5).toLowerCase(); if (sourcetype == '<?xml'){
								results = request.responseXML.lastChild.firstChild.nodeValue;
							} if (o.call){
								o.call(o, {
									   	txt : results
									}
								);
							} else {
								WSBase.AJAX.INNS(o, {
									   	txt : results
									}
								);
							}
						}
					}
				}
			}
		}, INNS : function(o, abj){
			var obj = WSBase._func.isobj(o.id ? o.id : 'merchant'); if (obj){
				obj.innerHTML = abj.txt;
			}
		}
	}, DIALOG : {
		Masker : {
			on : function(){
				var obj = WSBase._func.isobj(WSBase._conf.masker); if (obj){
					var P = WSBase._func.sizer(); obj.style.top = obj.style.left = '0px'; obj.style.width = P.W + 'px'; obj.style.height = P.H + 'px'; obj.style.display = '';
				}
			}, off : function(){
				var obj = WSBase._func.isobj(WSBase._conf.masker); if (obj && obj.style.display != 'none'){
					obj.style.display = 'none';
				}
			}
		}
	}, PHOTO : function(s, f){
		var obj = WSBase._func.isobj(WSBase._conf.photos); if (obj){
			if (f){
				WSBase.DIALOG.Masker.off();
				obj.style.width = obj.style.height = obj.innerHTML = null;
				obj.style.display = 'none';
				return false;
			} WSBase.DIALOG.Masker.on();
			var TXT = '';
			TXT += '<div class="h">';
				TXT += '查看图片';
				TXT += '<a href="#" onclick="WSBase.PHOTO(false, true); return false">X</a>';
			TXT += '</div>';
			TXT += '<div class="c"><img src="' + s + '" alt="" border="0" /></div>';
			obj.innerHTML = TXT; obj.style.display = ''; 
			var P = WSBase._func.sizer(obj); obj.style.left = parseInt((P.W - P.w) / 2) + 'px'; obj.style.top = (P.S + 120) + 'px';
		} return false;
	}
}, AJAX = function(o){
	if (o.url){
		if (typeof PROXYPREFIX != 'undefined'){
			var prex = o.url.substr(0, 7); if (prex != 'http://'){
				o.url = PROXYPREFIX + o.url;
			}
		} WSBase.AJAX.OPEN(o)
	} return false;
}, COLLAPSED = function(id){
	var obj = WSBase._func.isobj(id); if (obj){
		obj.style.display = obj.style.display == 'none' ? '' : 'none';
	}
}, REDIRECT = function(url){
	var url = url ? url : window.location.href; 
	window.location.href = url.replace(/\&amp;/ig, '&');
};
