// espace de nom  realisée par lazaar sami pour la gestion des appel asynchrones utilisant la bib yahoo
if (typeof LAZAAR.UTILS.AsynchDBOp == "undefined") {
    /**
     * The LAZAAR.UTILS.AsynchDBOp global namespace object.  If LAZAAR.UTILS.AsynchDBOp is already defined, the
     * existing LAZAAR.UTILS.AsynchDBOp object will not be overwritten so that defined
     * namespaces are preserved.
     * @class AsynchDBOp
     * @static
     */
   LAZAAR.UTILS.AsynchDBOp={};
}


			
//classe static pour la gestion des oeuvres du space name LAZAAR.UTILS.AsynchDBOp
LAZAAR.UTILS.AsynchDBOp.RSS=
{
		PROXY:function() 
		{ 
			//pour eliminer que ie mettre la page en cache
			var rand=parseInt(777*Math.random(0,1));
			return "GrabNews/news.asp?Random="+rand;
		}

	

		,
		callback : 
		{
			cache:false ,
			customevents:
			{
				onStart:function(eventType, args)
				{
//					LAZAAR.UTILS.AsynchDBOp.RSS.WAITDLG.show();
				// eventType has a string value of "startEvent". 
          		// args[0].tId is the integer transaction ID. 
	          	// args[1] contains the value of <code>callback.argument</code>, if callback.argument is defined.
				//alert('ghjgjhg');
				}//fin onstart,
				,
				onComplete:function(eventType, args)
				{
						
					//LAZAAR.UTILS.AsynchDBOp.RSS.WAITDLG.hide();
				
					// eventType has a string value of "completeEvent". 
	          // args[0].tId is the integer transaction ID. 
	          // args[1] contains the value of <code>callback.argument</code>, if callback.argument is defined.
				}//fin onComplete
				,
				onSuccess:function(eventType, args)
				{
					/*
					* eventType has a string value of "successEvent".
					* args[0] is the response object, which has the
					* following properties:
					*
					* args[0].tId
					* args[0].status
					* args[0].statusText
					* args[0].getResponseHeader[ ]
					 * args[0].getAllResponseHeaders
					* args[0].responseText
					* args[0].responseXML
					* args[0].argument
					 */
					 
				    
						
				
					
					if((args[0].responseText !== undefined)&&(args[0].responseText !== null))
					 {
						document.getElementById("RSSCONTENTS").innerHTML=args[0].responseText;
						//var REPXML=args[0].responseXML;
						//var response=REPXML.documentElement;
						
						//alert();
						//var statue=response.selectSingleNode("@statue").value;
						//var statue=response.attributes[0].value;
						
						
					}
					else
					alert ('Echaab-info.com.tn \n\nune erreur est survenue,impossible de charger les flux depuis le serveur');
				
				
				}//fin onSuccess
				,
				
				onFailure:function(eventType, args)
				{
					
					
					// eventType has a string value of "failureEvent". 
	          		// args[0] is the response object.
			 		 alert('Echaab-info.com.tn\n\nImpossible de communiquer avec le serveur!');
				}//fin onFailure
				,
				// Define this event handler for file upload transactions *only*. 
        		// This handler will not be used for any other transaction cases. 
	       	 	onUpload:function(eventType, args)
				{ 
          		
					// eventType has a string value of "uploadEvent". 
	          		// args[0] is the response object. 
        		}//fin onUpload
				, 
				onAbort:function(eventType, args)
				{
					 // eventType has a string value of "abortEvent". 
		 			 // args[0].tId is the integer transaction ID. 
			  		// args[1] contains the value of <code>callback.argument</code>, if callback.argument is defined. 
				}//fin onAbort
		}//fincustomevents
	}//fin callback
	
	,
	getRSScontents:function()
	{
		
			
			
			var oForm = document.getElementById("RSSFORM");
			if (oForm!='undefined')
			{
				
				if (oForm.opt.selectedIndex>0)	
				
				{
				YAHOO.util.Connect.setForm(oForm,false,true);
				YAHOO.util.Connect.asyncRequest("post", this.PROXY(), this.callback);
				}
			}
			
	}

	
};
var RSS;
YAHOO.util.Event.onDOMReady(function(p_sType) 
									 {
										LAZAAR.UTILS.XML.ENLEVEBUGS_pour_F_FOX();
										//LAZAAR.UTILS.AsynchDBOp.RSS.Init();
										RSS=LAZAAR.UTILS.AsynchDBOp.RSS;
									}
							);	
	
