﻿ var  Name,TopicID,Type;
 var Loader = new AjaxLoader();
 var PictureSite,DivID;
 
 var DefaultTopic={
    _currentPage:'',
    NewTopic:function()
    {
		this._currentPage='/scripts/UserControlLoader/UserControlLoader.do?SubPage='+Name+'&TopicID='+TopicID+'&Type='+Type+'&time='+new Date().getDate()+'&';
		new Ajax.Request (
		this._currentPage,{ parameters:'', onSuccess:function(xh){ _$('DivTopicContent_'+TopicID).update(xh.responseText); DisplayImg('SpanFull_'+TopicID,'SpanFloat_'+TopicID);} }
	    
		); 
    }
}
 
 function DisplayImg(ControlFullId,ControlFloatId)
 {
   var fullSpan = _$(ControlFullId);
   var floatSpan = _$(ControlFloatId);
  
   if(fullSpan.style.display=="") 
   {   
      fullSpan.setStyle({display:'none'});
      floatSpan.setStyle({display:''});
       
    }
    else
    {
      fullSpan.setStyle({display:''});
      floatSpan.setStyle({display:'none'}); 
    }
  }
    
    function ShowAjaxLoader()
    {   
        Loader.imageUrl="/DesktopModules/Ezcom.WebControls/Ezcom.WebControls/images/load.gif";
        Loader.locationName=PictureSite;
        Loader.elementName=DivID;
        Loader.ShowLoader();
        
    }
    
    function ShowAjax(pictureSite,divId,name,topicID,type)
    {
       PictureSite = pictureSite;
       DivID = divId;
       Name=name;
       TopicID=topicID;
       Type=type;
       ShowAjaxLoader();
      
       setTimeout("DefaultTopic.NewTopic()",1000);  
    }
 

