var theid=0;
var change_counts=5;
var ischange=0;
var change_default='';
	var   urlarray=new   Array() 
	//urlarray[1]='default.html';
	urlarray[2]='benefits.php';
	urlarray[3]='features.php';
	urlarray[4]='download.php';
	urlarray[5]='system-requirements.php';
	
function change_(id,wich){

	
	var url=urlarray[id];
    if(wich==3)change_article_over(id);
    if(wich==2)change_article_out(id);
    if(wich==1)change_article_cl(id,url);
}
function change_article_cl(id,url){
    theid=id;
    whichEl = "article" + id;
    whichEl2 = "articlelist" + id;

    var articlelist;

    for(i=1;i<=change_counts;i++){
        article="article"+i;
        articlelist="articlelist"+i;


        document.getElementById(article).getElementsByTagName("p")[0].style.backgroundPosition='left -54px';
        document.getElementById(article).getElementsByTagName("span")[0].style.backgroundPosition='right -54px';
        document.getElementById(article).getElementsByTagName("span")[0].style.cssText='color:#666';
        //document.getElementById(articlelist).style.display='none';
    }

    document.getElementById(whichEl).getElementsByTagName("p")[0].style.backgroundPosition='left 0px';
    document.getElementById(whichEl).getElementsByTagName("span")[0].style.cssText='color:#FFFFFF';
    document.getElementById(whichEl).getElementsByTagName("span")[0].style.backgroundPosition='right 0px';
	if(ischange==1){
		if(id==1){ $('article_content').innerHTML=change_default;
		}else{
			$('article_content').innerHTML ="<center><img  src=\"../../../images/loading.gif\"/><div>Loading...Please wait.</div></center>";
		castVote(url);
		}
	}else{
		change_default=$('article_content').innerHTML;
		if(id==1){ $('article_content').innerHTML=change_default;
		}else{
			$('article_content').innerHTML ="<center><img  src=\"../../../images/loading.gif\"/><div>Loading...Please wait.</div></center>";
		castVote(url);
		}
	ischange=1;
	}
    //document.getElementById(whichEl2).style.display=''

}
function change_article_over(id){
    if(theid!=id){
        whichEl = "article" + id;
        document.getElementById(whichEl).getElementsByTagName("p")[0].style.backgroundPosition='left -108px';
        document.getElementById(whichEl).getElementsByTagName("span")[0].style.backgroundPosition='right -108px';
    }
}
function change_article_out(id){
    if(theid!=id){
        whichEl = "article" + id;
        document.getElementById(whichEl).getElementsByTagName("p")[0].style.backgroundPosition='left -54px';
        document.getElementById(whichEl).getElementsByTagName("span")[0].style.backgroundPosition='right -54px';
    }
}



///////////////////////ajax
function $() {
  var elements = new Array();
  
  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);

    if (arguments.length == 1) 
      return element;
      
    elements.push(element);
  }
  
  return elements;
}


var req;

	function castVote(url) {
		// This demo uses simple Html/JS only, so we load a static html page
		//var url = url+"?"+Math.random()*(200-50);
		var callback = processAjaxResponse;
		executeXhr(callback, url);
	}

	function executeXhr(callback, url) {
		// branch for native XMLHttpRequest object
    		if (window.XMLHttpRequest) {
        		req = new XMLHttpRequest();
        		req.onreadystatechange = callback;
        		req.open("GET", url, true);
        		req.send(null);
    		} // branch for IE/Windows ActiveX version
    		else if (window.ActiveXObject) {
        		req = new ActiveXObject("Microsoft.XMLHTTP");
       		if (req) {
            		req.onreadystatechange = callback;
            		req.open("GET", url, true);
            		req.send();
        		}
    		}
	}
  
 	function processAjaxResponse() {
    		// only if req shows "loaded"
    		if (req.readyState == 4) {
        		// only if "OK"
        		if (req.status == 200) {
            		$('article_content').innerHTML = req.responseText;
        		} else {
            		alert("There was a problem retrieving the XML data:\n" +
                	req.statusText);
        		}
    		}
	} 