var isIE = (document.getElementById && document.all)?true:false;
var isNS4 = (document.layers)?true:false;
var isNS6 = (document.getElementById && !document.all)?true:false;
var speed = 5;
var scrollMe;
var divHeight;

function myGetElementById (id)
{
    if ( isIE )
    {
	var str = "document.all('" + id + "')";
	var o = eval(str);
	return o;
    }

    return document.getElementById(id);
}

function setImage (what, imgUrl)
{
    var obj;

    if ( typeof (what) == "string" )
	obj = myGetElementById(what);
    else
	obj = what;

    if ( obj ) obj.src = imgUrl;
}

function preload() 
{
     // counter
     var i = 0;

     // create object
     imageObj = new Image();

     // set image list
     images = new Array();
     images[0]="images/nav-newsf2.gif"
     images[1]="images/nav-storef2.gif"
     images[2]="images/nav-tourf2.gif"
     images[3]="images/nav-bandf2.gif"
     images[4]="images/nav-archivef2.gif"
     images[5]="images/nav-mediaf2.gif"
     images[6]="images/nav-linksf2.gif"
     images[7]="images/nav-contactf2.gif"
     images[8]="images/nav-listenf2.gif"

     // start preloading
     for(i=0; i<=6; i++) 
     {
          imageObj.src=images[i];
     }

} 

function popup(theURL,winName,features,arg4,arg5) { //v2.0
  if ( arg4 || arg5 ) {
      if ( theURL == "" )
      {   
	  alert ("Please select a valid link");
	  return false;
      }

      if ( ! arg5 )
      {   
	  arg5 = "0";
      }
			  
      features = 'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=' + arg5 + ',resizable=0,width=' + features + ',height=' + arg4;
  }

  window.open(theURL,winName,features);
  return false;
}

function clear_input(id)
{
myGetElementById(id).value = "";
}

function showname(id2) {
	myGetElementById(id2).style.display = "block";
	myGetElementById('intro').style.display = "none";
}

function hidename(id2) {
	myGetElementById(id2).style.display = "none";
	myGetElementById('intro').style.display = "block";
}

/***********************************************
* Dynamic Ajax Content- © 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
***********************************************/

var loadedobjects=""
var rootdomain="http://"+window.location.hostname

function ajaxpage(url, containerid, scrollQuiz){
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid, scrollQuiz)
}
page_request.open('GET', url, true)
page_request.send(null)
}

function loadpage(page_request, containerid, scrollQuiz){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
document.getElementById(containerid).innerHTML=page_request.responseText;
if (myGetElementById('headline_container')) {
	initNewsScroll();
} else if (scrollQuiz='yes') {
	setScroll(containerid);
}

}

function loadobjs(){
if (!document.getElementById)
return
for (i=0; i<arguments.length; i++){
var file=arguments[i]
var fileref=""
if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
if (file.indexOf(".js")!=-1){ //If object is a js file
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", file);
}
else if (file.indexOf(".css")!=-1){ //If object is a css file
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);
}
}
if (fileref!=""){
document.getElementsByTagName("head").item(0).appendChild(fileref)
loadedobjects+=file+" " //Remember this object as being already added to page
}
}
}

function movedown()
{
if (parseInt(scrollMe.style.top)>=(divHeight*(-1)+100))
scrollMe.style.top=parseInt(scrollMe.style.top)-speed+"px"
movedownvar=setTimeout("movedown()",20)
}

function moveup()
{
if (parseInt(scrollMe.style.top)<=0)
scrollMe.style.top=parseInt(scrollMe.style.top)+speed+"px";
moveupvar=setTimeout("moveup()",20);
}

function setScroll(id)
{
scrollMe = myGetElementById(id);
divHeight = myGetElementById(id).offsetHeight;
scrollMe.style.top = 0;
}

/*************************************************************************
  This code is from Dynamic Web Coding at www.dyn-web.com
  Copyright 2001-4 by Sharon Paine 
  See Terms of Use at www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/
function initNewsScroll() {
  // arguments: id of layer containing scrolling layers (clipped layer), id of layer to scroll, 
  // if horizontal scrolling, id of element containing scrolling content (table?)
  var wndo1 = new dw_scrollObj('headline_container', 'headline_content', null);
  var wndo2 = new dw_scrollObj('story_container', 'story_content', null);
}
/************************************************************************
  End Dynamic Web Code
*************************************************************************/

function newsLoad() {
	ajaxpage('/cat-bin/board/show?topic_id=835&tid=915&noheader=1&max=6','headline_content','yes');
	ajaxpage('/cat-bin/board/show?topic_id=835;tid=916;noheader=1;max=1','story_content','yes');
	preload();
	setImage('navnews','images/nav-newsf2.gif');
}

function newsArchivesLoad() {
	ajaxpage('/cat-bin/board/show?topic_id=835&tid=925;noheader=1','archive_story_content','yes');
	preload();
	setImage('navnews','images/nav-newsf2.gif');
}

function tourLoad() {
	ajaxpage('/cat-bin/schedule/show?artist_id=309&noheader=std&tn=ll_tourtable&start_date=today;noheader=1','dates_content','yes');
	preload();
	setImage('navtour','images/nav-tourf2.gif');
}

function bandLoad() {
	ajaxpage('/cat-bin/bio/show?artist_id=309;tn=ll_bio','band_content','yes');
	preload();
	setImage('navband','images/nav-bandf2.gif');
}

function mediaLoad() {
	ajaxpage('discography.html','media_content','yes');
	preload();
	setImage('navmedia','images/nav-mediaf2.gif');
}

function linksLoad() {
	preload();
	setImage('navlinks','images/nav-linksf2.gif');
}

function contactLoad() {
	preload();
	setImage('navcontact','images/nav-contactf2.gif');
}

function archiveLoad() {
	preload();
	setImage('navarchive','images/nav-archivef2.gif');
}

function joinList() {
	myGetElementById('thanx').style.display = "inline";
	myGetElementById('email').style.display = "none";
	myGetElementById('submit').style.display = "none";
}

