// JavaScript Document
function chanagepage(id){
  v=$F(id);
  url=window.location+"";
  if(url.indexOf("?")!=-1){
	if(url.indexOf("page=")!=-1){
        reg=/page=([0-9]){0,}/
        url=url.replace(reg,"page="+v);
	    window.location.href=url;
	}else{
		window.location.href=window.location+"&page="+v;
	}
  }else{
    window.location.href=window.location+"?page="+v;
  }
}
// JavaScript Document
function ismoney(obj){
        testisNum(obj);
    }
    function testisNum(object)
 {
   var s =document.getElementById(object.id).value;
    if(s!="")
    {
        if(s.search("^-?\\d+$")!=0)
        {
         alert("请输入整型数字");
         object.value="";
         object.focus();
        }
    }
 }

function changecolor(obj){

    if(obj.type!="text")
        obj=document.getElementById(obj);
    //if(obj.type=="text")
    //    alert(obj.style.backgroundColor);
    if (obj.style.backgroundColor =="red"){
        obj.style.backgroundColor =""
    }else{
        obj.style.backgroundColor ="red"
    }
}
function Share(type,Ttitle,url){
    var title='';  
    title=Ttitle;
    url=window.location.href;
	title=document.title;
    switch(type){
        case "qq":            
            window.open('http://shuqian.qq.com/post?from=3&title='+encodeURIComponent(title)+'&uri='+encodeURIComponent(url)+'&jumpback=2&noui=1','favit','width=930,height=470,left=50,top=50,toolbar=no,menubar=no,location=no,scrollbars=yes,status=yes,resizable=yes');
            break;
        case "sina":        
            window.open('http://v.t.sina.com.cn/share/share.php?title='+encodeURIComponent(title)+'&amp;url='+encodeURIComponent(url)+'&amp;rcontent=','_blank','scrollbars=yes,menubar=yes,location=yes,toolbar=yes,status=no,resizable=yes');            
            break;
        case "kaixin":            
            var d=document;
            var t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');
            void(kaixin=window.open('http://www.kaixin001.com/~repaste/repaste.php?&amp;rurl='+escape(url)+'&amp;rtitle='+escape(title)+'&amp;rcontent='+escape(title),'_blank','scrollbars=yes,location=yes,toolbar=yes,status=no,menubar=yes,resizable=yes','kaixin'));
            break;  
        case "renren":
            window.open('http://share.renren.com/share/buttonshare.do?title='+encodeURIComponent(title.substring(0,76))+'&amp;link='+encodeURIComponent(url)+'&amp;content=','_blank','scrollbars=yes,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes');
            break;
        case "douban":
            var u='http://www.douban.com/recommend/?url='+url+'&amp;title='+encodeURIComponent(title);
            window.open(u,'douban','toolbars=yes,resizable=1,location=yes,toolbar=yes,menubar=yes,scrollbars=yes,status=1,');
            break;  
    }  
}
