// if use browser Internet Exlorer, the value of isIE is true, else is false.
isIE = false;
if(navigator.appName=="Microsoft Internet Explorer")  isIE = true;
// get the data from url
// two parameters
// url        the access path of the data file, can not add domain name in the path.(firefox can not support get data from other domain)
// id         the data source
function getData(path,parentTagName,tagname,containerId){
	//if (tagname=="telecom")
	//{
	//	document.getElementById("divLink").innerHTML="<a href=#>links电信</a>";
	//}
	//if (tagname=="education")
	//{
	//	document.getElementById("divLink").innerHTML="<a href=#>links教育</a>";
	//}
	//if (tagname=="traffic")
	//{
	//	document.getElementById("divLink").innerHTML="<a href=#>links交通运输</a>";
	//}
	//if (tagname=="finance_service")
	//{
	//	document.getElementById("divLink").innerHTML="<a href=#>links金融服务</a>";
	//}
    //var xmlpath=webpath+path;
    
	var xmlhttp = getXMLHttpRequest();
	if(isIE){
		xmlhttp.open("get",path,true);
	}else{
		xmlhttp.open("get",path);
	}
	
	xmlhttp.onreadystatechange = function(){
	     
		if(xmlhttp.readyState==4){
		    
			var doc;
			var resText=xmlhttp.responseText;
			
			//alert(resText);
		    doc = xmlhttp.responseXML.documentElement;
		    //var image=doc.getElementsByTagName("product")[0].getAttribute("image");
		    //var label=doc.getElementsByTagName("product")[0].getAttribute("label");
           // var name=doc.getElementsByTagName("product")[0].getAttribute("label");
		    //alert(image+","+label+","+name);
		    //alert(parentTagName);
		    switch(parentTagName){
		      case "server" :
		          
		            refreshHardware(doc,parentTagName,tagname,containerId);
		            break;
		      case "memory" :
		           
		            refreshHardware(doc,parentTagName,tagname,containerId);
		            break;
		      case "blod" :
		            
		            refreshHardware(doc,parentTagName,tagname,containerId);
		            break;
		      case "industry_solution" :
		           
                    refreshIndustrySolution(doc,parentTagName,tagname,containerId);
                    break;
               case "telecom" :
		            
                    refreshTelecom(doc,parentTagName,tagname,containerId);
                    break;
		      case "stride_solution" :
		            refreshStrideSolution(doc,parentTagName,tagname,containerId);
		            break;  
		      case "landingpage":
		      	    
		      	    landingpage(doc,tagname,containerId);
		            break;
		      default :
		            break;
		    }
		        	
		}
	};
	xmlhttp.send(null);
}
function getNodeAttribute(node, attribute){
    
	if(isIE){
	    try{
		return node.getAttribute(attribute);
		}catch(e){return null;}
	}else{
	    try{
		return node.attributes.getNamedItem(attribute).nodeValue;
		}catch(e){return null;}
	}
}
/**
  * get CDATA content
 **/ 
function getCDATA(node)
{
    if(isIE){
    	return node.text;
    }else{
    	return node.childNodes[1].nodeValue;
    }
}
function getNodeName(node)
{
  try{
  return node.nodeName;
  }
  catch(e){return null;}
}
function getChildNode(parent,index){ 
     
       
     
     if(isIE){
		return parent.childNodes(index);
	}else{
		return parent.childNodes.item(2 * index + 1);
	}
}
function nodeValue(node){
    
   	if(isIE){
    	return node.text;
    }else{
    	return node.firstChild.nodeValue;//node.nodeValue==null?"":node.nodeValue ;
    }
}
function getNodeLength(doc){
	if(isIE){
		return doc.childNodes.length;
	}else{
		return (doc.childNodes.length-1) / 2;
	}
}
// Initial the XMLHttpRequest object.
function getXMLHttpRequest(){
	var A = null; //XMLHTTP object
	if(window.ActiveXObject){
		try {
			A = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				A = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}else if(window.XMLHttpRequest){
		A = new XMLHttpRequest();
	}
	return A;
}