function prepareAjax()
{
 
    contentObj = document.getElementById('contentContainer');   

    if( contentObj )
    {
       startReload();
    }   
}


function startReload()
{

     if( !contentObj.opac )
     {
        contentObj.opac = 1;
     }
     else
     {
       contentObj.opac =  contentObj.opac  -  0.04;
     }
     

    
     
     if( contentObj.opac > 0)
     {
     
        SetOpcity( contentObj, contentObj.opac );	
        setTimeout( "startReload()", 100);
     }	
     else
     {
        tID = -1;
        
        var CurrentLink = document.getElementById( 'ccc' );
	
	if( CurrentLink )
	{
	   tID = CurrentLink.innerHTML;
	}

        SetOpcity( contentObj, 0 );
	selectArticle( tID );
     }
     
}

function selectArticle( tID )	
{


    var url = st + '?m=25&TextPreview=' + tID;
    new Ajax.Request( url,
                     {
		       method: "post",
		       onSuccess: function( transport ){  contentObj.innerHTML = transport.responseText;  startFadeIn();}
		     }
                     );
}



function startFadeIn()
{

     contentObj.opac =  contentObj.opac  +  0.04;
     
     if( contentObj.opac < 1)
     {
        SetOpcity( contentObj, contentObj.opac );
        setTimeout( "startFadeIn()", 100);
     }	
     else
     {
        SetOpcity( contentObj, 1 );
	reloader = setTimeout( "prepareAjax()" , 4000  );      
     }
}



function selectClient( ClientID )
{
 
   contentObj.innerHTML = "";
     
    var url = st + '?m=26&i=' + ClientID;
    new Ajax.Request( url,
                     {
		       method: "post",
		       onSuccess: function( transport ){
		                                            contentObj.innerHTML = transport.responseText;  
							     var dragable1 = DragHandler.attach(document.getElementById('showup'));
							     dragable1.dragBegin = begin;
							     dragable1.drag = drag;
							     dragable1.dragEnd = end;
							    
		                                       }
		     }
                     );

}
						    
function  clearTestimonials( )
{
      var ShowUpDiv =  document.getElementById( "showup" );
      if( ShowUpDiv )
      {
          ShowUpDiv.style.display = "none";
          ShowHideScreen2 ( "none" );
      }
				       
}
					


 function loadTestimonials( ClientID )
 {

       var ShowUpDiv =  document.getElementById( "showup" );


       if( ShowUpDiv  )
       {
             ShowHideScreen2 ( "block" );

                       var WindowTop    = (document.body || document.documentElement).scrollTop;
                       var WindowBottom = (document.body || document.documentElement).scrollHeight;
                       var WindowWidth  = (document.body || document.documentElement).scrollWidth;
                       var WindowMiddle = WindowBottom / 2;
                       var Top = WindowTop + 130;
                       var Left = ( WindowWidth / 2 ) - ( 528 / 2 );
											  
             
             ShowUpDiv.style.zIndex = 131561;
             ShowUpDiv.style.top = Top
             ShowUpDiv.style.left = Left;
             contentObj = document.getElementById('showup');
	     ShowUpDiv.style.display = "inline";

             if( contentObj )
             {
                selectClient( ClientID );
             }

       }

 }


