// CREDITS:
// Simple UpNews Scroller by Urs Dudli and Peter Gehrig 
// Copyright (c) 2000 Peter Gehrig and Urs Dudli. All rights reserved.
// Permission given to use the script provided that this notice remains as is.
// Additional scripts can be found at http://www.24fun.com.
// info@24fun.ch
// 3/15/2000

// script extended by Dominic Tocci
// 2/17/2004

var message= new Array()
message[0]="Intellidreams Launches New Corporate Website|Intellidreams has launched a new corporate website to showcase the Kizash Network.|news.php?id=1|main|";

message[1]="Intellidreams Begins Alpha Program for the Kizash Network|Intellidreams starts Alpha program for the Kizash Network, the first profit sharing platform for content developers.|news.php?id=2|main|";

message[2]="Intellidreams launches first profit-sharing platform for content developers.|Intellidreams launches Kizash.com, the first profit sharing platform for content developers.|news.php?id=5|main|";

message[3]="Introducing Kizash.com|The first profit sharing platform for content developers reaches out to the public.|http://www.prweb.com/releases/2004/9/prweb159934.htm|_blank|return showNews()";

message[4]="Webmasters Get Free Content and Earn Cash Through the Kizash.com Syndication Program|Kizash.com syndication system is an easy way for webmasters to add dynamic content to their site and create an additional revenue stream.|http://www.prweb.com/releases/2004/9/prweb191491.htm|_blank|return showNews()";

message[5]="Introducing FunnyFlash.com|FunnyFlash.com launched as the new home to the web's best funny flash content.|news.php?id=9|main|";


// The height of the scrollerbox (pixels)
var scrollerheight=150
// The width of the scrollerbox (pixels)
var scrollerwidth=210
// The distance to the top border of the window (pixels)
var scrollertop=0
// The distance to the left border of the window (pixels)
var scrollerleft=15

// standstill between the messages (milliseconds)
var standstillfix=3000

// Do not edit below this line
var cliptop=0
var clipbottom=scrollerheight
var clipleft=0
var clipright=scrollerwidth

var i_message=0
var mes_joined
var mes_split
var contenttext
//var contentbg

var totalheight=scrollerheight*(message.length)
var i_height=0
var step=2
var pause=20

var standstillflex=0
var currentpos = 0

var scrollerobj

function objClip(cliptop,clipright,clipbottom,clipleft){
	if (document.all){
		scrollerobj.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
	}
	else if (document.layers){
		scrollerobj.clip.left=clipleft
        scrollerobj.clip.right=clipright
        scrollerobj.clip.top=cliptop
        scrollerobj.clip.bottom=clipbottom
	}
	else if (!document.all && document.getElementById){
		scrollerobj.clip="rect("+cliptop+"px "+clipright+"px "+clipbottom+"px "+clipleft+"px)"
	}
}

function startscroller(){
	contenttext="<table cellpadding=0 cellspacing=0 border=0 width="+(scrollerwidth)+">"
	contenttext+="<tr valign='top'><td height='"+scrollerheight+"'><br></td></tr>"
	for (i=0;i<=message.length-1;i++) {
		mes_joined=message[i]
		mes_split=mes_joined.split("|")
		contenttext+="<tr valign='top'><td height='"+scrollerheight+"'><a href='"+mes_split[2]+"' target='"+mes_split[3]+"' "
		if (mes_split[4]!='')
			contenttext+="onclick='"+mes_split[4]+"' "
		contenttext+="class='headlinetitle'>"
		contenttext+=mes_split[0]
		contenttext+="</a>"
		contenttext+="<br><font class='headlinecopy'>"+mes_split[1]+"</font></td></tr>"
	}
	contenttext+="</table>"
	if (document.all){
		scrollertext.innerHTML=contenttext
		scrollerobj = scrollertext.style;
	}
	else if (document.layers){
		scrollerobj = document.scrollertext;
		scrollerobj.document.write(contenttext)
		scrollerobj.document.close()
	}
	else if (!document.all && document.getElementById){
		scrollerobj=document.getElementById("scrollertext").style;
		document.getElementById("scrollertext").innerHTML=contenttext
	}
	objClip(cliptop,clipright,clipbottom,clipleft)
	scroll()
}

function scroll(){
	standstillflex=standstillfix
	if (i_height<scrollerheight) {
		i_height+=step
		currentpos-=step
		cliptop+=step
		clipbottom+=step
		objClip(cliptop,clipright,clipbottom,clipleft)
		if (document.all)
			scrollerobj.posTop=currentpos
		else
			scrollerobj.top=currentpos
		var timer=setTimeout("scroll()",pause)
	}
	else {
		if ((currentpos - scrollertop)<-(totalheight)) {
			if (document.all)
				scrollerobj.posTop=scrollertop
			else
				scrollerobj.top=scrollertop
			currentpos=0
			cliptop=0
			clipbottom=scrollerheight
			objClip(cliptop,clipright,clipbottom,clipleft)
			standstillflex=0
		}
		i_height=0
		clearTimeout(timer)
		var timer=setTimeout("scroll()",standstillflex)

	}
}

