<!-- 

/*
 -------------------------------------------------------------------------------
|  Copyright (C) 2004 Azalea Technology. All rights reserved.                   |
|-------------------------------------------------------------------------------|
|  Unauthorized removal of this notice is considered a violation of the         |
|  license agreement under which this Code may be used. This work is protected  |
|  under United States copyright law and the similar law(s) of other countries  |
|  under which such as work is afforded legal protection, and upon conviction   |
|  of such a violation in a court of applicable jurisdiction, such person(s)    |
|  may be subject to the maximum allowable penalty as permitted under such law. |
|-------------------------------------------------------------------------------|
|  You acknowledge and agree that information presented to you through this     |
|  site (the "Web Site") is protected by all applicable copyrights, trademarks, |
|  service marks, patents or other proprietary rights and laws, and by virtue   |
|  of accessing the Web Site, except as expressly authorized by the Azalea      |
|  Technology, LLC., you agree not to modify, rent, lease, loan, sell,          |
|  distribute, store, or create derivative works based on the Web Site, in      |
|  whole or in part.                                                            |
 -------------------------------------------------------------------------------

 Organization: Azalea Technology, LLC.
       Domain: www.erickbarnes.com
         Date: Saturday, July 30, 2005 12:18 PM CST
      Purpose: JavaScript functions for rotating tv image
   Programmer: B. Roberts
               Azalea Technology, LLC.
			   P.O. Box 131150
			   Tyler, TX 75713-1150
               (903) 581-4448
               broberts@azaleatech.com
			   http://www.azaleatech.com
*/
var index = 0, timer_id;

function next_pic(next){
 	
	var old = index;
	index=index+next;
	
    if(index<0) index = (channelList.length-1);
	else if(index>(channelList.length-1)) index=0;

    swap_img("channel","",dir+channelList[index][0],1);
	change_link(dir1+channelList[old][1],dir1+channelList[index][1]);
}

function start_show(){
	next_pic(1);
	if(index==0) return true;
	else timer_id = window.setTimeout("start_show()",3000);
}

function pause_show(){
	window.clearTimeout(timer_id);
}

function stop_show(){
	window.clearTimeout(timer_id);
	next_pic(1000);
}

function change_link(link_current_href,link_new_href){
	if(link_new_href=="" || link_new_href == null ) return;
	d = document;
	dl = document.links;
	str = "";
	for(var i=0;i<dl.length;i++){
		if(d.links[i].href == link_current_href){
			d.links[i].href = link_new_href;
			break;
		}
	}
}

//-->
