var g_allNewsItems = new Array();
var arrNewsProd = new Array();
var arrNewsBizPartners = new Array();
var arrNewsTechPartners = new Array();

// Special case
var news_notfound = _webLinkDocument(
		"News Item Not Found", 
		"news_notfound", 
		"/news/notfound.html", 
		"01/01/2000", "04/20/2005", 
		""
		);


// Pass in a "_webLinkDoc" array.
//
function getFeaturedNewsEntries(wldArr) {
	var arr = new Array();
	arr = wldArr;
    var i = 0;
	var s = "\n";
	for (var i = 0; i < arr.length; i++) {
		var wld = arr[i];
		s += "<dd>" + wld.sidebarLink()+ "</dd><p></p>\n";
	}
	s += "\n";
	return s;
}


function newNewsItem(displayText_in, docUid_in, 
						url_in, 
						dateCreate_in, dateUpdated_in, 
						blurb_in) {
		var wld = new _webLinkDocument(displayText_in, docUid_in, 
						url_in, 
						dateCreate_in, dateUpdated_in, 
						blurb_in);
		wld.sidebarLink = _newsItem_sidebarLink;
		wld.newsLink = _newsItem_newsLink;
		g_allNewsItems[g_allNewsItems.length] = wld;
		return wld;
}

function newProductNewsItem(displayText_in, docUid_in, 
						url_in, 
						dateCreate_in, dateUpdated_in, 
						blurb_in) {
		var wld = newNewsItem(displayText_in, docUid_in, 
						url_in, 
						dateCreate_in, dateUpdated_in, 
						blurb_in);
		arrNewsProd[arrNewsProd.length] = wld;
		return wld;
}

function newBizPartnerNewsItem(displayText_in, docUid_in, 
						url_in, 
						dateCreate_in, dateUpdated_in, 
						blurb_in) {
		var wld = newNewsItem(displayText_in, docUid_in, 
						url_in, 
						dateCreate_in, dateUpdated_in, 
						blurb_in);
		arrNewsBizPartners[arrNewsBizPartners.length] = wld;
		return wld;
}

function newTechPartnerNewsItem(displayText_in, docUid_in, 
						url_in, 
						dateCreate_in, dateUpdated_in, 
						blurb_in) {
		var wld = newNewsItem(displayText_in, docUid_in, 
						url_in, 
						dateCreate_in, dateUpdated_in, 
						blurb_in);
		arrNewsTechPartners[arrNewsTechPartners.length] = wld;
		return wld;
}

function fnAllNews() {
	var arr = fnSortWebDocs(g_allNewsItems, -1);
	return arr;
}
function fnProductNews() {
//	var arrNewsProd = new Array(news_prod_tradeshow, news_prod_ss. news_prod_i18n);
//	var arrNewsProd = new Array(news_prod_tradeshow, news_prod_ss);
	var arr = fnSortWebDocs(arrNewsProd, -1);
	return arrNewsProd;
}

function fnPartnerNews() {
	var arr = new Array();
	arr = arr.concat(fnBizPartnerNews(), fnTechPartnerNews());
	var arr1 = fnSortWebDocs(arr, 10);
	return arr1;
}

function fnBizPartnerNews() {
//	var arrNewsBizPartners = new Array(news_prt_solvis, news_prt_cedros);
	return arrNewsBizPartners;
}

function fnTechPartnerNews() {
//	var arrNewsTechPartners = new Array(news_prt_tangosol);
	return arrNewsTechPartners;
}


function fnRecentNews() {
	var arr = new Array();
	var arrT = fnProductNews();
	arr = arr.concat(arrT, fnBizPartnerNews(), fnTechPartnerNews());
//	alert("arr:" + arrT.length + " " + arr.length + " " + arr);
	arr1 = arr;
	arr1 = fnSortWebDocs(arr, 5);
	return arr1;
}

function fnFeaturedNews() {
	var arr = fnRecentNews();
	var d = fnGetLastYear();
	arr1 = fnSortWebDocs(arr, 5, d);
//	alert("returing : " + arr1.length);
	return arr1;
}

// Product docs


var news_prod_ss = newProductNewsItem(
		"SemaTree Announces Self-Service Web Template Suite", "news_prod_ss", 
		"/news/items/prod_ss.html", 
		"07/15/2005", "07/15/2005", 
		"SemaTree announced that it will offer a self-service application suite starting in 4th Quarter 2005. "
		+ "This application suite extends features of ECS CRM to your customers."
		);
	
var news_prod_i18n = newProductNewsItem(
		"SemaTree Releases Multi-Language Support for ECS CRM ", "news_prod_i18n", 
		"/news/items/prod_i18n.html", 
		"06/01/2005", "06/01/2005", 
		"SemaTree released today ECS CRM 4.2M which offers supports for multiple languages within a single deployment  "
		);

/**		
var news_prod_i18n_de = newProductNewsItem(
		"SemaTree released a German Language Pack for ECS CRM ", "news_prod_i18n_de", 
		"/news/items/prod_i18n_de.html", 
		"6/02/2005", "6/02/2005", 
		"SemaTree released a German Language Pack, allowing German speakers to use the ECS CRM product.SemaTree Releases Multi-Language Support for ECS CRM "
		);
*/
	
var news_prod_ts = newProductNewsItem(
		"SemaTree Releases ECS Tradeshow", "news_prod_ts", 
		"/news/items/prod_ts.html", 
		"08/17/2005", "08/17/2005", 
		"SemaTree's Tradeshow solution streamlines lead capture for any tradeshow event."
		+ " Using wireless handhehld PDA's and a customized lead form, the ECS Tradeshow application "
		+ " eliminates the need for paper processing of custom data requirements."		
		);
		 
	var news_prod_ecs5 = newProductNewsItem(
		"ECS 5.0 Released!", "news_prod_ecs5", 
		"/news/items/ecs_v5_rel.html", 
		"08/15/2006", "08/15/2006", 
		"SemaTree is proud to announce the general availability of ECS 5.  ECS 5 introduces new functionality and several important enhancements to its underlying component and web architecture."
		);
		
	var news_prod_webquote = newProductNewsItem(
		"ECS WebQuote 2.0 Released!", "news_prod_webquote", 
		"/news/items/ecs_webquote_2.0_rel.html", 
		"08/17/2006", "08/17/2006", 
		"SemaTree is proud to announce the general availability of ECS WebQuote 2.0.  ECS WebQuote allows organizations to generate high-quality proposals using standardized templates and a catalog database"
		);
		
	var news_prod_provision = newProductNewsItem(
		"ECS Order Manager 1.0 Announced!", "news_prod_provision", 
		"/news/items/ecs_provisioning_1.0_rel.html", 
		"10/27/2006", "10/27/2006", 
		"SemaTree is proud to announce the  ECS Order Manager 1.0 product."
		+ " ECS Order Manager allows organizations to manage complex orders in a rich, SOA ecosystem.  "
		+	"This tool should prove invaluable for all Service Aggregators especially in the SAAS and Telco verticals."
		);
		
	
//var news_prod_ecs5 = newProductNewsItem(
//		"SemaTree Releases ECS 5.0", "news_prod_ecs5", 
//		"/news/items/ecs_v5_release.html", 
//		"08/16/2006", "09/16/2006", 
//		" "
//		);

	
//var test = newProductNewsItem(
//		"Test ", "news_prod_i18n", 
//		"/product_docs/ECSWebFramework.pdf", 
//		"6/01/2006", "6/01/2006", 
//		"Test different junk "
//		);
	
	
// Partner News
		
var news_prt_tango = newTechPartnerNewsItem(
		"SemaTree and Tangosol Technology Alliance Solidifies CRM Enterprise Offering ", 
		"news_prt_tango", 
		"/news/items/tech_tango.html", 
		"06/20/2005", "06/20/2005", 
		"SemaTree announced today a technology partnership with Tangosol a leading provider of J2EE data cache products."
		);

		
/**
var news_prt_arinware = newTechPartnerNewsItem(
		"SemaTree and Arinware to Release Joint Offering. ", 
		"news_prt_arinware", 
		"/news/items/biz_arinware.html", 
		"07/15/2005", "07/15/2005", 
		"SemaTree announced today a business partnership with Arinware combining scalable SemaTree's CRM architecture with Arinware's advanced"
		+ " lifetime value calculation engine.  The combined product will offer an unprecedented advantage for customers "
		+ " to intelligently design and deliver campaigns for their best customers."
		);
*/


var news_prt_cedros = newBizPartnerNewsItem(
		"SemaTree and Cedros Alliance to Deliver Integrated CRM to German Financial Industry", "news_prt_cedros", 
		"/news/items/cedros.html", 
		"08/10/2005", "08/10/2005", 
		"SemaTree has announced a strategic partnership with Cedros a Cologne based IBM WebSphere integrator."
		);
		
var news_prt_cedros1 = newBizPartnerNewsItem(
		"Cedros offering German version of ECS.", "news_prt_cedros_ecs", 
		"/news/items/cedros_ecs.html", 
		"05/02/2006", "05/02/2006", 
		"SemaTree has announced a strategic partnership with Cedros a Cologne based IBM WebSphere integrator."
		); 

	
var news_prt_solvis = newBizPartnerNewsItem(
		"SemaTree and Solvis Consulting Alliance to Deliver Implementation Services in North and South America ", "news_prt_solvis", 
		"/news/items/solvis.html", 
		"08/31/2005", "08/31/2005", 
		"SemaTree announced today a partnership with Solvis Consulting, a Miami FL, based CRM implementation group."
		);
		
//alert("all_nenws ok");

/**
var news_prt_tangosol = newNewsItem(
		"", "UUID", 
		"/news/", 
		"04/20/2005", "04/20/2005", 
		""
		);
	
var news_prt_tangosol = newNewsItem(
		"", "UUID", 
		"/news/", 
		"04/20/2005", "04/20/2005", 
		""
		);
**/	