// JavaScript Document
// (c) 2004/2005 cpi service for babelport.com

var newsFeed = new NewsFeed();
function NewsFeed() {
this.filter = 'tin_cat_misc_bp_pc';
this.limit = 3;
this.width=false;
this.length='none';
this.type='js';
this.encode = 'iso';
this.language= 'en';
this.font = 'arial';
this.fontsize = 11;
this.hl_color='cc3333';
this.txt_color='666';
this.rand = Math.floor(Math.random()*10000);
this.IFrameDoc = false;
IFrameObj = false;
this.wait=1000;
this.publishFeed = function () {
				var param="filter="+this.filter+"&limit="+this.limit+"&length="+this.length+"&type="+this.type+"&encode="+this.encode;
				if (this.width) {param = param + "&width="+this.width;}
				param = param + "&language="+this.language+"&font="+this.font+"&fontsize="+this.fontsize+"&hl_color="+this.hl_color+"&txt_color="+this.txt_color;
		
				if ( document.createElement) {
				// create the IFrame and assign a reference to the
				// object to our global variable IFrameObj.
				// this will only happen the first time 
				// callToServer() is called
					var sourceURi = 'http://nfeed.babelport.com/remotenews.php?'+param;
				
					var tempIFrame=document.createElement('script');
					tempIFrame.setAttribute('language','javascript');
					tempIFrame.setAttribute('src',sourceURi);
					document.body.appendChild(tempIFrame);
				
				} else {
					document.write('<script language="javascript" src="'+sourceURi+'"></script>');
				}

				
				
	}
}	
function refreshNews(newsFeed) {
	if(newsFeed) {
		newsFeed.publishFeed();
	}
}
/*
function publish(IFrameObj) {
				alert("called");
			if (IFrameObj.contentDocument && !IFrameObj.contentWindow.document) {
				// For NS6
						var IFrameDoc = IFrameObj.contentDocument; 
				} else if (IFrameObj.contentWindow) {
				// For IE5.5 and IE6
						var IFrameDoc = IFrameObj.contentWindow.document;
				} else if (IFrameObj.document && !IFrameObj.contentWindow.document) {				// For IE5
						var IFrameDoc = IFrameObj.document;
				} else {
						var IFrameDoc = IFrameObj.contentWindow.document;
				}
				if (IFrameDoc) {				
					document.write(IFrameDoc.body.innerHTML);					
				}
				if (document.body.removeChild) {
						document.body.removeChild(IFrameObj);
				}
				
				return true;				
			

}
		
*/
