
function fun(obj,regname,reg_name,Existence,notnull,Success)
  {
       var xmlhttp;
       var xmlObject;
       var xmlreg_name=reg_name.value;
       try{
			xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
		}catch(e){
			try{
				xmlhttp=new ActiveXObject('Msxml2.XMLHTTP');
			}catch(e){
				try{
					xmlhttp=new XMLHttpRequest();
				}catch(e){
					alert(e);
				}
			}
		}
		
	      xmlhttp.open("post",regname+xmlreg_name);
		  xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		  xmlhttp.onreadystatechange=function(){
          if(xmlhttp.readyState==4)
          { 
          
             if(xmlhttp.status == 200)
             {               
                xmlObject=xmlhttp.responseText;    
              
                if(xmlObject==0)
                {
                  //cunzai
                  conf.innerHTML='<font color="red" size="2">'+Existence+'</font>';
                  return false;
                }
                else if(xmlObject==2)
                {
                //notnull
                  conf.innerHTML='<font color="red" size="2">'+notnull+'</font>'
                  return false;
                }
                else 
                {
				//chenggong
						var form = document.forms[1];
					 form.istrue.value = "sucess";
					// alert(form.istrue.value);
                   conf.innerHTML='<font color="green" size="2">'+Success+'</font>';
                    return true;
                }
               	
             }
             else
             {
                alert("没有连接成功");
             }
          }
        
        }
        //document.forms[0].optCity.focus();
		xmlhttp.send(null);
		
    }
    
    
    
    
    function funadmin(obj,regname,reg_name,Existence,notnull,Success)
  {
       var xmlhttp;
       var xmlObject;
       var xmlreg_name=reg_name.value;
       try{
			xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
		}catch(e){
			try{
				xmlhttp=new ActiveXObject('Msxml2.XMLHTTP');
			}catch(e){
				try{
					xmlhttp=new XMLHttpRequest();
				}catch(e){
					alert(e);
				}
			}
		}
	      xmlhttp.open("post",regname+xmlreg_name);
		  xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		  xmlhttp.onreadystatechange=function(){
          if(xmlhttp.readyState==4)
          { 
          
             if(xmlhttp.status == 200)
             {               
                xmlObject=xmlhttp.responseText;    
              
                if(xmlObject==0)
                {
                  //cunzai
                  conf.innerHTML='<font color="red" size="2">'+Existence+'</font>';
                  return false;
                }
                else if(xmlObject==2)
                {
                //notnull
                  conf.innerHTML='<font color="red" size="2">'+notnull+'</font>'
                  return false;
                }
                else 
                {
				//chenggong
						var form = document.forms[0];
					 form.istrue.value = "sucess";
					// alert(form.istrue.value);
                   conf.innerHTML='<font color="green" size="2">'+Success+'</font>';
                    return true;
                }
               	
             }
             else
             {
                alert("没有连接成功");
             }
          }
        
        }
        //document.forms[0].optCity.focus();
		xmlhttp.send(null);
		
    }
    
    
   
   
function fun12(obj,regname,reg_name,Existence,notnull,Success)
  {
 
       var xmlhttp;
       var xmlObject;
       var xmlreg_name=reg_name.value;
       try{
			xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
		}catch(e){
			try{
				xmlhttp=new ActiveXObject('Msxml2.XMLHTTP');
			}catch(e){
				try{
					xmlhttp=new XMLHttpRequest();
				}catch(e){
					alert(e);
				}
			}
		}

					var id;
					var form = document.forms[1];
					id= form.idbio.value;	
	      xmlhttp.open("post",regname+xmlreg_name+"&id="+id);
		  xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		  xmlhttp.onreadystatechange=function(){
          if(xmlhttp.readyState==4)
          { 
          
             if(xmlhttp.status == 200)
             {               
                xmlObject=xmlhttp.responseText;    
              
                if(xmlObject==0)
                {
                  //cunzai
         			var form = document.forms[1];
					 form.istrue.value = "false";
                  conf.innerHTML='<font color="red" size="2">'+Existence+'</font>';
                  return false;
                }
                else if(xmlObject==2)
                {
                //notnull
                	var form = document.forms[1];
					 form.istrue.value = "false";
                  conf.innerHTML='<font color="red" size="2">'+notnull+'</font>'
                  return false;
                }
                else 
                {
				//chenggong
						var form = document.forms[1];
					 form.istrue.value = "sucess";
					// alert(form.istrue.value);
                   conf.innerHTML='<font color="green" size="2">'+Success+'</font>';
                    return true;
                }
               	
             }
             else
             {
                alert("没有连接成功");
             }
          }
        
        }
        //document.forms[0].optCity.focus();
		xmlhttp.send(null);
		
    }
    

function request(id){ 
var url = location.href; 
var paraString = url.substring(url.indexOf("?")+1,url.length).split("&"); 
var paraObj = {} 
for (i=0; j=paraString[i]; i++){ 
paraObj[j.substring(0,j.indexOf("=")).toLowerCase()] = j.substring(j.indexOf("=")+1,j.length); 
} 
var returnValue = paraObj[id.toLowerCase()]; 
if(typeof(returnValue)=="undefined"){ 
return ""; 
}else{ 
return returnValue; 
} 
}  

var cc=request('id'); 
var curl=String(window.document.location.href); 
var dd=request('jobsid');
var cd=request('courseid');
var blogid=request('newsid');
var uid = request('uid');
var modelid = request('modelid');
var section = request('section');
var sectionname = request('sectionname');
var titlename = request('titlename');
function funurl(obj,regname,reg_name,reg_name1,reg_name2,reg_name3,Existence,notnull,Success)
  {
       var form1 = document.forms[1];
       var channelid=form1.channelid.value;
       var columnid=form1.columnid.value;
       var xmlhttp;
       var xmlObject;
       var xmlreg_name=curl;
       var xmlreg_name1;
       var xmlreg_name2=channelid;
       var xmlreg_name3=columnid;

		if(cc!='')
		{       
       		xmlreg_name1=cc;
       	}
		if(dd!='')
		{       
       		xmlreg_name1=dd;
       	}
       	if(cd!=''){
       		xmlreg_name1=cd;
       	}
       	if(blogid!=''){
       		xmlreg_name1=blogid;
       	}
       	if(modelid!=''){
       		xmlreg_name1=modelid;
       	}
       	
       try{
			xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
		}catch(e){
			try{
				xmlhttp=new ActiveXObject('Msxml2.XMLHTTP');
			}catch(e){
				try{
					xmlhttp=new XMLHttpRequest();
				}catch(e){
					alert(e);
				}
			}
		}
//		var zzz='favouritesAction.do?method=faviouries&favurl='+xmlreg_name+'&id='+xmlreg_name1+'&channelid='+xmlreg_name2+'&columnid='+xmlreg_name3;
//		alert(zzz);
		var url_parameter = xmlreg_name+'&id='+xmlreg_name1+'&channelid='+xmlreg_name2+'&columnid='+xmlreg_name3;
		if(uid!=''){
			url_parameter = url_parameter + '&uid=' + uid;
		}
		if(section!=''){
			url_parameter = url_parameter + '&section=' + section;
		}
		if(sectionname!=''){
			url_parameter = url_parameter + '&sectionname=' + sectionname;
		}		
		if(titlename!=''){
			url_parameter = url_parameter + '&titlename=' + titlename;
		}			
		url_parameter = url_parameter.replace("#","");
		alert(url_parameter);
	      xmlhttp.open("post",'/favouritesAction.do?method=faviouries&favurl='+ url_parameter);
		  xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		  xmlhttp.onreadystatechange=function(){
          if(xmlhttp.readyState==4)
          { 
          
             if(xmlhttp.status == 200)
             {               
                xmlObject=xmlhttp.responseText;    
              
                if(xmlObject==0)
                {
                  //cunzai
                 alert("该页面已经存在网站书签夹了，可以在会员管理页面中的书签管理中找到!");
                  return false;
                }
                else if(xmlObject==2)
                {
                //notnull
                 alert("您还没登录，请登录");
                  return false;
                }
                else 
                {
				//chenggong
                    alert("已经成功添加到收藏夹，可以在会员管理页面中的书签管理中找到！");
                    return true;
                }
               	
             }
             else
             {
                alert("没有连接成功");
             }
          }
        
        }
        //document.forms[0].optCity.focus();
		xmlhttp.send(null);
		
    }
    //收藏的时候处理的 需要的参数 
     function tukuurl(tukuid,tukutype,leixing){  
 try{
			xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
		       }catch(e){
			   try{
				   xmlhttp=new ActiveXObject('Msxml2.XMLHTTP');
			      }catch(e){
				   try{
					   xmlhttp=new XMLHttpRequest();
				      }catch(e){
					alert(e);
				}
			}
		}
          xmlhttp.open("post",'/favouritesAction.do?method=faviouriesnew&tukuid='+tukuid+'&tukutype='+tukutype+'&leixing='+leixing);
		  xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		  xmlhttp.onreadystatechange=function(){
          if(xmlhttp.readyState==4)
          { 
          
             if(xmlhttp.status == 200)
             {               
                xmlObject=xmlhttp.responseText;    
              
                if(xmlObject==0)
                {
                  //cunzai
                 alert("该页面已经存在网站书签夹了，可以在会员管理页面中的书签管理中找到!");
                  return false;
                }
                else if(xmlObject==2)
                {
                //notnull
                 alert("您还没登录，请登录！");
                  return false;
                }
                else 
                {
				//chenggong
                    alert("已经成功添加到收藏夹，可以在会员管理页面中的书签管理中找到！");
                    return true;
                }
               	
             }
             else
             {
                alert("没有连接成功");
             }
            }
           }
        	xmlhttp.send(null);
       
        	        
}
  
    
    function bookurl(id,channelid,columnid,title,Existence,notnull,Success){
                   
            var id=id;
            var channelid=channelid;
 //           alert(channelid);
 //               channelid=<%=java.net.URLEncoder.encode("channelid")%>
            var  columnid=columnid;
  //               columnid=<%=java.net.URLEncoder.encode("columnid")%>
            var title=title;
 //               title=<%=java.net.URLEncoder.encode("title")%>
            var curl="bookshowAction.do?method=view&id="+id+"&titlename="+title;
            try{
			xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
		       }catch(e){
			   try{
				   xmlhttp=new ActiveXObject('Msxml2.XMLHTTP');
			      }catch(e){
				   try{
					   xmlhttp=new XMLHttpRequest();
				      }catch(e){
					alert(e);
				}
			}
		}
          xmlhttp.open("post",'favouritesAction.do?method=faviouries&favurl='+curl+'&id='+id+'&channelid='+channelid+'&columnid='+columnid);
		  xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		  xmlhttp.onreadystatechange=function(){
          if(xmlhttp.readyState==4)
          { 
          
             if(xmlhttp.status == 200)
             {               
                xmlObject=xmlhttp.responseText;    
              
                if(xmlObject==0)
                {
                  //cunzai
                 alert("该页面已经存在网站书签夹了，可以在会员管理页面中的书签管理中找到!");
                  return false;
                }
                else if(xmlObject==2)
                {
                //notnull
                 alert("您还没登录，请登录！");
                  return false;
                }
                else 
                {
				//chenggong
                    alert("已经成功添加到收藏夹，可以在会员管理页面中的书签管理中找到！");
                    return true;
                }
               	
             }
             else
             {
                alert("没有连接成功");
             }
            }
           }
        	xmlhttp.send(null);
    
    
    }
    
    function funcom(obj,regname,reg_name,reg_name1,reg_name2,Existence,notnull,Success)
  {
       var form1 = document.forms[0];
       var xmlhttp;
       var xmlObject;
       var xmlreg_name=content;
       var xmlreg_name1=cc;
      
       var xmlreg_name2=channelid;
       var xmlreg_name3=columnid;
      
      
       try{
			xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
		}catch(e){
			try{
				xmlhttp=new ActiveXObject('Msxml2.XMLHTTP');
			}catch(e){
				try{
					xmlhttp=new XMLHttpRequest();
				}catch(e){
					alert(e);
				}
			}
		}
	      xmlhttp.open("post",'commentAction.do?method=SignSave&content='+xmlreg_name+'&id='+xmlreg_name1+'&channelid='+xmlreg_name2);
		  xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		  xmlhttp.onreadystatechange=function(){
          if(xmlhttp.readyState==4)
          { 
          
             if(xmlhttp.status == 200)
             {               
                xmlObject=xmlhttp.responseText;    
              
                if(xmlObject==0)
                {
                  //cunzai
                 alert("该URL已经存在收藏夹了!");
                  return false;
                }
                else if(xmlObject==2)
                {
                //notnull
                 alert("请输入评论内容！！");
                  return false;
                }
                else 
                {
				//chenggong
                    alert("发表评论成功 !");
                    return true;
                }
               	
             }
             else
             {
                alert("没有连接成功");
             }
          }
        
        }
        //document.forms[0].optCity.focus();
		xmlhttp.send(null);
		
    }
    
    
    
    
    
    function funcart(id,index)
      {
    
       var xmlhttp;
       var xmlObject;
       var forms=document.forms[1];
       var id1=id;
       var bb;
       var cc=index;
   
       var xmlreg_name1;
       if(0==index)
       xmlreg_name1=forms.quanlity0.value;
       if(1==index)
       xmlreg_name1=forms.quanlity1.value;
       if(2==index)
       xmlreg_name1=forms.quanlity2.value;
       if(3==index)
       xmlreg_name1=forms.quanlity3.value;
       if(4==index)
       xmlreg_name1=forms.quanlity4.value;
       if(5==index)
       xmlreg_name1=forms.quanlity5.value;
       if(6==index)
       xmlreg_name1=forms.quanlity6.value;
       if(7==index)
       xmlreg_name1=forms.quanlity7.value;
       if(8==index)
       xmlreg_name1=forms.quanlity8.value;
       if(9==index)
       xmlreg_name1=forms.quanlity9.value;
             
       bb=xmlreg_name1;
     
       try{
			xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
		}catch(e){
			try{
				xmlhttp=new ActiveXObject('Msxml2.XMLHTTP');
			}catch(e){
				try{
					xmlhttp=new XMLHttpRequest();
				}catch(e){
					alert(e);
				}
			}
		}
	      xmlhttp.open("post",'trainAction.do?method=cartmodify&id='+id+'&qid='+bb+'&index='+cc);
		  xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		  xmlhttp.onreadystatechange=function(){
          if(xmlhttp.readyState==4)
          { 
          
             if(xmlhttp.status == 200)
             { 
            
             xmlObject=xmlhttp.responseText;      
             var list= new Array();
             list=xmlObject.split(";");
             
           
             if(0==list[0])
			 document.forms[1].quanlity0.value=list[1];
			 else if(1==list[0])
			 document.forms[1].quanlity1.value=list[1];
			 else if(2==list[0])
			 document.forms[1].quanlity2.value=list[1];
			 else if(3==list[0])
			 document.forms[1].quanlity3.value=list[1];
			 else if(4==list[0])
			 document.forms[1].quanlity4.value=list[1];
			 else if(5==list[0])
			 document.forms[1].quanlity5.value=list[1];
			 else if(6==list[0])
			 document.forms[1].quanlity6.value=list[1];
			 else if(7==list[0])
			 document.forms[1].quanlity7.value=list[1];
			 else if(8==list[0])
			 document.forms[1].quanlity8.value=list[1];
			 else if(9==list[0])
			 document.forms[1].quanlity9.value=list[1];
             else
             count.innerHTML="<B>"+xmlObject+"</B>";
               	
               	
               	
               	
             }
             else
             {
                alert("没有连接成功");
             }
          }
        
        }
        //document.forms[0].optCity.focus();
		xmlhttp.send(null);
		
    }
    
    
   function valfiter(text){
   	 var aa;
	   var xmlhttp;
       var xmlObject;
      // alert("test"+text);
       //var xmlreg_name=document.forms[1].TAGNAME.value;
       var xmlreg_name=text;
        try{
			xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
		}catch(e){
			try{
				xmlhttp=new ActiveXObject('Msxml2.XMLHTTP');
			}catch(e){
				try{
					xmlhttp=new XMLHttpRequest();
				}catch(e){
					alert(e);
				}
			  }
    		}
		
	      xmlhttp.open("post",'/commonAction.do?method=ajaxfilter&name='+xmlreg_name,false);
		  xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		  xmlhttp.onreadystatechange=function(){
          if(xmlhttp.readyState==4){
             if(xmlhttp.status == 200){
                xmlObject=xmlhttp.responseText;              
                if(xmlObject==0){
                  
                  aa= false;  
                               
                }else if(xmlObject==1){ 
                                	             
               
                   aa= true;
                }
             }else{
                alert("没有连接成功");
             }
            }
          }
        
        xmlhttp.send(null);
		 	return aa;	 				 
		 }
     

       function focusKeyword()
       {
       document.newsform.TAGNAME.value='';
       }


 function ssmit(){     
        var cc=document.newsform.TAGNAME.value;
         if(cc=="请输入关键字"){
         alert("请输入查询条件");
         return;
        }else{
        var aa=valfiter(cc);
        if(cc !="")
         {
        if(aa){
        document.newsform.target="_blank"; 
        document.newsform.action="/CenterAction.do?method=searchKeyword";
        document.newsform.submit();
		}else{
		alert('输入了非法字符');
		return;
		}
		}else
		{alert('请输入查询条件!');
		return;
		}
	 }
   }

  