
var urlroot = "http://www.unsp.com/img/";
var tOut = -1;
var drag = false;
lastScrollY = 0;

rightDivHtml = '<div id="rightDiv" style="position:absolute; top:400px; left:50px;">';

rightDivHtml += kf_getPopupRightDivHtml();
  
rightDivHtml += '</div>';
  
document.write(rightDivHtml);  
window.setTimeout("kf_moveWithScroll()",1);



function kf_moveWithScroll() 
{ 
	 if(typeof window.pageYOffset != 'undefined') { 
        nowY = window.pageYOffset; 
     } 
     else if(typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') { 
        nowY = document.documentElement.scrollTop; 
     } 
     else if(typeof document.body != 'undefined') { 
        nowY = document.body.scrollTop; 
     }  

		percent = .1*(nowY - lastScrollY);
		if(percent > 0) 
		{
			percent=Math.ceil(percent);
		} 
		else
		{
			percent=Math.floor(percent);
		}

	 document.getElementById("rightDiv").style.top = parseInt(document.getElementById("rightDiv").style.top) + percent+"px";
	 if(document.getElementById("kfpopupDiv"))
	 {
	 	document.getElementById("kfpopupDiv").style.top = parseInt(document.getElementById("kfpopupDiv").style.top) + percent+"px";
	 }
	 lastScrollY = lastScrollY + percent;
	 tOut = window.setTimeout("kf_moveWithScroll()",1);
}

function kf_getPopupRightDivHtml()
{	
	var temp = "";

	temp += '<div class="wpa_popup" style="width:90px; height:150px;">';
  temp += '<div style="width:8px; height:150px; float:left; background:url('+urlroot+'bg_1.gif);"></div>';
  temp += '<div style="float:left; width:74px; height:150px; background:url('+urlroot+'middle.jpg); background-position: center;">';
  temp += '<div ><h1 style="line-height:17px; font-size:14px; color:#FFF; margin:0px; padding:10px 0 13px 8px;">&nbsp;</h1></div>';
  temp += '<div style="height:83px; padding:0 0 0 2px; clear:both;"><div style="width:70px; height:70px; float:left; background:url('+urlroot+'face.jpg);"></div></div>';
  temp += '<div style="clear:both;"><a target="_blank" href="http://sighttp.qq.com/authd?IDKEY=739579ccf99972c428db2eb5fab40bbb0365e165afcda55f" style="width:69px; height:21px; background:url('+urlroot+'btn_2.gif); margin:0 0 0 2px; display:block;"></a></div></div>';
  temp += '<div style="width:8px; height:150px; float:left; background:url('+urlroot+'bg_1.gif) right;"></div></div>';

  return temp;
}
function ClickQQ()
{
var tempSrc='http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey=739579ccf99972c428db2eb5fab40bbb0365e165afcda55f';
var oldscript=document.getElementById('testJs');
var newscript=document.createElement('script');
newscript.setAttribute('type','text/javascript'); 
newscript.setAttribute('id', 'testJs');
newscript.setAttribute('src',tempSrc);
if(oldscript == null)
{document.body.appendChild(newscript);
}
else
{oldscript.parentNode.replaceChild(newscript, oldscript);}
return false;
}


