
function shiti_cang_s(stuid,juan_id,id,shititype)
{
	 	var get_id;
		var retCode;
		var myobja;
		var url;
	    url=window.location.href;
        //alert(window.location.href);
        var point;
	    point=url.lastIndexOf('/')+1;
        var strstr= url.substring(0,point);
		
        myurl=strstr+"cang_s.php?stuid="+stuid;
		myurl=myurl+"&juan_id="+juan_id;
		myurl=myurl+"&id="+id;
        myurl=myurl+"&shititype="+shititype;
		//alert(page);
		//alert(myurl);
        retCode=openUrl(myurl); 
		retCode=trim(retCode);
        //alert("服务器返回值："+retCode);
		if (retCode=='1')
		{
			myobja=document.getElementById("div_cang_s"+id);
			myobja.innerHTML="<font color=#ffffff>"+"已取消"+"</font>";
			
		}
		if (retCode=='0')
		{
			
			myobja=document.getElementById("div_cang_s"+id);
			myobja.innerHTML="<font color=#ffffff>"+"已收藏"+"</font>";
			
		}
		
	   
       return; 
	
}


function shiti_sign_s(stuid,juan_id,id,shititype)
{
	 	var get_id;
		var retCode;
		var myobja;
		var url;
	    url=window.location.href;
        //alert(window.location.href);
        var point;
	    point=url.lastIndexOf('/')+1;
        var strstr= url.substring(0,point);
		
        myurl=strstr+"sign_s.php?stuid="+stuid;
		myurl=myurl+"&juan_id="+juan_id;
		myurl=myurl+"&id="+id;
        myurl=myurl+"&shititype="+shititype;
		//alert(page);
		//alert(myurl);
        retCode=openUrl(myurl); 
		retCode=trim(retCode);
        //alert("服务器返回值："+retCode);
		if (retCode=='1')
		{
			myobja=document.getElementById("div_sign_s"+id);
			myobja.innerHTML="<font color=#ffffff>"+"已取消"+"</font>";
			
		}
		if (retCode=='0')
		{
			
			myobja=document.getElementById("div_sign_s"+id);
			myobja.innerHTML="<font color=#ffffff>"+"已标记"+"</font>";
			
		}
		
	   
       return; 
	
}


function strlen(str) 
{
    var len = 0;
    for (var i = 0; i<str.length;i++)
	{
      if (str.charCodeAt(i)>255) len+= 2; 
	  else 
	   len ++;
    }
    return len;
}


function openUrl(url)
 
 { 
    var objxml=new ActiveXObject("Microsoft.XMLHttp") 
    objxml.open("GET",url,false); 
    objxml.send(); 
	
    retInfo=objxml.responseText; 
    //-----------------------最重要，将%20 解码成空格，Visit W3School!") ==》Visit%20W3School%21
	retInfo=unescape(retInfo);
    if (objxml.status=="200")
	{ 
      return retInfo; 
    } 
    else
	{ 
      return "-2"; 
     } 
}

