
/***********************************************
* Memory Ticker script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

//configure tickercontents[] to set the messges you wish be displayed (HTML codes accepted)
//Backslash any apostrophes within your text (ie: I\'m the king of the world!)
var tickercontents=new Array()


// tickercontents[]=''


// tickercontents[7]='Item added - <a href="/signs/street.php">Personalized Street Signs</a>'

//tickercontents[5]='Vinyl color added - <a href="/faq.php#colors">Royal Blue Mirror Diamond Plate</a>'
//tickercontents[4]='Vinyl color added - <a href="/faq.php#colors">Cherry Red Mirror Diamond Plate</a>.'
//tickercontents[3]='Vinyl color added - <a href="/faq.php#colors">Textured Silver Brush</a>'
//tickercontents[8]='We now offer a regular mail <a href="/shipping.php">shipping option</a> for small decals.'
//tickercontents[7]='<a href="/shipping.php">Rush processing</a> is now available.'
//tickercontents[3]='We now offer an express mail <a href="/shipping.php">shipping option</a>.'
//tickercontents[2]='We now offer a regular mail <a href="/shipping.php">shipping option</a> for small decals.'
tickercontents[4]='Put <a href="/search-apparel.php">any image</a> on a shirt in any color you want.'
tickercontents[3]='<a href="/shirt-faq.php">Custom T-Shirts</a> and other apparel now available!'
tickercontents[2]='Hats and visors now available! <a href="/search-hats.php">Any image</a>, any color'
tickercontents[1]='Custom <a href="/inlovingmemory.php">Memorial Decals</a> are now available.'
tickercontents[0]='<a href="/tracking.php">Order status tracking</a> is now available.'


var persistlastviewedmsg=1 //should messages' order persist after users navigate away (1=yes, 0=no)?
var persistmsgbehavior="onload" //set to "onload" or "onclick".

//configure the below variable to determine the delay between ticking of messages (in miliseconds):
var tickdelay=6000

////Do not edit pass this line////////////////

var divonclick=(persistlastviewedmsg && persistmsgbehavior=="onclick")? 'onClick="savelastmsg()" ' : ''
var currentmessage=0

function changetickercontent(){
if (crosstick.filters && crosstick.filters.length>0)
	crosstick.filters[0].Apply()
	crosstick.innerHTML='<img src="/images/new_icon.gif" style="border:0; vertical-align:middle"> ' + tickercontents[currentmessage] + ' <img src="/images/new_icon.gif" style="border:0; vertical-align:middle">'
	if (crosstick.filters && crosstick.filters.length>0)
	crosstick.filters[0].Play()
	currentmessage=(currentmessage==tickercontents.length-1)? currentmessage=0 : currentmessage+1
	var filterduration=(crosstick.filters&&crosstick.filters.length>0)? crosstick.filters[0].duration*1000 : 0
	setTimeout("changetickercontent()",tickdelay+filterduration)
}

function beginticker(){
	if (persistlastviewedmsg && get_cookie("lastmsgnum")!="")
		revivelastmsg()
	crosstick=document.getElementById? document.getElementById("memoryticker") : document.all.memoryticker
	changetickercontent()
}

function get_cookie(Name) {
	var search = Name + "="
	var returnvalue = ""
	if (document.cookie.length > 0) {
		offset = document.cookie.indexOf(search)
		if (offset != -1) {
			offset += search.length
			end = document.cookie.indexOf(";", offset)
		if (end == -1)
			end = document.cookie.length;
		returnvalue=unescape(document.cookie.substring(offset, end))
		}
	}

	return returnvalue;
}

function savelastmsg(){
	document.cookie="lastmsgnum="+currentmessage
}

function revivelastmsg(){
	currentmessage=parseInt(get_cookie("lastmsgnum"))
	currentmessage=(currentmessage==0)? tickercontents.length-1 : currentmessage-1
}

if (persistlastviewedmsg && persistmsgbehavior=="onload")
window.onunload=savelastmsg

if (document.all||document.getElementById)
document.write('<div id="memoryticker" '+divonclick+'></div>')
if (window.addEventListener)
window.addEventListener("load", beginticker, false)
else if (window.attachEvent)
window.attachEvent("onload", beginticker)
else if (document.all || document.getElementById)
window.onload=beginticker
