function HOME_getNextClientBig(currentID){
	document.getElementById('project_loader').style.display = 'block';
	document.getElementById('project_text').innerHTML = '';
	document.getElementById('project_image').style.display = 'none';
	
	
	doAjaxRequest("/ajax.php", {'do':'nextClientBig','id':currentID},{
  					method:"GET",
  					onSuccess:function (oQ) { 
						document.getElementById('project_loader').style.display = 'none';
						txt = oQ.responseText;
						split = txt.split(";", 2);
						
						document.getElementById('project_image').src = "/pictures/bl_" + split[0] + ".jpg";
						document.getElementById('project_image').style.display = 'block';
						document.getElementById('project_image').alt = split[1];
						document.getElementById('project_link').href = "/customers.html?c=" + split[0];
						document.getElementById('project_link2').href = "/customers.html?c=" + split[0];
						
						nTxt = txt.substr (split[0].length + split[1].length + 2);
						
						document.getElementById('project_text').innerHTML = nTxt;
						clientID = split[0];
						
					}
					,
  					onFailure:function (oQ) { 
						location.href = 'customers.html';
					}
  				});

	return false;
}

function HOME_getNextClients(){
	var AlreadyUsed = cList; // semi-colon seperated list

	return false;
}

function CLIENTS_loadClient(id)
{
	return false;
}



// AJAX library

var getTransferObject = function(){	return null;	};
if(window.ActiveXObject){
	// Check if the browser has support for ActiveXObject (IE Usually)  
	try{ 
		// Check for the new version of XMLHttp compoment  
		var x=  new ActiveXObject("MSXML2.XMLHTTP"); 
		getTransferObject = function(){ return new ActiveXObject("MSXML2.XMLHTTP"); }
	}catch(_ex){ 
		try{ // Check for late version of XMLHTTP compoment  
			var x = new ActiveXObject("Microsoft.XMLHTTP"); 
			getTransferObject = function(){ return new ActiveXObject("Microsoft.XMLHTTP"); }
		}catch(ex){
			// Otherwise the version of IE is too old  
		} 
	} 
}else if(window.XMLHttpRequest){
	// XMLHttpRequest object supported by Opera, Firefox and Safari - may too in IE 7.  
	getTransferObject = function(){ return new XMLHttpRequest(); }
}

/*
	* make an "Ajax Request".
	* @params: 
		- url : contains the target of the request.
		- params: Hash Table that contains a data that send with the request.
		- aOptions: Associative array that contains an optional property: method of sendinge, 
			2 optional function: 
				- onSuccess(param: RequestObject): will dispatch when the request get a "true" response (status-code=200)
				- onFailure(param: RequestObject): will dispatch when the request get a "false" response (status=code isn't 200)
			and an Hash Table of http headers named: httpHeaders
*/
function doAjaxRequest(url, params, aOptions){
	// get transfer object
	var oReq = getTransferObject();
	if(!oReq){
		// Check for XMLHttpRequest
		throw "Download the newer Firefox or upgrade your browser please.";
		return false;
	}

	// Add HTTP headers to the message
	for(var header in aOptions.httpHeaders){
		oReq.setRequestHeader(header,aOptions.httpHeaders[header]);
	}

	oReq.onreadystatechange = function(){
		if(oReq.readyState==4){
			if(oReq.status==200){
				if(aOptions.onSuccess) aOptions.onSuccess(oReq);
			}else{
				if(aOptions.onFailure) aOptions.onFailure(oReq);
			}
		}
	}

	// make parameters string
	var _params = [];
	for(var p in params){
		_params.push(p+"="+encodeURIComponent(params[p]));
	}
	_params = _params.join("&");

	// Default send method: GET
	var method = aOptions.method?aOptions.method:"GET",
		bodyPost= null;


	if(method=="POST"){
		oReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		oReq.open(method, url, true);
		bodyPost = _params; // POST data send into the request
	}else{
		oReq.open(method, url+"?"+_params, true); // GET data send as part of the url
	}
	//send request
	oReq.send(bodyPost);
}

function switchclients(dir)
{
	curClient = curClient + (dir*2);
	if(curClient<0)			curClient = maxClient-1;
	if(curClient>maxClient)	curClient = 0;
	
	b1 = clients[curClient];
	b2 = clients[curClient+1];
	
	if(!b1 && !b2) return switchclients(dir);
	
	document.getElementById('clientRight').innerHTML = b1;
	document.getElementById('clientLeft').innerHTML = b2;
}

$(document).ready(function() {
$('span.term').cluetip({width: '307px', showTitle: false, attribute : 'rel',dropShadow:       false});
});