if ((top.ChannelInit == "undefined") || (top.ChannelInit != true))
{
	/**
	*
	* Channel CLASS definition.
	*
	*/

	function Channel(parentDocumentArg, channelIdArg) {     
		this.channelId = channelIdArg; 
		this.parentDocument = parentDocumentArg;    

		this.channelDocument = this.parentDocument.createElement("IFRAME");     
		this.channelDocument.style.display = "none";     
		this.parentDocument.body.appendChild(this.channelDocument);     
		this.channelDocument.src='about:blank';
	}  

	/**  
	* Create a new channel DOM Document element.
	* @returns the created channelDocument.  
	*/ 

	Channel.prototype.createChannelDocument = function()
	{  	
		if (this.parentDocument == null){ 		
			return null; 	
		}
		else
		{ 		
			this.channelDocument = this.domDoc.createElement("IFRAME"); 		
			this.channelDocument.style.display = "none"; 	
			this.parentDocument.body.appendChild(this.channelDocument); 		
			return this.channelDocument; 	
		} 
	}  

	/**  
	* Returns the channel DOM document reference. 
	* @returns the DOM document reference.  
	*/ 

	Channel.prototype.getChannelDocument = function ()
	{ 	
		return this.channelDocument; 
	}   

	/**  
	* Returns the Channel Id. 
	* @returns the channelId  
	*/ 

	Channel.prototype.getChannelId = function(){ 	
		return this.channelId; 
	}  

	/**  
	* Returns the URL of Channel request.
	* @returns the URL Path reference of channel request  
	*/ 

	Channel.prototype.getChannelSource= function(){ 	
		if ( this.channelDocument != null) 		
			return this.channelDocument.src; 	
		else 		
			return null; 
	}  

	/**  
	* Sets a new URL source for the channel request. GET METHOD
	*/  

	Channel.prototype.setChannelSource = function(channelSourceArg){ 	
		if ( this.channelDocument != null ) 
		{	
			this.channelDocument.src = channelSourceArg; 
		}
	}  

	/**   
	* Sets a new innerHTML for the channel request. POST METHOD
	*/  

	Channel.prototype.setChannelInnerHTML = function(channelInnerHTMLArg){ 	
		if ( this.channelDocument.contentWindow.document.body != null ) 
		{	
			this.channelDocument.contentWindow.document.body.innerHTML = channelInnerHTMLArg; 
			this.channelDocument.contentWindow.document.forms[0].submit();
		}
		else {
			// just wait for the IFRAME to load "about:blank" source
			setTimeout(function() {channel.setChannelInnerHTML(channelInnerHTMLArg)}, 100);
		}
	}  

	/**  
	* Sets the visibility of the Channel.  
	* @argument visible  true/false  
	*/ 

	Channel.prototype.setVisibility = function (visible)
	{ 	
		if ( visible ) 		
			this.channelDocument.style.display = "block"; 	
		else 		
			this.channelDocument.style.display = "none"; 
	} 

	/**  
	* Releases the channel DOM element reference.
	*/  

	Channel.prototype.release = function()
	{ 	
		if ( this.channelDocument != null) 		
			this.channelDocument.removeNode(true); 
	}
	
	//////////////////////////////////////

	top.ChannelInit = true;
}
	