﻿// JavaScript Document
$(function(){
	$("#content-body img").each(function(){
	var width=660;
        var image = $(this);
       	if(image.width()>width)
    	{
		image.width(width);
		image.height(width/image.width()*image.height());
		image.wrap("<a href='"+image.attr("src")+"' target='_blank' title='点击图片查看原图'></a>").css("border","0")
	}
	})
	
})

$(function(){
	$("ul.page-navbar li[id="+System.Page.UID+"]").addClass("current");		   
})


$(function(){
	$('.rater').each(function(){
		var url=$(this).attr('url');
		$(this).rater(url,
					  {maxvalue:5,curvalue:2,title:{1:'一般',2:'还不错',3:'不错',4:'很好',5:'太好了'}},
					  function(el,value,res){
						  //var d=System.Msg.HtmlToJson(res);
						  System.Msg.Show(res);
						}
		);				  
	})
})

/*$(function(){
	$("#score-it").click(function(){
		if(System.User.UserName==""){
			top.System.Dialog.Error("请先登陆","只有注册用户才能对文章进行评分，请先登陆");
		}else{
			var url=$(this).attr('href');
			top.System.Dialog.Open('打分',url,{id:'score',width:'450px'})	
		}
		return false;
	})
})*/