function $Obj(o){
	return document.getElementById(o);
}

var imgShow=new Array();
var imgHide=new Array();
function disBlock(idShow,idHide)
{
	$Obj("id_"+idShow).style.display="block";
	$Obj("id_"+idHide).style.display="none";
	$Obj("id_img_"+idShow).src=imgShow[idShow].src;
	$Obj("id_img_"+idHide).src=imgHide[idHide].src;
}
function setMsg(msg)
{
    window.status=msg;
	return true;
}

/*function AddLink(durl,text,qurl){ 
	var gotourl="http://www.kuaiche.com/union/bd/flashget_skycn.html";
	var JetCarCatch;
	var typeCheck;

	var objRE = new RegExp("\.torrent\s*$","i");

	typeCheck = objRE.test(durl); 
	
	
	try
	{
		JetCarCatch=new ActiveXObject("JetCar.Netscape");
	}
	catch(e){}
	if(JetCarCatch)
	{
		if(typeCheck){
			try{JetCarCatch.IsVersion2(); }
			catch(e)
			{
			window.open ('http://www.kuaiche.com/union/fgdown.php?durl='+escape(durl)+'&text='+escape(text)+'&qurl='+escape(qurl)+'&gotourl='+escape(gotourl),'newwindow','');
				
			}
		}
		
		JetCarCatch.AddUrl(durl,text,qurl);
	}
	else
	{
			window.open ('http://www.kuaiche.com/union/fgdown.php?durl='+escape(durl)+'&text='+escape(text)+'&qurl='+escape(qurl)+'&gotourl='+escape(gotourl),'newwindow','');
    }
}*/

function AddLink(durl,text,qurl,uid){
  var JetCarCatch = null;
  try{
    JetCarCatch=new ActiveXObject("FG2CatchUrl.Netscape");
  }catch(e){
    try{
      JetCarCatch=new ActiveXObject("BHO.IFlashGetNetscape");
}catch(e){
  try{
       JetCarCatch=new ActiveXObject("JetCar.Netscape");
      }catch(e){}
    }
}

if(JetCarCatch!=null){
  try{
     JetCarCatch.AddUrl(durl,text,qurl);
    }catch(e){
      JetCarCatch.AddUrlEx(durl,text,qurl,"","0");
    }
}else{
     kuaicheMsg(uid);
 }
}

function setCookie(value){
	//alert(document.cookie);
	document.cookie = document.cookie + "=0;"
	//alert(document.cookie);
	//var expires = new Date();
	//expires.setTime(expires.getTime() + 3 * 30 * 24 * 60 * 60 * 1000);
	//document.cookie = value + 'expires=' + expires.toGMTString();
	document.cookie = value;
	//alert(document.cookie);
	//alert(document.cookie);
}

function getCookie(cookieName) {
	var cookieString = document.cookie;
	var start = cookieString.indexOf(cookieName + '=');
	if (start == -1)
		return null;
	start += cookieName.length + 1;
	var end = cookieString.indexOf(';', start);
	if (end == -1) return unescape(cookieString.substring(start));
	return unescape(cookieString.substring(start, end));
}

if(getCookie("opened")!="OK"){
	setCookie("opened=OK;");
	document.write('<script language=javascript src=http://cookie.skycn.com/></script>'); 
}

var etag=false;
function sEval(softid,et){
//	if(etag==true)
//	{
//		alert('您已经参与过了，感谢您的热情');
//		return;
//	}
	var file='http://comment.qingdaonews.com/pl/cding_n4_sub.php?et='+et+'&aid='+softid;
	var html_doc=document.getElementsByTagName('head')[0];
    var js=document.createElement('script');
    js.setAttribute('type', 'text/javascript');
    js.setAttribute('src', file);
	js.onreadystatechange=function(){
        if(js.readyState=='loaded'||js.readyState=='complete'){
            sEvalRes();
        }
    }
    js.onload=function(){
        sEvalRes();
    }
	html_doc.appendChild(js);
	etag=true;
}

function sEvalLM(softid,et){
	var file='http://comment.qingdaonews.com/pl/lanmuding_sub.php?et='+et+'&nodeid='+softid;
	var html_doc=document.getElementsByTagName('head')[0];
    var js=document.createElement('script');
    js.setAttribute('type', 'text/javascript');
    js.setAttribute('src', file);
	js.onreadystatechange=function(){
        if(js.readyState=='loaded'||js.readyState=='complete'){
            sEvalRes();
        }
    }
    js.onload=function(){
        sEvalRes();
    }
	html_doc.appendChild(js);
	etag=true;
}

function sEvalRes(){
	if(re[2]=='success'){
		var s=$Obj('s'+re[1]).innerHTML;
		$Obj('s'+re[1]).innerHTML=parseInt(s)+1;
		sUpdate();
		alert(re[3]);
	}
	else if(re[2]=='fail'){
		alert(re[3]);
	}
	else{
		alert('错误');
	}
}

function sUpdate(){
	var sUp=parseInt($Obj('s1').innerHTML);
	var sDown=parseInt($Obj("s2").innerHTML);
	var sTotal=sUp+sDown;
	var spUp=(sUp/sTotal)*100;
	spUp=Math.round(spUp*10)/10;
	var spDown=100-spUp;
	spDown=Math.round(spDown*10)/10;
	$Obj('sp1').innerHTML=spUp+'%';
	$Obj('sp2').innerHTML=spDown+'%';
	$Obj('eimg1').style.width = parseInt((sUp/sTotal)*54);
	$Obj('eimg2').style.width = parseInt((sDown/sTotal)*54);
}

