<!--
var app = {}
app.args = {}
app.args.oargs = {}
app.show = {}
oldurl = {}
//var nowurl
var dd = {}
var num = 0
var prenum = 0
var prenum1 = 0
//var prenum2 = 0
var add = 0
var dtop = 0
var dleft = 0
var colorsname = {1:'0, 0, 0',2:'255, 207, 198',3:'255, 224, 196',4:'255, 230, 195',5:'255, 239, 193',6:'243, 240, 198',7:'222, 240, 205',8:'202, 235, 229',9:'183, 233, 247',10:'184, 223, 241',11:'185, 218, 236',12:'203, 207, 230',13:'214, 199, 224',14:'239, 207, 237',15:'255, 211, 241',16:'255, 201, 212',17:'85, 85, 85',18:'254, 158, 133',19:'255, 190, 131',20:'255, 204, 129',21:'255, 218, 125',22:'228, 220, 134',23:'185, 221, 151',24:'145, 215, 194',25:'99, 205, 244',26:'101, 189, 228',27:'104, 174, 216',28:'143, 152, 200',29:'168, 137, 191',30:'220, 151, 217',31:'255, 159, 229',32:'255, 141, 168',33:'130, 130, 130',34:'247, 61, 48',35:'254, 141, 50',36:'255, 163, 48',37:'255, 191, 47',38:'199, 193, 56',39:'130, 195, 74',40:'45, 180, 151',41:'0, 169, 227',42:'0, 136, 207',43:'0, 112, 184',44:'62, 73, 157',45:'105, 52, 141',46:'189, 75, 189',47:'255, 87, 200',48:'254, 62, 117',49:'175, 175, 175',50:'181, 64, 45',51:'184, 105, 46',52:'186, 121, 44',53:'191, 141, 41',54:'152, 143, 50',55:'103, 145, 64',56:'48, 136, 114',57:'0, 128, 167',58:'0, 106, 154',59:'0, 90, 138',60:'58, 63, 119',61:'84, 49, 109',62:'139, 63, 138',63:'191, 73, 154',64:'183, 51, 78',65:'255, 255, 255',66:'119, 60, 43',67:'121, 78, 43',68:'123, 86, 42',69:'123, 95, 39',70:'101, 97, 45',71:'74, 97, 55',72:'50, 92, 82',73:'6, 87, 112',74:'19, 77, 102',75:'24, 69, 95',76:'52, 53, 84',77:'67, 45, 79',78:'95, 53, 95',79:'125, 60, 105',80:'120, 47, 63'}
var websitename = {1:"乐淘鞋城",2:"卓越亚马逊",3:"淘宝商城",4:"淘鞋网"}	

/*键盘左右键功能*/
function keyPress(e){
	var e = e || window.event
	var keycode = e.keyCode ? e.keyCode : (e.which ? e.which : e.charCode);
	var kurl = unescape(location.hash)
	//alert(kurl)
	var ks = kurl.indexOf('page=') + 5
	var ke = kurl.indexOf(',',ks)
	var kp = parseInt(kurl.substring(ks,ke))
	//alert(kp)
	if(keycode == 37){
		app.showbackpage(kp-1)
	}
	if(keycode == 39){
		app.shownextpage(kp+1)
	}
}
document.onkeydown= keyPress;
/*打开窗口时自动最大化*/
self.moveTo(0,0)
self.resizeTo(screen.availWidth,screen.availHeight)

var prewidth = parseInt((document.body.clientWidth*0.78+10)/124)
var preheight = parseInt((document.body.clientHeight*0.86)/112)
//alert((document.body.clientWidth*0.78+10)/124)

prenum = prewidth*preheight

iscolorsite = function(url)
	{
		var curl = unescape(url)
		//alert(curl)
		var st = document.getElementById('s-t')	
		var colorweb = document.getElementById('color-website')
		var labelc = document.getElementById('label-color')
		var labelw = document.getElementById('label-website')
		var labelcb = document.getElementById('label-color-b')
		var labelwn = document.getElementById('label-website-name')
		var img1 = document.getElementById('label_img1')
		var img2 = document.getElementById('closeweb')
		
		//alert(curl)
		var s = curl.indexOf('color=') + 6
		var e = curl.indexOf('}')
		var c = parseInt(curl.substring(s,e))
		
		var s1 = curl.indexOf('site=') + 5
		var e1 = curl.indexOf('}')
		var c1 = parseInt(curl.substring(s1,e1))	
		if(curl.indexOf('color=')>0 && curl.indexOf('site=')>0){
					
			st.style.display = 'none'
			colorweb.style.display = 'block'
			labelc.style.display = 'block'
			labelcb.style.backgroundColor = 'rgb(' + colorsname[c+1] + ')'
			
			labelw.style.display = 'block'
			labelwn.innerHTML = "<img src='/image/site/"+c1+".gif'/>"			
			
			img1.onclick = function(){closefindcolor()}
			img2.onclick = function(){closefindweb()}
		}else if(curl.indexOf('color=')>0){
			st.style.display = 'none'
			colorweb.style.display = 'block'
			labelc.style.display = 'block'
			labelw.style.display = 'none'
			labelcb.style.backgroundColor = 'rgb(' + colorsname[c+1] + ')'	
			
			img1.onclick = function(){closefindcolor()}
		}else if(curl.indexOf('site=')>0){
			st.style.display = 'none'
			colorweb.style.display = 'block'
			labelw.style.display = 'block'
			labelc.style.display = 'none'
			labelwn.innerHTML = "<img src='/image/site/"+c1+".gif'/>"	
			img2.onclick = function(){closefindweb()}
		}else{
			st.style.display = 'block'
			colorweb.style.display = 'none'
		}
	}
isfindsimilar = function(url)
	{
		var furl = unescape(url)
		var findsim = document.getElementById('findsimilar')
		var closepic = document.getElementById('closepic')
		var fs = furl.indexOf('view=') + 5
		var fe = furl.indexOf('&',fs)
		var fview = furl.substring(fs,fe)
		if(fs<5){
			var fs = unescape(furl).indexOf('view=') + 5
			var fe = unescape(furl).indexOf('&',fs)
			var fview = unescape(furl).substring(fs,fe)
		}
		//alert(fview)
		if(fview == 'findsimilar'){
			findsim.style.visibility = 'visible'
			closepic.onclick = function(){closesimilar()}
		}else{
			findsim.style.visibility = 'hidden'
		}
	}
document.getElementById('title-women').style.fontFamily = '黑体'
document.getElementById('title-women').style.fontWeight = 'bolder'
if (window.ActiveXObject) {	
	var s = unescape(location.hash).indexOf('page=') + 5
	var e = unescape(location.hash).indexOf(',',s)
	var p = parseInt(unescape(location.hash).substring(s,e))
	
	var r1 = unescape(location.hash).indexOf('row=') + 4
	var r2 = unescape(location.hash).indexOf(',',r1)
	var row = parseInt(unescape(location.hash).substring(r1,r2))
	var c1 = unescape(location.hash).indexOf('col=') + 4
	var c2 = unescape(location.hash).indexOf(',',c1)
	if(c2<0){
		c2 = unescape(location.hash).indexOf('}')
	}
	var col = parseInt(unescape(location.hash).substring(c1,c2))
	
	window.onload = function()// IE
	{
		var isselect = document.getElementById('isselect')	
		
		if(location.hash.indexOf('site')>0&&location.hash.indexOf('findsimilar')>0){
			var s1 = unescape(location.hash).indexOf('site=') + 5
			var e1 = unescape(location.hash).indexOf(',',s1)
			if(e1<0){
				e1 = unescape(location.hash).indexOf('}')
			}
			var site = parseInt(unescape(location.hash).substring(s1,e1))  //.replace('page='+p,'page=1')
			location.hash = unescape(location.hash).replace('row='+row,'row='+preheight).replace('col='+col,'col='+prewidth).replace(',site='+site,'').replace('page='+p,'page=1')
		}else{
			location.hash = unescape(location.hash).replace('row='+row,'row='+preheight).replace('col='+col,'col='+prewidth)
		}
		
		app.request()
	}
	if(location.hash.indexOf('site')>0&&location.hash.indexOf('findsimilar')>0){
			var s1 = unescape(location.hash).indexOf('site=') + 5
			var e1 = unescape(location.hash).indexOf(',',s)
			if(e1<0){
				e1 = unescape(location.hash).indexOf('}')
			}
			var site = parseInt(unescape(location.hash.substring(s1,e1)))
			location.hash = unescape(location.hash).replace('row='+row,'row='+preheight).replace('col='+col,'col='+prewidth).replace(',site='+site,'').replace('page='+p,'page=1')
		}else{
			location.hash = unescape(location.hash).replace('row='+row,'row='+preheight).replace('col='+col,'col='+prewidth)
		}
	iscolorsite(location.hash)
	
	if(location.hash.indexOf('describe')>0){
		location.hash = '#category=womenshoe&view=scan&oargs={page=1,row='+preheight+',col='+prewidth+'}'
	}
	if(location.hash.indexOf('findsimilar')>0){
		location.hash = unescape(location.hash).replace('row='+row,'row='+preheight).replace('col='+col,'col='+prewidth).replace('page='+p,'page=1')
	}
}else{
	var s = unescape(location.hash).indexOf('page=') + 5
	var e = unescape(location.hash).indexOf(',',s)
	var p = parseInt(unescape(location.hash).substring(s,e))
	
	var r1 = unescape(location.hash).indexOf('row=') + 4
	var r2 = unescape(location.hash).indexOf(',',r1)
	var row = parseInt(unescape(location.hash).substring(r1,r2))
	var c1 = unescape(location.hash).indexOf('col=') + 4
	var c2 = unescape(location.hash).indexOf(',',c1)
	if(c2<0){
		c2 = unescape(location.hash).indexOf('}')
	}
	var col = parseInt(unescape(location.hash).substring(c1,c2))
	if(location.hash.indexOf('site')>0&&location.hash.indexOf('findsimilar')>0){
		var s1 = unescape(location.hash).indexOf('site=') + 5
		var e1 = unescape(location.hash).indexOf(',',s1)
		if(e1<0){
			e1 = unescape(location.hash).indexOf('}')
		}
		var site = parseInt(unescape(location.hash).substring(s1,e1))  //
		location.hash = unescape(location.hash).replace('row='+row,'row='+preheight).replace('col='+col,'col='+prewidth).replace(',site='+site,'').replace('page='+p,'page=1')
	}else{
		//location.hash = '#category=womenshoe&view=scan&oargs={page=1,row='+preheight+',col='+prewidth+'}'
		location.hash = unescape(location.hash).replace('row='+row,'row='+preheight).replace('col='+col,'col='+prewidth)
	}
	if(location.hash.indexOf('describe')>0){
		location.hash = '#category=womenshoe&view=scan&oargs={page=1,row='+preheight+',col='+prewidth+'}'
		//location.hash = '#category=womenshoe&view=scan&oargs={page=1,row='+preheight+',col='+prewidth+'}'
	}
	if(location.hash.indexOf('findsimilar')>0){
		location.hash = unescape(location.hash).replace('row='+row,'row='+preheight).replace('col='+col,'col='+prewidth).replace('page='+p,'page=1')
	}
}
iswomen = function()
	{
		if(location.hash.indexOf('womenshoe')>0){
			document.getElementById('title-women').style.fontFamily = '黑体'
			document.getElementById('title-women').style.fontWeight = 'bolder'
			document.getElementById('title-men').style.fontFamily = '宋体'
			document.getElementById('title-men').style.fontWeight = 'normal'
		}else if(location.hash.indexOf('menshoe')>0){
			document.getElementById('title-men').style.fontFamily = '黑体'
			document.getElementById('title-men').style.fontWeight = 'bolder'
			document.getElementById('title-women').style.fontFamily = '宋体'
			document.getElementById('title-women').style.fontWeight = 'normal'
		}
	}
ischeck = function()
	{
		var isselect = document.getElementById('isselect')
		
		if(isselect.checked){
			for(i=0;i<prenum;i++){
				var picprices = document.getElementById('picprice'+i)
				picprices.style.visibility = 'visible'
			}
		}else{
			for(i=0;i<prenum;i++){
				var picprices = document.getElementById('picprice'+i)
				picprices.style.visibility = 'hidden'
			}
		}
	}
	
var vie = document.getElementById('viewpagelist')
vie.style.width = (document.body.clientWidth-270) + 'px'
var pagm = document.getElementById('p-mid')
pagm.style.width = (document.body.clientWidth-315) + 'px'
var menm = document.getElementById('menu-mid')
menm.style.width = document.body.clientWidth*0.35 + 'px'
var menm1 = document.getElementById('menu')
if(screen.width == 800){	
	menm1.style.width = screen.width*0.76 + 'px'
	dtop = '10px'
	dleft = '30px'
}else if(screen.width == 1024){
	menm1.style.width = screen.width*0.71 + 'px'
	dtop = '50px'
	dleft = '150px'
}else if(screen.width == 1280){
	menm1.style.width = screen.width*0.77 + 'px'
	dtop = '60px'
	dleft = '330px'
}else if(screen.width == 1440){
	menm1.style.width = screen.width*0.79 + 'px'
	menm.style.width = document.body.clientWidth*0.40 + 'px'
	dtop = '120px'
	dleft = '400px'
}else if(screen.width == 1152){
	menm1.style.width = screen.width*0.74 + 'px'
	dtop = '100px'
	dleft = '250px'
}else{
	menm1.style.width = screen.width*0.75 + 'px'
	dtop = '50px'
	dleft = '300px'
}

app.receive = function (d)
	{
		var url = unescape(location.href)
		if(num < 0){
			num = 0
		}
		if(url != oldurl[num-1] && url.indexOf('describe')<0){
			oldurl[num] = url
			num = num + 1
		}
		app.dl = d
		//alert(url)
		app.show[app.args['view']]()
	}
	
app.showpage = function(view,page)
	{	
		var type = app.args['category']	
		
		//var dlist = app.dl.slice(0,prenum)
		for(var i in app.dl)
		{
			var item = document.createElement('a');
			var isselect = document.getElementById('isselect')			
			if(isselect.checked){	
				//alert('checked')
				item.innerHTML = '<div style="float:left;"><img dt="'+i+'" width="120px" height="90px" src="/image/'+type+'/image/'+(app.dl[i].id)+'.jpg" onmousemove="flowdiv(this,'+ i +')" onmouseout="closeflowdiv(this)"><div id="picprice'+i+'" class="picprice" width="120px" height="18px" style="text-align:center;color:#CC6600;visibility:visible"><strong>' +  app.dl[i].price +'</strong></div></div>';
			}else{
				item.innerHTML = '<div style="float:left;"><img dt="'+i+'" width="120px" height="90px" src="/image/'+type+'/image/'+(app.dl[i].id)+'.jpg" onmousemove="flowdiv(this,'+ i +')" onmouseout="closeflowdiv(this)"><div id="picprice'+i+'" class="picprice" width="120px" height="18px" style="text-align:center;color:#CC6600;visibility:hidden"><strong>' +  app.dl[i].price +'</strong></div></div>';	
			}
				var curl = unescape(location.hash)
				if(curl.indexOf('color=')>0 && curl.indexOf('site=')>0){
					var s = curl.indexOf('color=') + 6
					var e = curl.indexOf(',',s)
					if(e<0){
						var e = curl.indexOf('}')
					}
					var c = parseInt(curl.substring(s,e))
					var s3 = curl.indexOf('site=') + 5
					var e3 = curl.indexOf(',',s3)
					if(e3<0){
						var e3 = curl.indexOf('}')
					}
					var c3 = parseInt(curl.substring(s3,e3))
					var aurl = escape('category='+type+'&view=findsimilar&oargs={page=1,row=' + preheight + ',col=' + prewidth + ',id='+(app.dl[i].id)+',color='+c+',site='+c3+'}')
					item.href = '#' + aurl
				}else if(curl.indexOf('color=')>0){
					var s1 = curl.indexOf('color=') + 6
					var e1 = curl.indexOf('}')
					var c1 = parseInt(curl.substring(s1,e1))
					var aurl = escape('category='+type+'&view=findsimilar&oargs={page=1,row=' + preheight + ',col=' + prewidth + ',id='+(app.dl[i].id)+',color='+c1+'}')
					item.href = '#' + aurl
				}else if(curl.indexOf('site=')>0){
					var s2 = curl.indexOf('site=') + 5
					var e2 = curl.indexOf('}')
					var c2 = parseInt(curl.substring(s2,e2))
					var aurl = escape('category='+type+'&view=findsimilar&oargs={page=1,row=' + preheight + ',col=' + prewidth + ',id='+(app.dl[i].id)+',site='+c2+'}')
					item.href = '#' + aurl
				}else{
					var aurl = escape('category='+type+'&view=findsimilar&oargs={page=1,row=' + preheight + ',col=' + prewidth + ',id='+(app.dl[i].id)+'}')
					item.href = '#' + aurl
				}
				item.onclick = function()
				{					
					window.location = this.href
					app.request()
				}
			
			view.appendChild(item)
		}		
	}
app.show['scan'] = function(dl)
	{
		var lurl = unescape(location.hash)
			
		viewpagelist.innerHTML = ''
		if(location.hash.indexOf('scan') > 0 ){
			var lef = document.getElementById('left')
			lef.style.display = 'block'
			var three = document.getElementById('three')
			three.style.display = 'block'
			
			var lef2 = document.getElementById('left2')
			lef2.style.display = 'none'
		}		
		var view = document.getElementById('viewpagelist')
		view.style.display = 'block'
		var sh = document.getElementById('sh')
		sh.style.display = 'block'
		var page = document.getElementById('page')
		page.style.display = 'block'
		var cont = document.getElementById('help-content')
		cont.style.display = 'none'
		var he = document.getElementById('help-phone')
		he.style.display = 'none'
		var s = unescape(location.hash).indexOf('page=') + 5
		var e = unescape(location.hash).indexOf(',',s)
		var p = parseInt(unescape(location.hash).substring(s,e))
		if(s<5){
			var s = unescape(unescape(location.hash)).indexOf('page=') + 5
			var e = unescape(unescape(location.hash)).indexOf(',',s)
			var p = parseInt(unescape(unescape(location.hash)).substring(s,e))
		}
		
		if(prenum>app.dl.length){
			var end = ((p-1)*prenum) + app.dl.length 
		}else{
			var end = p * prenum
		}
		sec = document.getElementById('p-numpre')
		sec.innerHTML = '显示：[&nbsp;'+((p-1)*prenum+1)+'&nbsp;-&nbsp;'+end+'&nbsp;]'
		
		view = document.createElement('div')
		view.className = 'site-listview'
		
		app.showpage(view,p)
		viewpagelist.appendChild(view)	
		
		var nexts = document.getElementById('nexts')
		if(prenum > app.dl.length){
			nexts.onclick = function(){javascript:void(0)}	
		}else{
			var url = unescape(location.hash).replace('page='+p,'page='+(p+1))			
			nexts.href = '#' + escape(url.replace('#',''))
			nexts.onclick = function(){
				window.location = this.href
				app.request()
			}	
		}
		
		var up = document.getElementById('up')
		if(p < 2 ){
			p = 2
		}
		var uurl = unescape(location.hash).replace('page='+p,'page='+(p-1))
		up.href = '#' + escape(uurl.replace('#',''))
		up.onclick = function(){
			window.location = this.href
			app.request()
		}
	}
	
app.show['findsimilar'] = function(dl)
	{	
		var viewpagelist = document.getElementById('viewpagelist')
		viewpagelist.innerHTML = ''
		
		isfindsimilar(location.hash)
				
		var lef = document.getElementById('left')
		lef.style.display = 'none'
		var lef2 = document.getElementById('left2')
		lef2.style.display = 'block'
		
		var ss = unescape(location.hash).indexOf('id=') + 3
		var ee = unescape(location.hash).indexOf(',',ss)
		if(ee<0){
			var ee = unescape(location.hash).indexOf('}')
		}
		var sid = parseInt(unescape(location.hash).substring(ss,ee))
		//alert(app.dl[0].id)		
		if(app.dl[0].id == sid){
			var gname = document.getElementById('goods-name')
			gname.innerHTML = app.dl[0].name
			var gpic = document.getElementById('g-pic')
			
			var type = app.args['category']
			gpic.src = '/image/'+type+'/imageLRG/'+sid+'_0.jpg'
			var gadurl = document.getElementById('g-pic-adurl')
			gadurl.href = app.dl[0].adurl
			var gprice = document.getElementById('goods-price')
			gprice.innerHTML = app.dl[0].price
			
			var gfrom = document.getElementById('g-from')
			gfrom.src = '/image/site/' + app.dl[0].site + '.gif'
			
			var gurl = document.getElementById('g-from-url')
			gurl.href = app.dl[0].adurl
			
			var gbuy = document.getElementById('g-buy')
			gbuy.href = app.dl[0].adurl
		
			var glook = document.getElementById('g-look')
			glook.href = '#' + escape('category=' + app.args['category'] + '&view=describe&oargs={id=' + app.dl[0].id + '}')
			
			glook.onclick = function(){
				window.location = this.href
				app.request()
			}
		}
		//nowurl = location.href
		view = document.createElement('div')
		view.className = 'site-listview'
		app.dl = app.dl.sort(function(a,b){return a.phog > b.phog})
		
		var s = unescape(location.hash).indexOf('page=') + 5
		var e = unescape(location.hash).indexOf(',',s)
		var p = parseInt(unescape(location.hash).substring(s,e))
		if(s<5){
			var s = unescape(unescape(location.hash)).indexOf('page=') + 5
			var e = unescape(unescape(location.hash)).indexOf(',',s)
			var p = parseInt(unescape(unescape(location.hash)).substring(s,e))
		}
		
		app.showpage(view,p)
		//alert(view)
		
		sec = document.getElementById('p-numpre')		
		sec.innerHTML = '显示：[&nbsp;'+((p-1)*prenum+1)+'&nbsp;-&nbsp;'+(p*prenum)+'&nbsp;]'
		
		var smallpic = document.getElementById('smallpic')
		var ss = unescape(location.hash).indexOf('id=') + 3
		var ee = unescape(location.hash).indexOf(',',ss)
		if(ee<0){
			var ee = unescape(location.hash).indexOf('}')
		}
		var sid = unescape(location.hash).substring(ss,ee)
		var type = app.args['category']
		smallpic.src = '/image/'+type+'/image/'+sid+'.jpg'
		
		var viewpagelist = document.getElementById('viewpagelist')
		viewpagelist.appendChild(view)
		var nexts = document.getElementById('nexts')		
		//nexts.href = '#' + 
		var url = unescape(location.hash).replace('page='+p,'page='+(p+1))
		//alert(url)
		nexts.href = '#' + escape(url.replace('#',''))
		nexts.onclick = function(){
			
			window.location = this.href
			app.request()
		}	
		
		var up = document.getElementById('up')
		if(p < 2 ){
			p = 2
		}
		var uurl = unescape(location.hash).replace('page='+p,'page='+(p-1))
		up.href = '#' + escape(uurl.replace('#',''))
		up.onclick = function(){
			window.location = this.href
			app.request()
		}
	}

app.request_proxy = function(jsonsrc)
	{	
		var head = document.getElementsByTagName("head")[0];
		var script = document.createElement("script");
		script.src = jsonsrc
		script.onload = script.onreadystatechange = function(){
			if (!this.readyState || this.readyState == "loaded" ||
				this.readyState == "complete") {
				setTimeout(function(){
					head.removeChild(script);
				},50);
			}
		};
		head.appendChild(script); 
	}
app.request = function()
	{
		iscolorsite(location.hash)
		isfindsimilar(location.hash)
		iswomen()
		
		var temp = unescape(location.hash).replace('#','').split('&')		
		if(temp[0] != ''){
			for(var i in temp)
			{
				var t = temp[i].split('=')
				if(t.length == 2)
				{ 
					app.args[t[0]] = t[1]
				}else{
					var tt = temp[i].split('={')
					//alert(tt[0])
					app.args['oargs']={}
					var item = tt[1].replace('}','').split(',')
					
					for(var j in item){				
						var a = item[j].split('=')
						if(a.length == 2){ app.args[tt[0]][a[0]] = a[1]}
					}				
				}
			}
		}
		if(!('category' in app.args))
		{
			window.location = '#category=womenshoe&view=scan&oargs={page=1,row=' + preheight + ',col=' + prewidth + '}'
			app.request()
		}
		if(!('view' in app.args))
		{
			window.location = '#category=womenshoe&view=scan&oargs={page=1,row=' + preheight + ',col=' + prewidth + '}'
			app.request()
		}
		if(!('oargs' in app.args))
		{
			window.location = '#category=womenshoe&view=scan&oargs={page=1,row=' + preheight + ',col=' + prewidth + '}'
			app.request()
		}					
		
		temp = new Array()
		temp1 = new Array()
		temp2 = new Array()		
		for(var key in app.args){
			if(key == 'num'){continue;}
			if(key != 'oargs'){
				temp.push('%22'+key+'%22:%22'+app.args[key]+'%22')
			}else{
				temp1.push(',%22' + key + '%22:{')
				for(var k in app.args[key]){
					temp2.push('%22'+k+'%22:%22'+app.args[key][k]+'%22')
				}
			}
		}		
		var url = '/api/?{'+temp.join(',')+temp1.join(',')+temp2.join(',')+'}}'
		app.request_proxy(url)
		//alert(url)
		if(location.hash.indexOf('&')<0){
			location.hash = unescape(location.hash)
			app.request()
		}else{
		var newurl = location.hash.replace('#','')
		
		newurl = escape(newurl)
		location.hash = '#'+ newurl
		}
	}

app.request()

/**/
app.show['describe'] = function(dl)
	{
		iscolorsite(oldurl[num-1])
		isfindsimilar(oldurl[num-1])
		
		var filter = document.getElementById('filter')
		filter.style.display = 'block'	
		
		var mydiv = document.getElementById('mydiv')
		mydiv.style.display = 'block'		
		mydiv.style.top = dtop
		mydiv.style.left = dleft
		var type = app.args['category']
		var gpics = document.getElementById('goods-pics')
		gpics.innerHTML = ''
		var pnums = document.getElementById('pic-num')
		pnums.innerHTML = ''
		for(i = 1;i<=app.dl.imagesum;i++){
			var view = document.createElement('div')
			view.id='goods-pic'+i
			var img = document.createElement('img')
			if(app.dl.site == '4'){
				img.style.width = '380px'
				img.style.height = 'auto'
			}
			img.src = '/image/'+type+'/imageLRG/'+app.dl.id+'_'+(i-1)+'.jpg'
			view.appendChild(img)
			var view1 = document.createElement('div')
			view1.id = 'num'+i
			view1.onmouseover = function(){changeimg(this,(app.dl.imagesum))}
			var pa = document.createElement('a')
			pa.innerHTML = i
			pa.href = 'javascript:void(0)'
			view1.appendChild(pa)
			gpics.appendChild(view)
			pnums.appendChild(view1)
		}
		
		var gname = document.getElementById('goods-name1')
		gname.innerHTML = app.dl.name
		var gdesc = document.getElementById('description1')
		
		var des = app.dl.description.substring(0)
		//alert(des)
		gdesc.innerHTML = des
		var gprice = document.getElementById('goods-price1')
		gprice.innerHTML = app.dl.price
		
		var gfrom = document.getElementById('from-name')
		
		gfrom.innerHTML = "<img src='/image/site/"+(app.dl.site)+".gif'>"
		
		var buyfind = document.getElementById('buy-find')
		buyfind.style.display = 'block'
			
		var gbuy = document.getElementById('gbuy')
		gbuy.href = app.dl.adurl	
		//alert(app.dl.adurl)
		var gfind = document.getElementById('gfind')
		
		var gurl = unescape(oldurl[num-1])
		gurl = gurl.substring(gurl.indexOf('#'))
		if(gurl.indexOf('id')>0){
			var s1 = gurl.indexOf('id=') + 3
			var e1 = gurl.indexOf(',',s1)
			if(e1<0){
				var e1 = gurl.indexOf('}')
			}
			var id1 = gurl.substring(s1,e1)
			var gaurl = gurl.replace('id='+id1,'id='+app.dl.id).replace('#','')
		}else{
			var s2 = gurl.indexOf('view=') + 5
			var e2 = gurl.indexOf('&',s2)
			var view = gurl.substring(s2,e2)
			var gaurl = gurl.replace('}','').replace('#','').replace('view='+view,'view=findsimilar') + ',id=' + app.dl.id + '}'
		}
		
		gfind.href = '#' + escape(gaurl)
		
		gfind.onclick = function(){
			var mydiv = document.getElementById('mydiv')
			mydiv.style.display = 'none'
			var filter = document.getElementById('filter')
			filter.style.display = 'none'
			window.location = this.href
			app.request()
			//goUrl(num)
		}
		filter.onclick = function(){closediv()}
	}
changeimg = function(obj,sum)
	{
		//alert(obj.id)
		var n = parseInt(obj.id.replace('num',''))
		for(i = 1;i<=sum;i++){
			var view = document.getElementById('goods-pic'+i)
			var view1 = document.getElementById('num'+i)
			//alert(view)
			if(i==n){
				view.style.display = 'block'
				view1.style.background = 'url(images/select.jpg) no-repeat'
			}else{
				view.style.display = 'none'
				view1.style.background = 'url(images/pic-bg.jpg) no-repeat'
			}
		}
	}
/*高级设置中颜色，网站item的添加*/
appends = function()
	{
		web = document.getElementById('websites')
		for(var i in websitename){			
			view = document.createElement('a')			
			view.setAttribute('dt',i)
			var img = document.createElement('img')
			img.src = '/image/site/'+i +'.gif'
			view.appendChild(img)
			view.onclick = function(){findwebsite(this)}
			br = document.createElement('br')
			web.appendChild(view)
			web.appendChild(br)
			view.onmouseover = function(){fontchange(this)}
			view.onmouseout = function(){fontclear(this)}
		}	
		
		color = document.getElementById('colors')
		color.innerHTML = ''
		for(var i in colorsname){
			var view = document.createElement('div')
			view.setAttribute("dt",i)
			view.style.backgroundColor = 'rgb('+ colorsname[i] +')'
			view.onclick = function(){findcolor(this)}
			color.appendChild(view)
		}		
	}

/*颜色查找*/
findcolor = function(obj)
	{	
		var n = obj.getAttribute('dt')
		var st = document.getElementById('s-t')
		st.style.display = 'none'
		var colorweb = document.getElementById('color-website')
		colorweb.style.display = 'block'
		var labelc = document.getElementById('label-color')
		labelc.style.display = 'block'
		var labelcb = document.getElementById('label-color-b')
		labelcb.style.backgroundColor = 'rgb(' + colorsname[n] + ')'

		var img1 = document.getElementById('label_img1')
		img1.onclick = function(){closefindcolor()}
		
		var shc = document.getElementById('sh-content')
		shc.style.display = 'none'
	
		var url = unescape(location.href)
		
		if(url.indexOf('color=')>0){
			var s = url.indexOf('color=') + 6
			var e = url.indexOf('}')
			var c = parseInt(url.substring(s,e))
			//alert(c)
			url = url.replace('color='+c,'color='+(n-1))
		}else{
			url = url.replace('}','') + ',color=' + (n-1) + '}'
			//alert(url)
		}
		if(url.indexOf('findsimilar')>0){
			/*var s = url.indexOf('view=') + 5
			var e = url.indexOf('&',s)
			var f = url.substring(s,e)*/
			var s1 = url.indexOf('id=') + 3
			var e1 = url.indexOf(',',s1)
			if(e1<0){
				e1 = url.indexOf('}')
			}
			id = url.substring(s1,e1)
			url = url.replace('findsimilar','scan').replace(',id='+id,'')
		}
		var s = url.indexOf('page=') + 5
		var e = url.indexOf(',',s)
		var p = parseInt(url.substring(s,e))
		url = url.replace('page='+p,'page=1')
		location.href = url
		app.request()
	}
/*关闭颜色查找*/
closefindcolor = function()
	{
		//alert(location.href)
		var labelc = document.getElementById('label-color')
		labelc.style.display = 'none'
		var url = unescape(location.href)
		//alert(url)
		var s = url.indexOf('color=') + 6
		var e = url.indexOf('}')
		var c = parseInt(url.substring(s,e))
		
		var s = unescape(location.hash).indexOf('page=') + 5
		var e = unescape(location.hash).indexOf(',',s)
		var p = parseInt(unescape(location.hash).substring(s,e))
		
		url = url.replace(',color='+c,'').replace('page='+p,'page=1')
		location.href = url
		app.request()
	}
/*网站查找*/
findwebsite = function(obj)
	{	
		var n = obj.getAttribute('dt')
		var st = document.getElementById('s-t')
		st.style.display = 'none'
		var colorweb = document.getElementById('color-website')
		colorweb.style.display = 'block'
		var labelw = document.getElementById('label-website')
		labelw.style.display = 'block'
		/*var labelwn = document.getElementById('label-website-name')
		labelwn.innerHTML = websitename[n]*/
		
		var img2 = document.getElementById('closeweb')
		img2.onclick = function(){closefindweb()}
		
		var shc = document.getElementById('sh-content')
		shc.style.display = 'none'		
		var url = unescape(location.href)
		if(url.indexOf('site=')>0){
			var s = url.indexOf('site=') + 5
			var e = url.indexOf('}')
			var c = parseInt(url.substring(s,e))
			url = url.replace('site='+c,'site='+(n))
		}else{
			url = url.replace('}','') + ',site=' + (n) + '}'
			//alert(url)
		}
		var s = url.indexOf('page=') + 5
		var e = url.indexOf(',',s)
		var p = parseInt(url.substring(s,e))
		url = url.replace('page='+p,'page=1')
		location.href = url
		app.request()
	}
/*关闭网站查找*/
closefindweb = function()
	{
		var labelw = document.getElementById('label-website')
		labelw.style.display = 'none'
		var url = unescape(location.href)
		var s = url.indexOf('site=') + 5
		var e = url.indexOf('}')
		var c = parseInt(url.substring(s,e))
		
		var s = unescape(location.hash).indexOf('page=') + 5
		var e = unescape(location.hash).indexOf(',',s)
		var p = parseInt(unescape(location.hash).substring(s,e))
		
		url = url.replace(',site='+c,'').replace('page='+p,'page=1')
		location.href = url
		app.request()
	}
/*关闭相似查找*/
closesimilar = function()
	{
		var findsim = document.getElementById('findsimilar')
		findsim.style.visibility = 'hidden'
		var furl = unescape(location.hash)
		var fs = furl.indexOf('view=') + 5
		var fe = furl.indexOf('&',fs)
		var fview = furl.substring(fs,fe)
		var fs1 = furl.indexOf('id=') + 3
		var fe1 = furl.indexOf(',',fs1)
		
		var s = unescape(location.hash).indexOf('page=') + 5
		var e = unescape(location.hash).indexOf(',',s)
		var p = parseInt(unescape(location.hash).substring(s,e))
	
		if(fe1<0){
			var fe1 = furl.indexOf('}')
		}
		fid = furl.substring(fs1,fe1)
		location.hash = furl.replace(fview,'scan').replace(',id='+fid,'').replace('page='+p,'page=1')
		app.request()		
	}

/*高级设置中字体的设置*/
fontchange = function(obj)
	{
		obj.style.color = '#FF6600'
		obj.style.textDecoration = 'underline'
	}
fontclear = function(obj)
	{
		obj.style.color = '#3366CC'
		obj.style.textDecoration = 'none'
	}
appends()

/*标签女鞋*/
women = function(obj)
	{
		document.getElementById('title-women').style.fontFamily = '黑体'
		document.getElementById('title-women').style.fontWeight = 'bolder'
		document.getElementById('title-men').style.fontFamily = '宋体'
		document.getElementById('title-men').style.fontWeight = 'normal'
		
		obj.href = '#' + escape('category=womenshoe&view=scan&oargs={page=1,row=' + preheight + ',col=' + prewidth + '}')
		window.location = obj.href
		app.request()
	}
/*标签男鞋*/
men = function(obj)
	{
		document.getElementById('title-men').style.fontFamily = '黑体'
		document.getElementById('title-men').style.fontWeight = 'bolder'
		document.getElementById('title-women').style.fontFamily = '宋体'
		document.getElementById('title-women').style.fontWeight = 'normal'
		
		obj.href = '#' + escape('category=menshoe&view=scan&oargs={page=1,row=' + preheight + ',col=' + prewidth + '}')
		window.location = obj.href
		app.request()
	}
/*fontcss = function(obj)
	{
		obj.style.fontFamily = '黑体'
		obj.style.fontWeight = 'normal'
	}*/

/*回退*/
goback = function()
	{	
		//history.back()
		if(num > 1){
			var n = num - 2			
		}else{
			var n = 0
		}
		if(num == 'undefined'){
			num = 0
		}		
		location.href = oldurl[n]		
		num = num - 2		
		app.request()	
	}
/*重新开始*/	
reback = function()
	{			
		location.hash = '#category=' + app.args.category + '&view=scan&oargs={page=1,row=' + preheight + ',col=' + prewidth + '}'		
		app.request()		
	}
/*高级设置的浮动div*/	
filterdiv = function()
	{
		shc = document.getElementById('sh-content')
		shc.style.display = "block"
		shc.style.zIndex = 10
	}
/*关闭高级设置浮动div*/		
closefilterdiv = function()
	{
		shc = document.getElementById('sh-content')
		shc.style.display = "none"
	}
/*产品的简单介绍--浮动div*/
function flowdiv(obj,n)
	{
		var flow = document.getElementById('flowdiv')
		flow.style.display = 'block'		
		var a = obj.offsetTop + 55
		var b = obj.offsetLeft + 90
		if (window.ActiveXObject) {
			a = obj.parentNode.offsetTop + 55
			b = obj.parentNode.offsetLeft + 90
			a = a + 95       // IE
			b = b + 275			
		}
		//alert(a)
		if((n + 1) % prewidth == 0){
			if (window.ActiveXObject) {				
				b = b - 265    // IE
			}else{
				b = b - 265
			}
		}
		if(n >= prewidth*(preheight-1)){
			if (window.ActiveXObject) {				
				a = a - 70				
			}else{
				a = a - 70
			}			
			b = b + 22
			if(n ==prewidth*preheight-1){
				b = b - 50
			}
		}		
		flow.style.top = a + 'px' 
		flow.style.left = b + 'px'
		obj.style.border = '2px solid #cccccc'
		flow.onmousemove = function(){myflowdiv(n)}
		flow.onmouseout = function(){closeflowdiv1()}
		var sname = document.getElementById('sname')
		if(!n){
			n = parseInt(obj.getAttribute('dt'))
		}
		
		try
		{
		  	var name1 = app.dl[n].name
			var price1 = app.dl[n].price
			var site1 = app.dl[n].site
			sname.innerHTML = name1
			var sprice = document.getElementById('sprice')
			sprice.innerHTML = price1
			var frompic = document.getElementById('from-pic')
			
			frompic.src = '/image/site/' + site1 + '.gif'
			//alert(app.dl[n].site)

		}catch(e)
		{
		  //alert("未定义");
		}
		
		
		/*if(app.dl[n].name == "undefined"){
			//alert(app.dl[n].name)
		}else{
			//alert(typeof(app.dl[n].name))
			var name1 = app.dl[n].name
			var price1 = app.dl[n].price
			var site1 = app.dl[n].site
			sname.innerHTML = name1
			var sprice = document.getElementById('sprice')
			sprice.innerHTML = price1
			var frompic = document.getElementById('from-pic')
			
			frompic.src = '/image/site/' + site1 + '.gif'
			//alert(app.dl[n].site)
		}*/
	}
myflowdiv = function(n)
	{	
		var flow = document.getElementById('flowdiv')
		flow.style.display = 'block'
		
		findgoods = document.getElementById('sfind-pic')
		try{
		var furl = unescape(location.hash)
		if(furl.indexOf('id')>0){
			var s1 = furl.indexOf('id=') + 3
			var e1 = furl.indexOf(',',s1)
			if(e1<0){
				var e1 = furl.indexOf('}')
			}
			var id1 = furl.substring(s1,e1)
			var faurl = furl.replace('id='+id1,'id='+app.dl[n].id).replace('#','')
		}else{
			var s2 = furl.indexOf('view=') + 5
			var e2 = furl.indexOf('&',s2)
			var view = furl.substring(s2,e2)
			
			var faurl = furl.replace('}','').replace('#','').replace('view='+view,'view=findsimilar') + ',id=' + app.dl[n].id + '}'
			//var faurl = furl.replace('}','').replace('#','') + ',id=' + app.dl[n].id + '}'
		}			
		//alert(faurl)
		findgoods.href = '#' + escape(faurl)
		findgoods.onclick = function(){
			closeflowdiv1()
			var filter = document.getElementById('filter')
			filter.style.display = 'none'
			window.location = this.href
			app.request()
			mydiv.style.display = 'none'
			filter.style.display = 'none'
			document.body.scrollTop = 0
		}

		lookgoods = document.getElementById('slook-pic')
		//nowurl = location.href
		var type = app.args['category']
		
		lookgoods.href = '#' + escape('category='+ type + '&view=describe&oargs={id='+ app.dl[n].id +'}')
		lookgoods.onclick = function(){
			window.location = this.href			
			//location.hash = '#category=' + type + '&view=describe&oargs={id=' + app.dl[n].id + '}'
			app.request()
		}
		}catch(e){
		
		}
	}
/*产品简介浮动div中相似查找*/
function goUrl(num)
	{	
		closeflowdiv1()
		var filter = document.getElementById('filter')
		filter.style.display = 'none'
		location.hash = '#category='+ app.args.category +'&view=findsimilar&oargs={page=1,row=' + preheight + ',col=' + prewidth + ',id=' + app.dl[num].id + '}'
		//alert(location.href)
		app.request()	
		mydiv.style.display = 'none'
		filter.style.display = 'none'
		document.body.scrollTop = 0
	}

closediv = function()
	{
		
		
		var mydiv = document.getElementById('mydiv')
		mydiv.style.display = 'none'
		var filter = document.getElementById('filter')
		filter.style.display = 'none'
		location.href = oldurl[num-1]
		//alert(oldurl[num-1])
		app.request()
	}

closeflowdiv = function(obj)
	{
		var flow = document.getElementById('flowdiv')
		flow.style.display = 'none'
		obj.style.border = '2px solid #ffffff'
	}
closeflowdiv1 = function()
	{
		var flow = document.getElementById('flowdiv')
		flow.style.display = 'none'		
	}
/*联系 帮助*/
function phone()
	{
		var three = document.getElementById('three')	
		three.style.display = 'none'
		var lef2 = document.getElementById('left2')
		lef2.style.display = 'none'
		var sh = document.getElementById('sh')
		sh.style.display = 'none'
		var page = document.getElementById('page')
		page.style.display = 'none'
		var lef = document.getElementById('left')
		lef.style.display = 'block'
		var hel = document.getElementById('help-phone')
		hel.style.display = 'block'
		/*var des = document.getElementById('goodsdescription')
		des.innerHTML = ''*/
		
		var viewlist = document.getElementById('viewpagelist')
		viewlist.style.display = "none"
		var cont = document.getElementById('help-content')
		cont.style.display = 'block'
		
		var phon = document.getElementById('phone')
		phon.style.color = "#ffffff";
		
		var help = document.getElementById('help')
		help.style.color = "#666666"
	}
function helpme()
	{
		var lef = document.getElementById('left')
		lef.style.display = 'block'
		var hel = document.getElementById('help-phone')
		hel.style.display = 'block'
		var three = document.getElementById('three')	
		three.style.display = 'none'
		var lef2 = document.getElementById('left2')
		lef2.style.display = 'none'
		var sh = document.getElementById('sh')
		sh.style.display = 'none'
		var page = document.getElementById('page')
		page.style.display = 'none'
		/*var des = document.getElementById('goodsdescription')
		des.innerHTML = ''*/
		
		var viewlist = document.getElementById('viewpagelist')
		viewlist.style.display = "none"
		var cont = document.getElementById('help-content')
		cont.style.display = 'block'
		
		var phon = document.getElementById('phone')
		phon.style.color = "#666666";
		
		var help1 = document.getElementById('help')
		help1.style.color = "#ffffff"
	}
	-->
