/**
auther xurun
date 2006-8-16
*/
var xmlhttp; 
function create_http()
{   
	if   (window.XMLHttpRequest)   return(new   XMLHttpRequest());   
	var   arr_t   =   new   Array(   
	"MSXML2.XMLHTTP.4.0",     
	"MSXML2.XMLHTTP.3.0",     
	"MSXML2.XMLHTTP.2.6",     
	// "MSXML2.XMLHTTP",   
	"Microsoft.XMLHTTP",     
	"MSXML.XMLHTTP"   
	);   
	for(var   i=0;   i<arr_t.length;   i++)   {   
	try   {   
	xmlhttp_ver   =   arr_t[i];   
	return   new   ActiveXObject(arr_t[i]);   
	}catch(e)   {}   
	}   
	return(null);   
}

xmlhttp = create_http();



function ResponseJobsList(IndexId)
{
	xmlhttp = create_http();
	//xmlhttp = create_http();
	//alert("zzzzz"+IndexId);
	xmlhttp.onreadystatechange = function () {
		//alert(xmlhttp.readyState)
		//alert(xmlhttp.readyState + "--" + xmlhttp.status);
			if (xmlhttp.readyState == 4) {
				if ( xmlhttp.status == 200 ) {
					//alert(100);
					//alert(xmlhttp.responseText);
					//return;
					var arrHtml = xmlhttp.responseText.split("@@@");
					//alert(IndexId + "--" + xmlhttp.responseText);
					if(!document.getElementById("JobDiv_"+arrHtml[0].Trim()))
						alert(arrHtml[0])
					document.getElementById("JobDiv_"+arrHtml[0].Trim()).innerHTML = arrHtml[1];
					//alert(IndexId<arrComIds.length-1)
					//if(IndexId<arrComIds.length-1)
//					{
//						IndexId ++;
//						//ResponseJobsList(IndexId);
//						//IndexId ++;
//						setTimeout("ResponseJobsList("+IndexId+")", 100);
//					}
				}
			}
		};
	if(xmlhttp) {
		//alert(IndexId);
		xmlhttp.open("post","CodeBehind.shtml",false);
		xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlhttp.send("Actions=JobsListIndex&ComId="+IndexId);
	}
}

function ResponseJobsListNum(IndexId)
{
	xmlhttp = create_http();
	//xmlhttp = create_http();
	//alert("zzzzz"+IndexId);
	xmlhttp.onreadystatechange = function () {
		//alert(xmlhttp.readyState)
		//alert(xmlhttp.readyState + "--" + xmlhttp.status);
			if (xmlhttp.readyState == 4) {
				if ( xmlhttp.status == 200 ) {
					//alert(100);
					//alert(xmlhttp.responseText);
					//return;
					var arrHtml = xmlhttp.responseText.split("@@@");
					//alert(IndexId + "--" + xmlhttp.responseText);
					if(!document.getElementById("JobDiv_"+arrHtml[0].Trim()))
						alert(arrHtml[0])
					else
						document.getElementById("JobDiv_"+arrHtml[0].Trim()).innerHTML = arrHtml[1];
					//alert(IndexId<arrComIds.length-1)
					IndexId ++;
					if(IndexId<arrComIds.length-1)
					{
//						//ResponseJobsList(IndexId);
//						//IndexId ++;
						setTimeout("ResponseJobsListNum("+IndexId+")",10);
					}
				}
			}
		};
	if(xmlhttp) {
		//alert(IndexId);
		xmlhttp.open("post","CodeBehind.shtml",true);
		xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlhttp.send("Actions=JobsListIndex&ComId="+arrComIds[IndexId]);
	}
}

document.write("<div id='pup' style='position:absolute; border: 1px solid gray;z-index:10;color:#FFFFFF;line-height=16px;background: #FFFFE1; width:200px;height:auto;overflow: visible;visibility: hidden;font-size:12px;padding:5px;text-align: left'></div>")

var displayObj = null;

var a=0;
function showpup(e,str){
	showpupCommon(null,e,str);
}

function showpupbya(e,str){
	
	showpupCommonbya(null,e,str);
}

function showpupBack(e,str)
{
	//xmlhttp = create_http();
	//if(xmlhttp) {
		//xmlhttp.onreadystatechange = function () {
			
			//if (xmlhttp.readyState == 4) {
				//if ( xmlhttp.status == 200 ) {
					//alert(xmlhttp.responseText);
					showpupCommon(null,e,str);
				//}
			//}
			
		//};
		//xmlhttp.open("post","CodeBehind.shtml",false);
		//xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		//xmlhttp.send("Actions=JobsList&ComId="+strComId);
	//}
}

function showpupbyBack(e,strComId)
{
	//xmlhttp = create_http();
	//if(xmlhttp) {
		//xmlhttp.onreadystatechange = function () {
			
			//if (xmlhttp.readyState == 4) {
				//if ( xmlhttp.status == 200 ) {
					//alert(xmlhttp.responseText);
					showpupCommonbya(null,e,strComId);
				//}
			//}
			
		//};
		//xmlhttp.open("post","CodeBehind.shtml",false);
		//xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		//xmlhttp.send("Actions=JobsList&ComId="+strComId);

}

function showpupCommon(divWidth,e,str)
{	
	var disObj = null;
	if(displayObj==str)return;
	var left=-21,top=e.height+5;
	var x,y;
	while (e.offsetParent){
		left += e.offsetLeft;
		top  += e.offsetTop;
		e     = e.offsetParent;
	}

	left += e.offsetLeft;
	top  += e.offsetTop;
	x = left;
	y = top;
	if (document.layers){
		disObj = document.layers['pup'];
        disObj.left = x;
        disObj.top = y;
    }
    else if (document.all){
		disObj = document.all['pup'];
		disObj.style.left=x;
        disObj.style.top=y;
    }
    else if (document.getElementById){
        disObj = document.getElementById('pup');
		disObj.style.left=x+"px";
       	disObj.style.top=y+"px";
    }

	disObj.style.visibility="visible";
	if(divWidth!=null && divWidth!=""){
		disObj.style.width=divWidth+"px";
	}else{
		disObj.style.width="143px";
	}
	disObj.innerHTML=str;
	displayObj = str;
	a=0;
	checkBrowserForVersion4();
}

function showpupCommonbya(divWidth,e,str)
{	
	var disObj = null;
	if(displayObj==str)return;
	var left=-21,top=10+5;
	var x,y;
	while (e.offsetParent){
		left += e.offsetLeft;
		top  += e.offsetTop;
		e     = e.offsetParent;
	}

	left += e.offsetLeft;
	top  += e.offsetTop;
	x = left;
	y = top;
	if (document.layers){
		disObj = document.layers['pup'];
        disObj.left = x;
        disObj.top = y;
    }
    else if (document.all){
		disObj = document.all['pup'];
		disObj.style.left=x;
        disObj.style.top=y;
    }
    else if (document.getElementById){
        disObj = document.getElementById('pup');
		disObj.style.left=x+"px";
       	disObj.style.top=y+"px";
    }

	disObj.style.visibility="visible";
	if(divWidth!=null && divWidth!=""){
		disObj.style.width=divWidth+"px";
	}else{
		disObj.style.width="143px";
	}
	disObj.innerHTML=str;
	displayObj = str;
	a=0;
	checkBrowserForVersion4();
}


function showpupindex(imgObj,val){
	showpupCommon(264,imgObj,val);
}

function hidepup()
{
  pup.style.innerHTML=""
  pup.style.visibility="hidden";
  displayObj = null;
}


function  hidepupTip(){
	var div = document.all.pup;
	var div1 = document.all.searchInput;
	if(div.componentFromPoint(event.clientX,event.clientY)=="outside" && div1.componentFromPoint(event.clientX,event.clientY)=="outside")
	{
		div.style.visibility='hidden'
	}		
}

function checkBrowserForVersion4(){
	var	x=navigator.appVersion;
	y=x.substring(0,4);
	if(y>=4) Effect();
}

var	isNav=(navigator.appName.indexOf("Netscape")!=-1);
var	colors=new Array	("FFFFFF","FFFFFF","FFFFFF","FFFFFF","FFFFFF","FFFFFF","FFFFFF","F9F9F9","F1F1F1","E9E9E9","E1E1E1","D9D9D9","D1D1D1","C9C9C9","C1C1C1","B9B9B9","B1B1B1","A9A9A9","A1A1A1","999999","919191","898989","818181","797979","717171","696969","616161","595959","515151","494949","414141","393939","313131","292929","212121","191919","111111","090909","000000");

function Effect(){
	color=colors[a];
	pup.style.color = color;
	
	if(a<colors.length){
		a++;
		xx=setTimeout("Effect()",30);
	}
}


String.prototype.Trim = function(){ return Trim(this);} 
String.prototype.LTrim = function(){return LTrim(this);} 
String.prototype.RTrim = function(){return RTrim(this);} 


function LTrim(str) 
{ 
var i; 
for(i=0;i<str.length;i++) 
{ 
if(str.charAt(i)!=" "&&str.charAt(i)!=" ")break; 
} 
str=str.substring(i,str.length); 
return str; 
} 
function RTrim(str) 
{ 
var i; 
for(i=str.length-1;i>=0;i--) 
{ 
if(str.charAt(i)!=" "&&str.charAt(i)!=" ")break; 
} 
str=str.substring(0,i+1); 
return str; 
} 
function Trim(str) 
{ 
return LTrim(RTrim(str)); 
} 

