/*********************AjaxNet.js ***************************/  


/* namespacing object */
var net = new Object();
net.READY_STATE_UNINITIALIZED = 0;
net.READY_STATE_LOADING = 1;
net.READY_STATE_LOADED = 2;
net.READY_STATE_INTERACTIVE = 3;
net.READY_STATE_COMPLETE = 4;
/*--- content loader object for cross-browser requests ---*/
net.ContentLoader = function (url, on_load, on_error, method, params, contentType) {
	this.req = null;
	this.on_load = on_load;
	this.on_error = (on_error) ? on_error : this.defaultError;
	this.loadXMLDoc(url, method, params, contentType);
};
net.ContentLoader.prototype.loadXMLDoc = function (url, method, params, contentType) {
	if (!method) {
		method = "GET";
	}
	if (!contentType && method == "POST") {
		contentType = "application/x-www-form-urlencoded";
	}
	if (window.XMLHttpRequest) {
		this.req = new XMLHttpRequest();
	} else {
		if (window.ActiveXObject) {
   //add try catch;
			try {
				this.req = new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch (e1) {
				try {
					this.req = new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (e2) {
				}
			}
     //
 //this.req=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	if (this.req) {
		try {
			var loader = this;
			this.req.onreadystatechange = function () {
				net.ContentLoader.onReadyState.call(loader);
			};
			this.req.open(method, url, true);
			if (contentType) {
				this.req.setRequestHeader("Content-Type", contentType);
			}
			this.req.send(params);
		}
		catch (err) {
			this.on_error.call(this);
		}
	}
};
net.ContentLoader.onReadyState = function () {
	var req = this.req;
	var ready = req.readyState;
	if (ready == net.READY_STATE_COMPLETE) {
		var httpStatus = req.status;
		if (httpStatus == 200 || httpStatus == 0) {
			this.on_load.call(this);
		} else {
			this.on_error.call(this);
		}
	}
};
net.ContentLoader.prototype.defaultError = function () {
	//alert("error fetching data!" + "\n\nreadyState:" + this.req.readyState + "\nstatus: " + this.req.status + "\nheaders: " + this.req.getAllResponseHeaders());
};




/*********************Appraise.js ***************************/

//appraise  
var lineID = 0;  
function subformScore() {
	var gtext = this.req.responseText;
	var lijianCount="0",tuijianCount="0",haixingCount="0",jiaochaCount="0",henchaCount="0";
    if (typeof(fundAppraiseCount) != "undefined"){
		for(var i=0;i<fundAppraiseCount.length;i++){
		    if(fundAppraiseCount[i][0]==10){
		        lijianCount = fundAppraiseCount[i][1];
		    }
		    if(fundAppraiseCount[i][0]==8){
		        tuijianCount = fundAppraiseCount[i][1];
		    }
		    if(fundAppraiseCount[i][0]==5){
		        haixingCount = fundAppraiseCount[i][1];
		    }
		    if(fundAppraiseCount[i][0]==2){
		        jiaochaCount = fundAppraiseCount[i][1];
		    }
		    if(fundAppraiseCount[i][0]==0){
		        henchaCount = fundAppraiseCount[i][1];
		    }
		}
    }
	var appraise = document.getElementById("appraise");
	var addAppraise = document.getElementById("addAppraise");
	if (gtext.indexOf("ok") != -1) {
		var lijian = "<span class=\"cDblue\"><a href=\"javascript:onlineBoolean(this);ScoreShow(10,1);\">\u529b\u8350</a></span>("+lijianCount+") ";
        var tuijian = "<span class=\"cDblue\"><a href=\"javascript:onlineBoolean(this);ScoreShow(8,2);\">\u63a8\u8350</a></span>("+tuijianCount+") ";
        var haixing = "<span class=\"cDblue\"><a href=\"javascript:onlineBoolean(this);ScoreShow(5,3);\">\u8fd8\u884c</a></span>("+haixingCount+") ";
        var jiaocha = "<span class=\"cDblue\"><a href=\"javascript:onlineBoolean(this);ScoreShow(2,4);\">\u8f83\u5dee</a></span>("+jiaochaCount+") ";
        var hencha = "<span class=\"cDblue\"><a href=\"javascript:onlineBoolean(this);ScoreShow(0,5);\">\u5f88\u5dee</a></span>("+henchaCount+") ";
        if (lineID == 1) {
            appraise.innerHTML = "\u529b\u8350("+lijianCount+")&nbsp;" + tuijian + haixing + jiaocha + hencha;
            addAppraise.innerHTML='你评价此基金为"力荐"';
        }
        if (lineID == 2) {
            appraise.innerHTML = lijian + "\u63a8\u8350("+tuijianCount+")&nbsp;" + haixing + jiaocha + hencha;
            addAppraise.innerHTML='你评价此基金为"推荐"';
        }
        if (lineID == 3) {
            appraise.innerHTML = lijian + tuijian + "\u8fd8\u884c("+haixingCount+")&nbsp;" + jiaocha + hencha;
            addAppraise.innerHTML='你评价此基金为"还行"';
        }
        if (lineID == 4) {
            appraise.innerHTML = lijian + tuijian + haixing + "\u8f83\u5dee("+jiaochaCount+")&nbsp;" + hencha;
            addAppraise.innerHTML='你评价此基金为"较差"';
        }
        if (lineID == 5) {
            appraise.innerHTML = lijian + tuijian + haixing + jiaocha + "\u5f88\u5dee("+henchaCount+")";
            addAppraise.innerHTML='你评价此基金为"很差"';
        }
        
	} else {
		
	}
}

function validataScore(Obj) {
	var url =uu.urlUtil.encode("/interact/score/score.uu?Score="+Obj+"&userID=" + userID + "&dataID=" + objectId+"&type="+type+"&sys="+sys);
	var newxmlhttp = new net.ContentLoader(url, subformScore, "", "GET", null, null);
	return false;
}
function ScoreShow(Obj,id) {  
    lineID = id;
	validataScore(Obj);
}




/*********************common.js   ***************************/


function onlineBoolean()
{
	if(userLoginType<=0)
	{
		var loginUrl = uu.urlUtil.encode("/core/pages/web/member/login.jsp?ss=" + ss + "&backURL="+localUrl)
		top.window.location=loginUrl;
	}
}

function getCookie( name ) {  
   // alert(document.cookie);
   var start = document.cookie.indexOf( name + "=" );
   var len = start + name.length + 1;
   var end = document.cookie.indexOf( ';', len );     
   if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) {
         return null;
   }     
   if ( start == -1 ) {
      return null;     
   }
   var end = document.cookie.indexOf( ';', len );     
   if ( end == -1 ) {
      end = document.cookie.length;   
   }
   return unescape( document.cookie.substring( len, end ) ); 
} 
function addCookie(name,value,expireHours){
        var cookieString=name+"="+escape(value);
        if(expireHours>0){
               var date=new Date();
               date.setTime(date.getTime+expireHours*3600*1000);
               cookieString=cookieString+"; expire="+date.toGMTString();
        }
        document.cookie=cookieString;
}

function subformLogin() {
	var gtext = this.req.responseText;
	if (gtext.indexOf("ok") != -1) {
	} else {	
		top.window.location="/login";       
	}
}
function validataLogin(Obj) {
	var url = "/interactive/loginManager/loginAction.uu?userID="+Obj;
	var newxmlhttp = new net.ContentLoader(url, subformLogin, "", "GET", null, null);
	return false;
}
function showLogin(Obj) {
   validataLogin(Obj);
}


//Load_JS
function load_js(jspath){
     var   head   =   document.getElementsByTagName('head');   
     var   script   =   document.createElement('script');   
     script.src   =   jspath;   
     script.type   =   'text/javascript';   
     head[0].appendChild(script);   

}
/*
 * hiddenFund
 */
function hiddenFund(divid,imgid){
	var obj = document.getElementById(divid);
	var img = document.getElementById(imgid);
	if (obj.style.display == "") {
		img.innerHTML = "\u66f4\u591a";
		obj.style.display = "none";
	} else {
		if (obj.style.display == "none") {
			img.innerHTML = "\u6536\u8d77";
			obj.style.display = "";
		}
	}
}
/*
 * ??????????
 */
function hiddenFundOneParameter(divid){
	var obj = document.getElementById(divid);
	if (obj.style.display == "") {
		obj.style.display = "none";
	} else {
		if (obj.style.display == "none") {
			obj.style.display = "";
		}
	}
}

/*
 * 
 */
 function hiddenAllFund(divid, imgid,length1,length2) {
        var img = document.getElementById(imgid);
        for (var j = length1; j < length2; j++) {
                var id = divid + "_" + j;
                var items = document.getElementById(id);
                if(items!='null'){
                if (items.style.display == "") {
                        img.innerHTML = "\u66f4\u591a";
                        items.style.display = "none";
                } else {
                        if (items.style.display == "none") {
                                img.innerHTML = "\u6536\u8d77";
                                items.style.display = "";
                        }
                }
                }
        }
}

function forwardURL(obj){
    location.href(obj);
}




/*********************json2.js    ***************************/


if (!this.JSON) {

    JSON = function () {

        function f(n) {    // Format integers to have at least two digits.
            return n < 10 ? '0' + n : n;
        }

        Date.prototype.toJSON = function () {

// Eventually, this method will be based on the date.toISOString method.

            return this.getUTCFullYear()   + '-' +
                 f(this.getUTCMonth() + 1) + '-' +
                 f(this.getUTCDate())      + 'T' +
                 f(this.getUTCHours())     + ':' +
                 f(this.getUTCMinutes())   + ':' +
                 f(this.getUTCSeconds())   + 'Z';
        };


        var m = {    // table of character substitutions
            '\b': '\\b',
            '\t': '\\t',
            '\n': '\\n',
            '\f': '\\f',
            '\r': '\\r',
            '"' : '\\"',
            '\\': '\\\\'
        };

        function stringify(value, whitelist) {
            var a,          // The array holding the partial texts.
                i,          // The loop counter.
                k,          // The member key.
                l,          // Length.
                v;          // The member value.

            switch (typeof value) {
            case 'string':

// If the string contains no control characters, no quote characters, and no
// backslash characters, then we can safely slap some quotes around it.
// Otherwise we must also replace the offending characters with safe sequences.

                return /["\\\x00-\x1f]/.test(value) ?
                    '"' + value.replace(/[\x00-\x1f\\"]/g, function (a) {
                        var c = m[a];
                        if (c) {
                            return c;
                        }
                        c = a.charCodeAt();
                        return '\\u00' + Math.floor(c / 16).toString(16) +
                                                   (c % 16).toString(16);
                    }) + '"' :
                    '"' + value + '"';

            case 'number':

// JSON numbers must be finite. Encode non-finite numbers as null.

                return isFinite(value) ? String(value) : 'null';

            case 'boolean':
                return String(value);

            case 'null':
                return 'null';

            case 'object':

// Due to a specification blunder in ECMAScript,
// typeof null is 'object', so watch out for that case.

                if (!value) {
                    return 'null';
                }

// If the object has a toJSON method, call it, and stringify the result.

                if (typeof value.toJSON === 'function') {
                    return stringify(value.toJSON());
                }
                a = [];
                if (value.constructor === Array) {

// The object is an array. Stringify every element. Use null as a placeholder
// for non-JSON values.

                    l = value.length;
                    for (i = 0; i < l; i += 1) {
                        a.push(stringify(value[i], whitelist) || 'null');
                    }

// Join all of the elements together and wrap them in brackets.

                    return '[' + a.join(',') + ']';
                }
                if (whitelist) {

// If a whitelist (array of keys) is provided, use it to select the components
// of the object.

                    l = whitelist.length;
                    for (i = 0; i < l; i += 1) {
                        k = whitelist[i];
                        if (typeof k === 'string') {
                            v = stringify(value[k], whitelist);
                            if (v) {
                                a.push(stringify(k) + ':' + v);
                            }
                        }
                    }
                } else {

// Otherwise, iterate through all of the keys in the object.

                    for (k in value) {
                        if (typeof k === 'string') {
                            v = stringify(value[k], whitelist);
                            if (v) {
                                a.push(stringify(k) + ':' + v);
                            }
                        }
                    }
                }

// Join all of the member texts together and wrap them in braces.

                return '{' + a.join(',') + '}';
            }
        }

        return {
            stringify: stringify,
            parse: function (text, filter) {
                var j;

                function walk(k, v) {
                    var i, n;
                    if (v && typeof v === 'object') {
                        for (i in v) {
                            if (Object.prototype.hasOwnProperty.apply(v, [i])) {
                                n = walk(i, v[i]);
                                if (n !== undefined) {
                                    v[i] = n;
                                }
                            }
                        }
                    }
                    return filter(k, v);
                }


// Parsing happens in three stages. In the first stage, we run the text against
// regular expressions that look for non-JSON pattern. We are especially
// concerned with '()' and 'new' because they can cause invocation, and '='
// because it can cause mutation. But just to be safe, we want to reject all
// unexpected forms.

// We split the first stage into 4 regexp operations in order to work around
// crippling inefficiencies in IE's and Safari's regexp engines. First we
// replace all backslash pairs with '@' (a non-JSON character). Second, we
// replace all simple value tokens with ']' characters. Third, we delete all
// open brackets that follow a colon or comma or that begin the text. Finally,
// we look to see that the remaining characters are only whitespace or ']' or
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.

                if (/^[\],:{}\s]*$/.test(text.replace(/\\./g, '@').
replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(:?[eE][+\-]?\d+)?/g, ']').
replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {

// In the second stage we use the eval function to compile the text into a
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
// in JavaScript: it can begin a block or an object literal. We wrap the text
// in parens to eliminate the ambiguity.

                    j = eval('(' + text + ')');

// In the optional third stage, we recursively walk the new structure, passing
// each name/value pair to a filter function for possible transformation.

                    return typeof filter === 'function' ? walk('', j) : j;
                }

// If the text is not JSON parseable, then a SyntaxError is thrown.

                throw new SyntaxError('parseJSON');
            }
        };
    }();
}


/*********************SendMail.js ***************************/

var friendsEmail;

function subformMail() {
	var gtext = this.req.responseText;
	var errors = document.getElementById("errors");
	if (gtext.indexOf("ok") != -1) {
		errors.innerHTML = "你已成功向"+friendsEmail+"发送邮件!";
	} else {
		errors.innerHTML = "邮件发送失败！请稍后再发送!";
	}
}
function validataMail(Obj) {
	var enter = true;
	var obj = document.MyForm;
	var errors = document.getElementById("errors");
	var msgError = "";
	var regu = "^(([0-9a-zA-Z]+)|([0-9a-zA-Z]+[_.0-9a-zA-Z-]*[0-9a-zA-Z]+))@([a-zA-Z0-9-]+[.])+([a-zA-Z]{2}|net|com|gov|mil|org|edu|int)$";
	var re = new RegExp(regu);
	var emailString = obj.email.value;
	var emailArray = emailString.split(",");
	if (obj.email.value.match(/^\s*$/g)) {
		msgError = "email\u4e0d\u80fd\u4e3a\u7a7a!";
		enter = false;
	} else {
		for (i = 0; i < emailArray.length; i++) {
			if (emailArray[i].search(re) != -1) {
			    enter = true;
			} else {
				msgError = msgError + "\u7b2c" + (i + 1) + "\u4e2aemail\u4e0d\u662f\u6709\u6548\u5408\u6cd5\u7684!";
				enter = false;
			}
		}
	}
	if (enter == false) {
		errors.innerHTML = msgError;
		return false;
	}else{
	    errors.innerHTML = " ";
	}
	var getURL = document.URL;
	var email = document.MyForm.email.value;
	friendsEmail = email;
	var url = "/interactive/emailManager/mailSend!sendEmail.uu?ToEmail=" + email + "&url="+getURL;
	var newxmlhttp = new net.ContentLoader(url, subformMail, "", "GET", null, null);
	return false;
}
function showMail(Obj) {
 //o.src="bb.jsp";
 //	alert('aaaaa');
	var enter = true;
	var obj = document.MyForm;
	
	var errors = document.getElementById("errors");
	var button = document.getElementById("button");
	var msgError = "";
	var regu = "^(([0-9a-zA-Z]+)|([0-9a-zA-Z]+[_.0-9a-zA-Z-]*[0-9a-zA-Z]+))@([a-zA-Z0-9-]+[.])+([a-zA-Z]{2}|net|com|gov|mil|org|edu|int)$";
	var re = new RegExp(regu);
	var emailString = obj.email.value;
	var emailArray = emailString.split(",");
	if (obj.email.value.match(/^\s*$/g)) {
		msgError = "email\u4e0d\u80fd\u4e3a\u7a7a!";
		enter = false;
	} else {
		for (i = 0; i < emailArray.length; i++) {
			if (emailArray[i].search(re) != -1) {
			} else {
				msgError = msgError + "\u7b2c" + (i + 1) + "\u4e2aemail\u4e0d\u662f\u6709\u6548\u5408\u6cd5\u7684!";
				enter = false;
			}
		}
	}
	if (enter == false) {
		errors.innerHTML = msgError;
		button.innerHTML = "<input type=\"button\" disabled=\"true\" name=\"button\" onClick=\"validataMail(this);\" value=\"\u63d0 \u4ea4\" />";
		return false;
	} else {
	    errors.innerHTML = " ";
		button.innerHTML = "<input type=\"button\" name=\"button\" onClick=\"validataMail(this);\" value=\"\u63d0 \u4ea4\" />";
	}
	//validataMail(Obj);
}



/*********************UrlUtil.js  ***************************/


if (typeof uu == "undefined") {
	uu = {};
}
uu.Base64CodeUtil = function () {
	var keyStr = "ABCDEFGHIJKLMNOP" + "QRSTUVWXYZabcdef" + "ghijklmnopqrstuv" + "wxyz0123456789+/" + "=";
	return {encode:function (input) {
		input = encodeURIComponent(input);
		var output = "";
		var chr1, chr2, chr3 = "";
		var enc1, enc2, enc3, enc4 = "";
		var i = 0;
		do {
			chr1 = input.charCodeAt(i++);
			chr2 = input.charCodeAt(i++);
			chr3 = input.charCodeAt(i++);
			enc1 = chr1 >> 2;
			enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
			enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
			enc4 = chr3 & 63;
			if (isNaN(chr2)) {
				enc3 = enc4 = 64;
			} else {
				if (isNaN(chr3)) {
					enc4 = 64;
				}
			}
			output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4);
			chr1 = chr2 = chr3 = "";
			enc1 = enc2 = enc3 = enc4 = "";
		} while (i < input.length);
		return output;
	}, decode:function (input) {
		var output = "";
		var chr1, chr2, chr3 = "";
		var enc1, enc2, enc3, enc4 = "";
		var i = 0;

      	// remove all characters that are not A-Z, a-z, 0-9, +, /, or =
		var base64test = /[^A-Za-z0-9\+\/\=]/g;
		if (base64test.exec(input)) {
			alert("There were invalid base64 characters in the input text.\n" + "Valid base64 characters are A-Z, a-z, 0-9, '+', '/', and '='\n" + "Expect errors in decoding.");
			return null;
		}
		input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
		do {
			enc1 = keyStr.indexOf(input.charAt(i++));
			enc2 = keyStr.indexOf(input.charAt(i++));
			enc3 = keyStr.indexOf(input.charAt(i++));
			enc4 = keyStr.indexOf(input.charAt(i++));
			chr1 = (enc1 << 2) | (enc2 >> 4);
			chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
			chr3 = ((enc3 & 3) << 6) | enc4;
			output = output + String.fromCharCode(chr1);
			if (enc3 != 64) {
				output = output + String.fromCharCode(chr2);
			}
			if (enc4 != 64) {
				output = output + String.fromCharCode(chr3);
			}
			chr1 = chr2 = chr3 = "";
			enc1 = enc2 = enc3 = enc4 = "";
		} while (i < input.length);
		return decodeURIComponent(output);
	}};
};
uu.UrlUtil = function () {
	var base64 = new uu.Base64CodeUtil();
	var absRegex = new RegExp("^([^/\\.\\?]+://[^/\\?]+/{0,2})([^\\?]*)\\??(.*)$");
	var _absRegex = new RegExp("^[a-z]*://.*$");
	var relRegex = new RegExp("^([^\\?]+)\\??(.*)$");
	var typeExt = {"1":"html", "2":"shtml", "3":"jsp", "4":"uu","5":"do"};
	var extType = {"html":"1", "shtml":"2", "jsp":"3", "uu":"4","do":"5"};
	var services = {};
	var extServer = {};
	return {encode:function (url) {
		var parts = this.parseUrl(url);
		if (parts == null) {
			alert("URL\uff3b" + url + "\uff3d\u4e0d\u89c4\u8303\uff01");
			return "";
		}
		var domain = parts[0];
		var path = parts[1];
		var ext = this.extCode(parts[2]);
		var params = parts[3];
		var result = domain;
		if (!isNaN(ext)) {
			if (domain == "" && path.indexOf("/") == 0) {
				result += ("/" + path.substring(1).replace(/\//g, "_"));
			} else {
				if (path != "") {
					result += path.replace(/\//g, "_");
				}
			}
			result += ("__" + ext + "__");
			if (params != "") {
				result += base64.encode(params).replace(/\//g, "_").replace(/=/g, "!");
			}
			result += ".shtml";
		} else {
			if (domain != "" || (domain == "" && path.indexOf("/") != 0)) {
				return url;
			} else {
				return extServer[parts[1]] ? ext + url : url;
			}
		}
		return result;
	}, decode:function (url) {
	}, isAbsoluteUrl:function (url) {
		return _absRegex.test(url);
	}, imgUrl:function (url) {
		var result = 'http://i.66fund.com/i' + url;
		return result;
	}, imgUrlS:function (url) {
		var result = 'http://i.66stock.com/i' + url;
		return result;
	}, extCode:function (ext) {
		if (!ext || ext == 0) {
			return 0;
		} else {
			if (extType[ext]) {
				return extType[ext];
			} else {
				return NaN;
			}
		}
	}, parseUrl: function(url) {
		var parts = null;
		var domain = "", path = "", ext = "", params = "";
		if (this.isAbsoluteUrl(url)) {
			if (parts = absRegex.exec(url))
			{
				if (parts[1].lastIndexOf("//") == parts[1].length - 2) {
					domain = parts[1].substring(0, parts[1].length - 1);
				} else {
					if (parts[1].lastIndexOf("/") != parts[1].length - 1) {
						domain = parts[1] + "/";
					} else {
						domain = parts[1];
					}
				}
				path = parts[2];
				params = parts[3];
			}
			else
			{
				return null;
			}
		} else {
			if (parts = relRegex.exec(url)) {
				path = parts[1];
				if (path.indexOf("/") == 0)
				{
					var dot = path.indexOf("/", 1);
					if (dot != -1)
					{
						domain = services[path.substring(0, dot)];
						if (!domain)
						{
							domain = "";
						}
					}
					
					domain += "/";
					path = path.substring(1);
				}
				params = parts[2];
			} else {
				return null;
			}
		}
		if (path != "") {
			if (path.indexOf("_") != -1) {
				return null;
			}
			path = path.replace(/\/\//g, "/");
			var dot = path.lastIndexOf(".");
			if (dot != -1) {
				if (dot == 0 || path.indexOf(".") != dot || dot == path.length - 1) {
					return null;
				}
				ext = path.substring(dot + 1);
				path = path.substring(0, dot);
			}
		}
		return [domain, path, ext, params];
	}};
};

uu.urlUtil = new uu.UrlUtil();

/***********************core_core.js*************************/


function CitySelector(countryStateCity, countryID, stateID, cityID) {
	this.countries = countryStateCity[0];
	this.states = countryStateCity[1];
	this.cities = countryStateCity[2];
	this.countryID = countryID;
	this.stateID = stateID;
	this.cityID = cityID;
}
CitySelector.prototype = {init:function (countryCode, stateCode, cityCode) {
	var select = $(this.countryID);
	for (var i = 0; i < this.countries.length; i += 1) {
		var country = this.countries[i];
		if (country) {
			var option = new Option(country.name, country.code);
			if (country.code == countryCode) {
				option.selected = true;
			}
			select.options.add(option);
		}
	}
	this.redirectState(countryCode, stateCode, cityCode);
}, redirectState:function (countryCode, stateCode, cityCode) {
	var select = $(this.stateID);
	select.options.length = 0;
	select.options.add(new Option("--\u8bf7\u9009\u62e9--", ""));
	if (countryCode && countryCode !== "") {
		for (var i = 0; i < this.states.length; i += 1) {
			var state = this.states[i];
			if (state && state.countryCode == countryCode) {
				var option = new Option(state.name, state.code);
				if (state.code == stateCode) {
					option.selected = true;
				}
				select.options.add(option);
			}
		}
	}
	this.redirectCity(stateCode, cityCode);
}, redirectCity:function (stateCode, cityCode) {
	var select = $(this.cityID);
	select.options.length = 0;
	select.options.add(new Option("--\u8bf7\u9009\u62e9--", ""));
	if (stateCode && stateCode !== "") {
		for (var i = 0; i < this.cities.length; i += 1) {
			var city = this.cities[i];
			if (city && city.stateCode == stateCode) {
				var option = new Option(city.name, city.code);
				if (city.code == cityCode) {
					option.selected = true;
				}
				select.options.add(option);
			}
		}
	}
}};

/* 
 *	ajax call
 *  Call Remote Servlet Service
 */
function ajaxAsynGet(action, id) {
  new Ajax.Request(uu.urlUtil.encode(action),
  {
    asynchronous: 'true',
    /*method: 'get',*/
    method: 'post',
    requestHeaders: ['Connection', 'close', 'Keep-Alive', '0'],
    onSuccess: function(transport){
      var response = transport.responseText || "";
      $(id).innerHTML = response;
    },
    onFailure: function(){ $(id).innerHTML = "数据没有找到，请稍后再试。"; }
  });
 }
 
 //del "/n"
//firefox,ie
 function copyToBoard(txt){
	if (window.clipboardData){ 
		window.clipboardData.clearData();
 		window.clipboardData.setData("Text", txt);
 	}else if(navigator.userAgent.indexOf("Opera") != -1) {
  		window.location = txt;
 	} else if (window.netscape) { 
 		try { 
 			netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 		} catch (e) {
    		alert("被浏览器拒绝！\n请在浏览器地址栏输入'about:config'并回车\n然后将'signed.applets.codebase_principal_support'设置为'true'");
 		}
 	var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
 	if (!clip) return;
 	var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
  	if (!trans)return;
 	trans.addDataFlavor('text/unicode'); 
 	var str = new Object();
 	var len = new Object(); 
 	var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
 	var copytext = txt;
 	str.data = copytext;
 	trans.setTransferData("text/unicode",str,copytext.length*2);
 	 var clipid = Components.interfaces.nsIClipboard;
 	if (!clip)return false;
	clip.setData(trans,null,clipid.kGlobalClipboard);
	}
 }


/* 
 *	ajax call
 *  Call Remote Servlet Service
 */
function ajaxAsynPost(action, x, id) {
  new Ajax.Request(uu.urlUtil.encode(action),
  {
    asynchronous: 'true',
    /*method: 'get',*/
    method: 'post',
    postBody: x,
    requestHeaders: ['Connection', 'close', 'Keep-Alive', '0'],
    onSuccess: function(transport){
      var response = transport.responseText || "";
      $(id).innerHTML = response;
    },
    onFailure: function(){ $(id).innerHTML = "数据没有找到，请稍后再试。"; }
  });
}

/*width:图的宽度，height:图的高度,urlsetting:配置文件路径,格式为："http://i.66fund.com/i/fund/chart/stock-chart-01-settings.xml"
 urldata:数据文件路径,version:flash player版本，bgcolor：图的背景色,divid:显示图的div的ID,divid1:图下边的指数ID,url显示图下的指数路径
 
 function showChart(width,height,urlsetting,urldata,version,bgcolor,divid,divid1,url)
 {	 
 	 document.write('<table style="width:auto;height:auto">');
 	 document.write('<tr><td><div id="'+ divid +'">');
	 document.write('<strong>You need to upgrade your Flash Player</strong></div></td></tr>');
	 document.write('<tr><td align="center"><div id="'+ divid1 +'"></div></td></tr></table>');
 	 var so = new SWFObject('http://i.66fund.com/i/fund/chart/amline.swf', 'amline', width, height, version, bgcolor);
     so.addVariable("loading_data", "数据加载中...");
     so.addVariable("loading_settings", "配置数据加载中...");
     so.addVariable("collecting_data", "加载中...");
     so.addVariable('path', 'http://i.66fund.com/i/fund/chart/');
     so.addVariable("chart_id", "chart1");
     so.addVariable("settings_file", escape(urlsetting));  
	 so.addVariable("data_file", encodeURIComponent('http://i.66fund.com'+uu.urlUtil.encode(urldata)));
	 so.addParam("wmode","transparent");
	 so.write(divid);
	 if (divid1 != "" && url != "")
	 {
	 	ajaxAsynGet(url,divid1);
	 	setInterval(function (){ajaxAsynGet(url,divid1);},60000);
	 }
 }*/

 /*width:图的宽度，height:图的高度, code:指数代码,bgcolor：图的背景色,
 divid:显示图的div的ID,divid1:显示图下边的指数的DIV的ID*/
 
 function showChart(width,height,code,bgcolor,divid,divid1,title)
 {	 
 	 document.write('<table style="width:auto;height:auto">');
 	 document.write('<tr><td><div id="'+ divid +'">');
	 document.write('<strong>You need to upgrade your Flash Player</strong></div></td></tr>');
	 document.write('<tr><td align="center"><div id="'+ divid1 +'"></div></td></tr></table>');
 	 var so = new SWFObject('http://i.66fund.com/i/fund/chart/amline.swf', 'amline', width, height, '4', bgcolor);
     so.addVariable("loading_data", "数据加载中...");
     so.addVariable("loading_settings", "配置数据加载中...");
     so.addVariable("collecting_data", "加载中...");
     so.addVariable('path', 'http://i.66fund.com/i/fund/chart/');
     so.addVariable("chart_id", "chart1");
     so.addVariable("settings_file", escape('http://i.66fund.com/i/fund/chart/stock-chart-01-settings.xml'));  
	 so.addVariable("data_file", encodeURIComponent('http://i.66fund.com'+uu.urlUtil.encode('/uuStock/chart/stockchart/stockChart!shareIndex.uu?code=' + code )));
	 so.addParam("wmode","transparent");
	 so.write(divid);
	 var url = '/uuStock/chart/stockchart/stockChart!showzhishu.uu?code='+code + '&flag=' + title;
	 if (divid1 != "")
	 {
	 	ajaxAsynGet(url,divid1);
	 	setInterval(function (){ajaxAsynGet(url,divid1);},60000);
	 }
 }
 function showDialogt(){
 //alert(document.getElementById("tip")); 
  document.getElementById("tip").style.display="block";
  document.getElementById("tip").parentNode.style.position="relative";
  ajaxAsynGet("/fund/user/userActionNew!isRemember.uu", "tip");
}
function closeDialogt(){
  document.getElementById("tip").style.display="none";
}

function validataDialogt(){
  document.getElementById("tip").style.display="block";
  var userName=document.getElementById("loginuname").value;
  var pwd =document.getElementById("loginpass").value;

		if(userName == "")
		{
			document.getElementById("errMes").innerHTML="\u8bf7\u586b\u5199\u7528\u6237\u540d!";
			return false;
		}

		if(pwd == "")
		{
			document.getElementById("errMes").innerHTML="\u8bf7\u586b\u5199\u5bc6\u7801!";
			return false;
		}
        var url = "/core/web/member/memberAction!ajaxLogin.uu";
	    var param = "user.userName=" + encodeURI(encodeURI(userName)) + "&user.password=" + encodeURI(encodeURI(pwd));
	    ajaxAsynPostt(url, param,'errMes');    
      
}
function ajaxAsynPostt(action, x, id) {
  new Ajax.Request(uu.urlUtil.encode(action),
  {
    asynchronous: 'true',
    /*method: 'get',*/
    method: 'post',
    postBody: x,
    requestHeaders: ['Connection', 'close', 'Keep-Alive', '0'],
    onSuccess: function(transport){
      var response = transport.responseText || "";
      var json = response.evalJSON(true);
      if(json.type == 'error3')
		{
		$(id).innerHTML = "\u7528\u6237\u540d\u4e0d\u5b58\u5728!";
		}
	   if(json.type == 'error4')
		{
		$(id).innerHTML = "\u5bc6\u7801\u4e0d\u6b63\u786e!";
		}
	 if(json.type == 'success')
	 	{
		ajaxAsynGet("/fund/user/userActionNew!getHead.uu?js_referer="+fullpath, "userInfo");
		closeDialogt();
		}
    },
    onFailure: function(){ $(id).innerHTML = "加载出错..."; }
  });
}