var Project = {};
Project.LastItem = null;

ShowProject = function(nProjectID, sContainerName, obj){

    if(Project.LastItem != null){
        Project.LastItem.style.backgroundColor = "#284448";
        Project.LastItem.style.color = "#ffffff";
    } 

    if(typeof(obj) != "undefined"){
        obj.style.backgroundColor = "#416267";
        obj.style.color = "#fe705c"; 
        Project.LastItem = obj;
    }
   
    var oContainer = sContainerName; 
    
    oContainer.innerHTML = ''; 
    
    var HttpRequest = new CHttpRequest();
	
	HttpRequest.QueryString = "AjaxType=HTML&RequestFile=Blocks.DarkContent&MethodName=XRenderProject";
	HttpRequest.AssyncCall = true;
	HttpRequest.AddProperty("Arguments[ProjectID]", nProjectID);
	
    HttpRequest.Additional = sContainerName;
	HttpRequest.onReturn = "ShowProject_CallBack";
    
	var Response = HttpRequest.Send();
}

ShowProject_CallBack = function(httpRequest, AdditionalData){
   document.getElementById('ProjectContainer').innerHTML = httpRequest.responseText;
}


//CHANGE PICTURE
ChangeProjectPicture = function(nProjectID, nDestination, sContainerName, objStyle){
    if(typeof(objStyle) != "undefined"){
        document.getElementById('BeforeLink').style.color = "#ffffff"; 
    } 
    
    var oContainer = sContainerName;
    oContainer = ''; 
    
    var HttpRequest = new CHttpRequest();
	
	HttpRequest.QueryString = "AjaxType=HTML&RequestFile=Blocks.DarkContent&MethodName=XChangeProjectPicture";
	HttpRequest.AssyncCall = true;
	HttpRequest.AddProperty("Arguments[ProjectID]", nProjectID);
	HttpRequest.AddProperty("Arguments[Destination]", nDestination);
	
    HttpRequest.Additional = sContainerName;
	HttpRequest.onReturn = "ChangeProjectPicture_CallBack";
    
	var Response = HttpRequest.Send();
}

ChangeProjectPicture_CallBack = function(httpRequest, AdditionalData){
   document.getElementById('ProjectPicture').src = httpRequest.responseText;
  //document.getElementById('ProjectContainer').innerHTML = httpRequest.responseText; 
}
