if (!this.JSON) {
    JSON = function () {
        function f(n) {
            return n < 10 ? '0' + n : n;
        }
        Date.prototype.toJSON = function (key) {
            return this.getUTCFullYear()   + '-' +
                 f(this.getUTCMonth() + 1) + '-' +
                 f(this.getUTCDate())      + 'T' +
                 f(this.getUTCHours())     + ':' +
                 f(this.getUTCMinutes())   + ':' +
                 f(this.getUTCSeconds())   + 'Z';
        };
        var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
            escapeable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
            gap,
            indent,
            meta = {   
                '\b': '\\b',
                '\t': '\\t',
                '\n': '\\n',
                '\f': '\\f',
                '\r': '\\r',
                '"' : '\\"',
                '\\': '\\\\'
            },
            rep;
        function quote(string) {
            escapeable.lastIndex = 0;
            return escapeable.test(string) ?
                '"' + string.replace(escapeable, function (a) {
                    var c = meta[a];
                    if (typeof c === 'string') {
                        return c;
                    }
                    return '\\u' + ('0000' +
                            (+(a.charCodeAt(0))).toString(16)).slice(-4);
                }) + '"' :
                '"' + string + '"';
        }
        function str(key, holder) {
            var i,   
                k,          
                v,          
                length,
                mind = gap,
                partial,
                value = holder[key];
            if (value && typeof value === 'object' &&
                    typeof value.toJSON === 'function') {
                value = value.toJSON(key);
            }
            if (typeof rep === 'function') {
                value = rep.call(holder, key, value);
            }
            switch (typeof value) {
            case 'string':
                return quote(value);
            case 'number':
                return isFinite(value) ? String(value) : 'null';
            case 'boolean':
            case 'null':
                return String(value);
            case 'object':
                if (!value) {
                    return 'null';
                }
                gap += indent;
                partial = [];
                if (typeof value.length === 'number' &&
                        !(value.propertyIsEnumerable('length'))) {
                    length = value.length;
                    for (i = 0; i < length; i += 1) {
                        partial[i] = str(i, value) || 'null';
                    }
                    v = partial.length === 0 ? '[]' :
                        gap ? '[\n' + gap +
                                partial.join(',\n' + gap) + '\n' +
                                    mind + ']' :
                              '[' + partial.join(',') + ']';
                    gap = mind;
                    return v;
                }
                if (rep && typeof rep === 'object') {
                    length = rep.length;
                    for (i = 0; i < length; i += 1) {
                        k = rep[i];
                        if (typeof k === 'string') {
                            v = str(k, value, rep);
                            if (v) {
                                partial.push(quote(k) + (gap ? ': ' : ':') + v);
                            }
                        }
                    }
                } else {
                    for (k in value) {
                        if (Object.hasOwnProperty.call(value, k)) {
                            v = str(k, value, rep);
                            if (v) {
                                partial.push(quote(k) + (gap ? ': ' : ':') + v);
                            }
                        }
                    }
                }
                v = partial.length === 0 ? '{}' :
                    gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
                            mind + '}' : '{' + partial.join(',') + '}';
                gap = mind;
                return v;
            }
        }
        return {
            stringify: function (value, replacer, space) {
                var i;
                gap = '';
                indent = '';
                if (typeof space === 'number') {
                    for (i = 0; i < space; i += 1) {
                        indent += ' ';
                    }
                } else if (typeof space === 'string') {
                    indent = space;
                }
                rep = replacer;
                if (replacer && typeof replacer !== 'function' &&
                        (typeof replacer !== 'object' ||
                         typeof replacer.length !== 'number')) {
                    throw new Error('JSON.stringify');
                }
                return str('', {'': value});
            },
            parse: function (text, reviver) {
                var j;
                function walk(holder, key) {
                    var k, v, value = holder[key];
                    if (value && typeof value === 'object') {
                        for (k in value) {
                            if (Object.hasOwnProperty.call(value, k)) {
                                v = walk(value, k);
                                if (v !== undefined) {
                                    value[k] = v;
                                } else {
                                    delete value[k];
                                }
                            }
                        }
                    }
                    return reviver.call(holder, key, value);
                }
                cx.lastIndex = 0;
                if (cx.test(text)) {
                    text = text.replace(cx, function (a) {
                        return '\\u' + ('0000' +
                                (+(a.charCodeAt(0))).toString(16)).slice(-4);
                    });
                }
                if (/^[\],:{}\s]*$/.
test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').
replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
                    j = eval('(' + text + ')');
                    return typeof reviver === 'function' ?
                        walk({'': j}, '') : j;
                }
                throw new SyntaxError('JSON.parse');
            }
        };
    }();
}
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { 
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); 
        }
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { 
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};
(function ($) {
	var isObject = function (x) {
		return (typeof x === 'object') && !(x instanceof Array) && (x !== null);
	};
	$.extend({
		getJSONCookie: function (cookieName) {
			var cookieData = $.cookie(cookieName);
			return cookieData ? JSON.parse(cookieData) : {};
		},
		setJSONCookie: function (cookieName, data, options) {
			var cookieData = '';
			options = $.extend({
				expires: 0,
				path: '/'
			}, options);
			if (!isObject(data)) {
				throw new Error('JSONCookie data must be an object');
			}
			cookieData = JSON.stringify(data);
			return $.cookie(cookieName, cookieData, options);
		},
		removeJSONCookie: function (cookieName) {
			return $.cookie(cookieName, null);
		},
		JSONCookie: function (cookieName, data, options) {
			if (data) {
				$.setJSONCookie(cookieName, data, options);
			}
			return $.getJSONCookie(cookieName);
		}
	});
})(jQuery);
var jsonCookie = {
	jsonName:'cnolniccart',
	jsonNum:'cnolniccartnum',
	jsonId:'cnolniccartid',
	store:function(zzyid,domainname,bandtype){
		var producttype;
		var bandtype;
		var price;
		var num = jsonCookie.getNum();
		var json = jsonCookie.getJson();
		var id = jsonCookie.getId();
		var json = jsonCookie.getJson();
		jQuery.each(json,function(i,v){
			id=v.id;
		})
		switch (zzyid)
		{
		   case '1':
			      producttype = 155;
			      bandtype=domainname?domainname:0;
			      price="100元/年";
			      break;
		   case '2':
			      producttype = 27;
			      bandtype=domainname?domainname:0;
			      price="350元/年";
			      break;
		   case '3':
			      producttype = 28;
			      bandtype=domainname?domainname:0;
			      price="500元/年";
			      break;
		   case '4':
			      producttype = 29;
			      bandtype=domainname?domainname:0;
			      price="1200元/年";
			      break;
		   case '5':
			      producttype = 4;
			      bandtype=domainname?domainname:0;
			      price="100元/年";
			      break;
		   case '6':
			      producttype = 1;
			      bandtype=domainname?domainname:0;
			      price="100元/年";
			      break;
		   case '7':
			      producttype = 5;
			      bandtype=domainname?domainname:0;
			      price="300元/年";
			      break;
		   case '8':
			      producttype = 9;
			      bandtype=domainname?domainname:0;
			      price="150元/年";
			      break;
		   case '9':
			      producttype = 10;
			      bandtype=domainname?domainname:0;
			      price="150元/年";
			      break;
		   case '10':
			      producttype = 6;
			      bandtype=domainname?domainname:0;
			      price="320元/年";
			      break;
		   case '11':
			      producttype = 6;
			      bandtype=domainname?domainname:0;
			      price="320元/年";
			      break;
		   case '12':
			      producttype = 6;
			      bandtype=domainname?domainname:0;
			      price="320元/年";
			      break;
		   case '13':
			      producttype = 2;
			      bandtype=domainname?domainname:0;
			      price="320元/年";
			      break;
		   case '14':
			      producttype = 2;
			      bandtype=domainname?domainname:0;
			      price="320元/年";
			      break;
		   case '15':
			      producttype = 54;
			      bandtype=domainname?domainname:0;
			      price="400元/年";
			      break;
		   case '16':
			      producttype = 13;
			      bandtype=domainname?domainname:0;
			      price="1000元/年";
			      break;
		   case '17':
			      producttype = 35;
			      bandtype=domainname?domainname:0;
			      price="2500元/年";
			      break;
		   case '18':
			      producttype = 36;
			      bandtype=domainname?domainname:0;
			      price="5000元/年";
			      break;
		   case '19':
			      producttype = 34;
			      bandtype=domainname?domainname:0;
			      price="10000元/年";
			      break;
		   case '20':
			      producttype = 21;
			      bandtype = 1;
			      price="200元/年";
			      break;
		   case '21':
			      producttype = 22;
			      bandtype = 1;
			      price="350元/年";
			      break;
		   case '22':
			      producttype = 23;
			      bandtype = 1;
			      price="500元/年";
			      break;
		   case '23':
			      producttype = 83;
			      bandtype = 1;
			      price="750元/年";
			      break;
		   case '24':
			      producttype = 21;
			      bandtype = 2;
			      price="250元/年";
			      break;
		   case '25':
			      producttype = 22;
			      bandtype = 2;
			      price="500元/年";
			      break;
		   case '26':
			      producttype = 23;
			      bandtype = 2;
			      price="700元/年";
			      break;
		   case '27':
			      producttype = 83;
			      bandtype = 2;
			      price="850元/年";
			      break;
		   case '28':
			      producttype = 39;
			      bandtype = 1;
			      price="1000元/年";
			      break;
		   case '29':
			      producttype = 40;
			      bandtype = 1;
			      price="1500元/年";
			      break;
		   case '30':
			      producttype = 41;
			      bandtype = 1;
			      price="2500元/年";
			      break;
		   case '31':
			      producttype = 39;
			      bandtype = 2;
			      price="1200元/年";
			      break;
		   case '32':
			      producttype = 40;
			      bandtype = 2;
			      price="1800元/年";
			      break;
		   case '33':
			      producttype = 41;
			      bandtype = 2;
			      price="2800元/年";
			      break;
		   case '34':
			      producttype = 124;
			      bandtype = 2;
			      price="3000元/年";
			      break;
		   case '35':
			      producttype = 125;
			      bandtype = 2;
			      price="5000元/年";
			      break;
		   case '41':
			      producttype = 97;
				if(bandtype=="10") price="1500元/年";
				else if(bandtype=="15") price="2175元/年";
				else if(bandtype=="20") price="2900元/年";
				else if(bandtype=="25") price="3500元/年";
				else if(bandtype=="30") price="4200元/年";
				else if(bandtype=="35") price="4725元/年";
				else if(bandtype=="40") price="5400元/年";
				else if(bandtype=="45") price="6075元/年";
				else if(bandtype=="50") price="6750元/年";
				else if(bandtype=="55") price="7150元/年";
				else if(bandtype=="60") price="7800元/年";
				else if(bandtype=="65") price="8450元/年";
				else if(bandtype=="70") price="9100元/年";
				else if(bandtype=="75") price="9375元/年";
				else if(bandtype=="80") price="10000元/年";
				else if(bandtype=="85") price="10625元/年";
				else if(bandtype=="90") price="11250元/年";
				else if(bandtype=="95") price="11875元/年";
			      break;
		   case '42':
			      producttype = 97;
				if(bandtype=="100") price="12000元/年";
				else if(bandtype=="200") price="24000元/年";
				else if(bandtype=="300") price="34500元/年";
				else if(bandtype=="400") price="46000元/年";
				else if(bandtype=="500") price="55000元/年";
				else if(bandtype=="600") price="66000元/年";
				else if(bandtype=="700") price="73500元/年";
				else if(bandtype=="800") price="84000元/年";
				else if(bandtype=="900") price="90000元/年";
			      break;
		   case '43':
			      producttype = 97;
				if(bandtype=="1000") price="100000元/年";
				else if(bandtype=="2000") price="190000元/年";
				else if(bandtype=="3000") price="270000元/年";
				else if(bandtype=="4000") price="270000元/年-900000元/年";
			      break;
		   case '44':
			      producttype = 48;
			      bandtype=domainname?domainname:0;
			      price="4800元起";
			      break;
		   case '45':
			      producttype = 79;
			      bandtype=domainname?domainname:0;
			      price="16600元起";
			      break;
		   case '61':
			      producttype = 91;
			      bandtype=domainname?domainname:0;
			      price="150元/年";
			      break;
		   case '62':
			      producttype = 174;
			      bandtype=domainname?domainname:0;
			      price="1元/年";
			      break;
		   case '63':
			      producttype = 175;
			      bandtype=domainname?domainname:0;
			      price="1元/年";
			      break;
		   case '64':
			      producttype = 176;
			      bandtype=domainname?domainname:0;
			      price="1元/年";
			      break;
		   case '65':
			      producttype = 177;
			      bandtype=domainname?domainname:0;
			      price="1元/年";
			      break;
		   case '66':
			      producttype = 178;
			      bandtype=domainname?domainname:0;
			      price="1元/年";
			      break;
		   case '67':
			      producttype = 179;
			      bandtype=domainname?domainname:0;
			      price="1元/年";
			      break;
		   case '68':
			      producttype = 180;
			      bandtype=domainname?domainname:0;
			      price="1元/年";
			      break;
		   case '69':
			      producttype = 181;
			      bandtype=domainname?domainname:0;
			      price="1元/年";
			      break;
		   case '70':
			      producttype = 182;
			      bandtype=domainname?domainname:0;
			      price="1元/年";
			      break;
		   case '71':
			      producttype = 183;
			      bandtype=domainname?domainname:0;
			      price="1元/年";
			      break;
		   case '72':
			      producttype = 184;
			      bandtype=domainname?domainname:0;
			      price="1元/年";
			      break;
		   case '73':
			      producttype = 185;
			      bandtype=domainname?domainname:0;
			      price="1元/年";
			      break;
		   case '74':
			      producttype = 186;
			      bandtype=domainname?domainname:0;
			      price="1元/年";
			      break;
		   case '75':
			      producttype = 187;
			      bandtype=domainname?domainname:0;
			      price="1元/年";
			      break;
		   case '76':
			      producttype = 188;
			      bandtype=domainname?domainname:0;
			      price="1元/年";
			      break;
		   case '77':
			      producttype = 189;
			      bandtype=domainname?domainname:0;
			      price="1元/年";
			      break;
		   case '78':
			      producttype = 190;
			      bandtype=domainname?domainname:0;
			      price="1元/年";
			      break;

		   case '79':
			      producttype = 191;
			      bandtype=domainname?domainname:0;
			      price="1元/年";
			      break;
		   case '80':
			      producttype = 192;
			      bandtype=domainname?domainname:0;
			      price="1元/年";
			      break;
		   case '81':
			      producttype = 193;
			      bandtype=domainname?domainname:0;
			      price="1元/年";
			      break;
		   case '82':
			      producttype = 194;
			      bandtype=domainname?domainname:0;
			      price="1元/年";
			      break;
		   case '83':
			      producttype = 195;
			      bandtype=domainname?domainname:0;
			      price="1元/年";
			      break;
		   case '84':
			      producttype = 196;
			      bandtype=domainname?domainname:0;
			      price="1元/年";
			      break;
		   case '85':
			      producttype = 199;
			      bandtype=domainname?domainname:0;
			      price="1元/年";
			      break;
			      
		   case '86':
			      producttype = 198;
			      bandtype=domainname?domainname:0;
			      price="1元/年";
			      break;
		   case '87':
			      producttype = 86;
			      bandtype=domainname?domainname:0;
			      price="100元/年";
			      break;
		}
		id++;
		if(!json[id]){
		json[id] = {};
		json[id].id=id; 
		json[id].zzyid=zzyid;     
		json[id].domainname=domainname?domainname:"";     
		json[id].cart_producttype=producttype;     
		json[id].cart_bandtype=bandtype;     
		json[id].cart_chname="";     
		json[id].cart_email="";     
		json[id].cart_telephone="";     
		json[id].price=price;     
		num++;
		jQuery.JSONCookie(jsonCookie.jsonName,json);
		jQuery.cookie(jsonCookie.jsonNum,num,{path: '/'});   
		jQuery.cookie(jsonCookie.jsonId,id,{path: '/'});                                       
		}
		return true;
	},
	remove:function(id){
		var num = jsonCookie.getNum();
		var json = jsonCookie.getJson();
		if(json[id]){
			delete json[id];
			num--;
			jQuery.JSONCookie(jsonCookie.jsonName,json);
			jQuery.cookie(jsonCookie.jsonNum,num,{path: '/'});   
		}
	},
	modify:function(id,key,value){
		var json = jsonCookie.getJson();
		if(json[id]){
			json[id][key] = value;
			jQuery.JSONCookie(jsonCookie.jsonName,json);
		}
	},
	getJson:function(){
		var json = jQuery.JSONCookie(jsonCookie.jsonName);
		return (json == null) ? {} : json;
	},
	getNum:function(){
		var num = jQuery.cookie(jsonCookie.jsonNum);
		return (num == null) ? 0 : num;
	},
	getId:function(){
		var id = jQuery.cookie(jsonCookie.jsonId);
		return (id == null) ? 0 : id;
	}
}
function getproductnamebyproducttype(producttype,bandtype){
	var productname="";
	if(producttype=="155")
		productname="免费空间实用型";
	if(producttype=="27")
		productname="个人用户实用型";
	if(producttype=="28")
		productname="企业用户基本型";
	if(producttype=="29")
		productname="企业用户豪华型";
	if(producttype=="48")
		productname="google国内推广";
	if(producttype=="79")
		productname="google出口易";
	if(producttype=="1")
		productname="国际英文域名";
	if(producttype=="2")
		productname="国际中文域名";
	if(producttype=="4")
		productname="中国英文域名";
	if(producttype=="5")
		productname=".cc国际域名";
	if(producttype=="9")
		productname=".biz国际域名";
	if(producttype=="10")
		productname=".info国际域名";
	if(producttype=="21")
	{
		if(bandtype=="1")
			productname="M睿机-入门型单线";
		else if(bandtype=="2")
			productname="M睿机-入门型双线";
	}
	if(producttype=="22")
	{
		if(bandtype=="1")
			productname="M睿机-普及型单线";
		else if(bandtype=="2")
			productname="M睿机-普及型双线";
	}
	if(producttype=="23")
	{
		if(bandtype=="1")
			productname="M睿机-标准型单线";
		else if(bandtype=="2")
			productname="M睿机-标准型双线";
	}
	if(producttype=="83")
	{
		if(bandtype=="1")
			productname="M睿机-专业型单线";
		else if(bandtype=="2")
			productname="M睿机-专业型双线";
	}
	if(producttype=="39")
	{
		if(bandtype=="1")
			productname="G睿机-入门型单线";
		if(bandtype=="2")
			productname="G睿机-入门型双线";
	}
	if(producttype=="40")
	{
		if(bandtype=="1")
			productname="G睿机-普及型单线";
		if(bandtype=="2")
			productname="G睿机-普及型双线";
	}
	if(producttype=="41")
	{
		if(bandtype=="1")
			productname="G睿机-标准型单线";
		if(bandtype=="2")
			productname="G睿机-标准型双线";
	}
	if(producttype=="124")
	{
		if(bandtype=="2")
			productname="G睿机-高级型双线";
	}
	if(producttype=="125")
	{
		if(bandtype=="2")
			productname="G睿机-专业型双线";
	}
	if(producttype=="13")
		productname="普通通用网址";
	if(producttype=="35")
		productname="准通用词";
	if(producttype=="36")
		productname="普通通用词";
	if(producttype=="34")
		productname="白金通用词";
	if(producttype=="54")
		productname="中文.cc域名";
	if(producttype=="97")
	{
		if(bandtype>=5 && bandtype<=95)
			productname="老板邮局-风尚版-"+bandtype+"用户版";
		if(bandtype>=100 && bandtype<=900)
			productname="老板邮局-豪华版-"+bandtype+"用户版";
		if(bandtype>=1000)
		{
			if(bandtype==4000)
				productname="老板邮局-尊贵版-3000以上用户版";
			else
				productname="老板邮局-尊贵版-"+bandtype+"用户版";
		}
	}
	if(producttype=="6")
		productname="中国中文域名";
	if(producttype=="91")
		productname=".mobi国际域名";
	if(producttype=="174")
		productname=".tv国际域名";
	if(producttype=="175")
		productname=".eu国际域名";
	if(producttype=="176")
		productname=".uk国际域名";
	if(producttype=="177")
		productname=".tw国际域名";
	if(producttype=="178")
		productname=".hk国际域名";
	if(producttype=="179")
		productname=".jp国际域名";
	if(producttype=="180")
		productname=".my国际域名";
	if(producttype=="181")
		productname=".kr国际域名";
	if(producttype=="182")
		productname=".in国际域名";
	if(producttype=="183")
		productname=".th国际域名";
	if(producttype=="184")
		productname=".pk国际域名";
	if(producttype=="185")
		productname=".us国际域名";
	if(producttype=="186")
		productname=".vn国际域名";
	if(producttype=="187")
		productname=".sg国际域名";
	if(producttype=="188")
		productname=".cm国际域名";
	if(producttype=="189")
		productname=".me国际域名";
	if(producttype=="190")
		productname=".cd国际域名";
	if(producttype=="191")
		productname=".au国际域名";
	if(producttype=="192")
		productname=".nz国际域名";
	if(producttype=="193")
		productname=".ph国际域名";
	if(producttype=="194")
		productname=".it国际域名";
	if(producttype=="195")
		productname=".li国际域名";
	if(producttype=="196")
		productname=".de国际域名";
	if(producttype=="199")
		productname=".la国际域名";
	if(producttype=="198")
		productname=".mx国际域名";
	if(producttype=="86")
		productname=".org国际域名";
	return productname;
}

