var BlogSub = {
	imgID:Blog.cssID,
	changeStyle:function(cssID){
		$(blogMes.cssLinkID).href = blogMes.domain + "/css/" + cssID + "/style.css";
		var _img = document.createElement("img");
		_img.id = "selectimg";
		_img.src = blogMes.domain + "/images/setindex.gif";
		var lChild = $("item_" + this.imgID).getElementsByTagName("img");
		$("item_" + this.imgID).removeChild(lChild[1]);
		$("item_" + cssID).appendChild(_img);
		this.imgID = cssID;
		//alert($("uu_banner").offsetHeight)
		onload_a=0;onload_b=0;
		setTimeout("ccba(a,svon_h)",100);
		setTimeout("ccba(b,svony_h)",100);		
	},
	subStyle:function(){
		if(this.imgID == Blog.cssID)
		{
			this.remove();
		}else{
			var newCssID = this.imgID
			var url = uu.urlUtil.encode("/blog/controlAction!updateStyle.uu?css=" + newCssID + "&name=" + Blog.userName);
		   	var myAjax = new Ajax.Request(
			   url,
			   {
				 asynchronous: 'true',
				 method:'post',
				 //postBody: "css=" + newCssID + "&name=" + Blog.userName,
				 onSuccess:function()
				 {
				 	window.location.href = "/" + Blog.handle;
				 }
			   }
			); 
			BlogDialog.remove();
		}
	},
	remove:function(){
		BlogDialog.remove();
		this.imgID = Blog.cssID
		$(blogMes.cssLinkID).href = blogMes.domain + "/css/" + this.imgID + "/style.css";
		onload_a=0;onload_b=0;
		ccba(a,svon_h);
		ccba(b,svony_h);
	},
	updateModules:function(){
		$("loadC").style.display = "block";
		$("loadC").style.top = document.documentElement.scrollTop + 20 + "px";
		var url = uu.urlUtil.encode("/blog/controlAction!updateModuleInUser.uu?name=" + Blog.userName);
		var myAjax = new Ajax.Request(
		   url,
		   {
			 asynchronous: 'true',
			 method:'post',
			 postBody: 'modules=' + arguments[0],
			 onSuccess:function()
			 {
			 	$("loadC").style.display = "none";
			 }
		   }
		);
	}
};

function styleClear()
{
	$("blog000").style.position="absolute";
	if(Blog.styleID=='3'){
			svon_h[0]=$("blog000").offsetTop+$("blog000").offsetHeight+10;
			svony_h[0]=$("blog000").offsetTop;
			if(a.length!=0){
				$("blog"+a[0]).style.top=$("blog000").offsetTop+$("blog000").offsetHeight+10+"px";
				for(var i=1;i<a.length;i++){
					svon_h[i]=svon_h[i-1]+$("blog"+a[i]).offsetHeight+10;			
					$("blog"+a[i]).style.top=svon_h[i]+"px";
			    }
		    }
		    
		     if(b.length!=0){
				$("blog"+b[0]).style.top=svony_h[0]+"px";
				for(var i=1;i<b.length;i++){
					svony_h[i]=svony_h[i-1]+$("blog"+b[i]).offsetHeight+10;			
					$("blog"+b[i]).style.top=svony_h[i]+"px";
			    }
		      }
		   }else {
			svon_h[0]=$("blog000").offsetTop+$("blog000").offsetHeight+10;
			if(ab.length!=0){
				$("blog"+ab[0]).style.top=svon_h[0]+"px";
				for(var i=1;i<ab.length;i++){
					svon_h[i]=svon_h[i-1]+$("blog"+ab[i]).offsetHeight+10;			
					$("blog"+ab[i]).style.top=svon_h[i]+"px";
			    }
		     } 
		  }
}
