function gotoPrint(elem) {
   var obj = window.open('','printwin','');
   elem = document.getElementById(elem).innerHTML;
   obj.document.open();
   obj.document.writeln("<style> body {font-family:verdana;} .printnoshow {display:none;} @media print {#close{display:none;}}</style>");
   obj.document.writeln("<script>window.print();</script>");
   obj.document.writeln("<a id='close' href='javascript:window.close();'>close window</a>");
   obj.document.writeln("<h2 style='text-align:center;'>Lake Spokane Little League Information</h2>");
   obj.document.writeln(elem);
   obj.document.close();
   obj.focus();
}

function getCalendar(timestamp) {
	if (timestamp.length>0) {
		// creates XMLHttpRequest object
		if (window.XMLHttpRequest) {
			req = new XMLHttpRequest();
		}
		else if (window.ActiveXObject) {
			req = new ActiveXObject("Microsoft.XMLHTTP");
		}
		req.open("GET", "/includes/calendar_ajax.asp?timestamp=" + timestamp, false);
		req.send(null);
		retText = trim(req.responseText);
		if (retText=="error") {
			alert('There was an error trying to retrieve calendar.');
		} else {
			document.getElementById("calendar").innerHTML = retText;
		}
	} else { 
		alert('No date was provided.');
	}	
}

function trim(str) {
	str = str.replace(/^\s+/, '');
	for (var i = str.length - 1; i >= 0; i--) {
		if (/\S/.test(str.charAt(i))) {
			str = str.substring(0, i + 1);
			break;
		}
	}
	return str;
}



// Set slideShowSpeed (milliseconds)

var slideShowSpeed = 3000



// Duration of crossfade (seconds)

var crossFadeDuration = 1





// =======================================

// do not edit anything below this line

// =======================================

var t

var j = 0
if (typeof Pic != 'undefined') {
    var p = Pic.length

    var preLoad = new Array()

    for (i = 0; i < p; i++){

        preLoad[i] = new Image()

       preLoad[i].src = Pic[i]

    }
}



function runSlideShow(){

   if (document.all){

      document.images.SlideShow.style.filter="blendTrans(duration=2)"

      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"

      document.images.SlideShow.filters.blendTrans.Apply()

   }

   document.images.SlideShow.src = preLoad[j].src
   document.getElementById("SlideShowLink").href = Link[j];
   document.getElementById("SlideShowLink").title = Title[j];
   document.getElementById("SlideShowLink").alt = Title[j];
   if (j==3||j==4) {
   	document.getElementById("SlideShowLink").target="";
   }

   if (document.all){

      document.images.SlideShow.filters.blendTrans.Play()

   }

   j = j + 1

   if (j > (p-1)) j=0

   t = setTimeout('runSlideShow()', slideShowSpeed)

}

//Menu dropdowns for IE
startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
window.onload=startList;