function mousePageXY(e){
  x = 0;
  y = 0;
  if (!e) e = window.event;
  if (e.pageX || e.pageY)  {
    x = e.pageX;
    y = e.pageY;
  }
  else if (e.clientX || e.clientY)  {
    x = e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft;
    y = e.clientY + (document.documentElement.scrollTop || document.body.scrollTop) - document.documentElement.clientTop;
  }
  return {"x":x, "y":y};
}


var resize = {
	onMOver : function(obj2) {
		if (!resize.obj) return;
		resize.obj_inner.style.background=obj2.style.background;
		resize.obj.className='ava_preview';
		
		resize.obj.style.left=resize.mleft-170;
		resize.obj.style.top=resize.mtop-170;
	},
	onMOut : function() {
		if (!resize.obj) return;
		resize.obj.className='hider';
	},
	dragMousemove: function(ev) {
		resize.mleft =mousePageXY(ev).x;
		resize.mtop = mousePageXY(ev).y;
		
		if (resize.obj){		
			resize.obj.style.left=resize.mleft-170;
			resize.obj.style.top=resize.mtop-170;
		}		
	},
	init : function() {
		resize.obj=document.createElement('DIV');
		document.body.appendChild(resize.obj);

		resize.obj_inner2=document.createElement('DIV');
		resize.obj.appendChild(resize.obj_inner2);

		resize.obj_inner=document.createElement('DIV');
		resize.obj.appendChild(resize.obj_inner);

		resize.obj.className='dhider ava_preview';
		resize.obj_inner2.className='ava_preview_inner2';
		resize.obj_inner.className='ava_preview_inner';
	}
}


if (IE) window.attachEvent("onload",function(){resize.init()})
else window.addEventListener("load",function(){resize.init()},true)


if (IE || OP){document.attachEvent("onmousemove", resize.dragMousemove);}
else{document.addEventListener("mousemove", resize.dragMousemove,true);}


var resizevk = {
	onMOver : function(o) {
		if (!resizevk.obj) return;

		resizevk.obj_inner2.src=o.src;
		resizevk.obj.className='ava_previewvk';
		
		resizevk.obj.style.left=resizevk.mleft-230; 
		resizevk.obj.style.top=resizevk.mtop-170;
	},
	onMOut : function() {
		if (!resizevk.obj) return;
		resizevk.obj.className='hider';
	},
	dragMousemove: function(ev) {
		resizevk.mleft =mousePageXY(ev).x;
		resizevk.mtop = mousePageXY(ev).y;
		
		if (resizevk.obj){		
			resizevk.obj.style.left=resizevk.mleft-230;
			resizevk.obj.style.top=resizevk.mtop-170;
		}		
	},
	init : function() {
		resizevk.obj=document.createElement('DIV');
		document.body.appendChild(resizevk.obj);

		resizevk.obj_inner2=document.createElement('IMG');
		resizevk.obj.appendChild(resizevk.obj_inner2);

		resizevk.obj.className='dhider ava_previewvk';
	}
}

if (IE || OP){document.attachEvent("onmousemove", resizevk.dragMousemove);}
else{document.addEventListener("mousemove", resizevk.dragMousemove,true);}

if (IE) window.attachEvent("onload",function(){resizevk.init()})
else window.addEventListener("load",function(){resizevk.init()},true)





if (IE)
         window.attachEvent("onload",function(){scroll.arrinit()})
else
         window.addEventListener("load",function(){scroll.arrinit()},true)

		

//##### Òýãè #######################################################

stags={
	open:function(){
	//	clearTimeout(stags.openTO);
		$("."+stags.cls).toggle("100");
	},
	init:function(){
		var b=$('#subtags_show_button');
		if (b){
			stags.cls=b.attr('rel');
			stags.count=b.attr('stcount');
			stags.tags=b.attr('tags');
			stags.items_count=b.attr('items_count');
			stags.items_onpage=b.attr('items_onpage');
			
		//	stags.openTO=setTimeout(stags.open,2500);
			
			if (stags.tags=='') stags.open(); 
			b.click(stags.open);
		}
	}

}

$(function(){
	stags.init();
});

