/**
 * WDC Multiple News Feeds
 * @author Web Designs Company <contact@wdc.com>
 * @link http://www.web-designs-company.com
 * @copyright (C) 2011 - 2012 Web Designs Company
 * @license GNU/GPL, see LICENSE.php for full license.
**/
function WdcChannelList( id_to_change, fetch_inner_html, category, category_value ) {

 	var ajaxRequest;

		try{
			// Opera 8.0+, Firefox, Safari
			ajaxRequest = new XMLHttpRequest();
		} catch (e){
			// Internet Explorer Browsers
			try{
				ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try{
					ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e){
					// Something went wrong
					alert("Your browser broke!");
					return false;
				}
			}
		}

	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function() {
		if(ajaxRequest.readyState == 4){

			var ajaxDisplay = ajaxRequest.responseText;
			document.getElementById( fetch_inner_html ).innerHTML= ajaxDisplay;

		}
	}

	var current_value = document.getElementById( id_to_change ).value;
	var path          = document.getElementById( 'path' ).value;

	var url           = path + 'modules/mod_wdc_multiple_news_feeds/wdc_multiple_news_channel.php';

	var queryString = "?current_value=" + current_value + "&category=" + category + "&category_value=" + category_value ;

	document.getElementById( fetch_inner_html ).innerHTML = "<div style='margin-top:25px;text-align:center'><img src='modules/mod_wdc_multiple_news_feeds/assets/images/loader.gif' alt='Loading ........'></></div>";
	ajaxRequest.open("POST", url + queryString, true);
	ajaxRequest.send(null);

 }

