// JavaScript Document
var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
  xmlhttp = new XMLHttpRequest();
}
function examplelink(id) {
	xmlhttp.open("GET", "/thunder/site/jscript_nav_link.asp?id="+ id +"",true);
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4) {
			 document.getElementById('list' + id).innerHTML = xmlhttp.responseText;
		}
	}
	document.getElementById('plus' + id).innerHTML = "";
	document.getElementById('minus' + id).innerHTML = "<img src=/thunder/images/minus.gif border=0>";
	xmlhttp.send(null);
}

function examplelinkAds(id) {
	xmlhttp.open("GET", "/thunder/site/ads_jscript_nav_link.asp?id="+ id +"",true);
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4) {
			 document.getElementById('list' + id).innerHTML = xmlhttp.responseText;
		}
	}
	document.getElementById('plus' + id).innerHTML = "";
	document.getElementById('minus' + id).innerHTML = "<img src=/thunder/images/minus.gif border=0>";
	xmlhttp.send(null);
}

function example1(id) {
	xmlhttp.open("GET", "/thunder/site/jscript_nav.asp?id="+ id +"",true);
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4) {
			 document.getElementById('list' + id).innerHTML = xmlhttp.responseText;
		}
	}
	document.getElementById('plus' + id).innerHTML = "";
	document.getElementById('minus' + id).innerHTML = "<img src=/thunder/images/minus.gif border=0>";
	xmlhttp.send(null);
}



function removeexample1(id) {
	document.getElementById('plus' + id).innerHTML = "<img src=/thunder/images/plus.gif border=0>";
	document.getElementById('minus' + id).innerHTML = "";
	document.getElementById('list' + id).innerHTML ="";
}

//-----------------------NEWS FUNCTIONS-------------------------

function newscontent(id) {
	xmlhttp.open("GET", "content.asp?id="+ id +"",true);
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4) {
			 document.getElementById('news' + id).innerHTML = xmlhttp.responseText;
		}
	}
	//document.getElementById('plus' + id).innerHTML = "";
	//document.getElementById('minus' + id).innerHTML = "<img src=/content/thunder/images/minus.gif border=0>";
	xmlhttp.send(null);
}
function removecontent(id) {
	document.getElementById('news' + id).innerHTML = "";
}
function confirmSubmit(text)
{
var agree=confirm("Are you sure you wish to delete this record: " + text + "?");
if (agree)
	document.getElementById('form' + text).submit() ;
else
	return false ;
}

function confirmSubmitImage(text)
{
var agree=confirm("Are you sure you wish to delete the image for this record: " + text + "?");
if (agree)
	document.getElementById('formImage' + text).submit() ;
else
	return false ;
}

function passLink(strvalue){
	//alert(strvalue);
	window.opener.document.frmAds.adlink.value=strvalue;
	window.self.close();
}

function loadBeerTour(pageindex) {
	xmlhttp.open("GET", "/thunder/beer/load.asp?pageindex="+ pageindex +"",true);
	 document.getElementById('beerTour').innerHTML = 'Loading beer...';
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4) {
			 document.getElementById('beerTour').innerHTML = xmlhttp.responseText + "<br><a href=\"#\" onClick=\"window.open('http://www.WinkingLizardWorldTour.com/lookup.php','reportwindow','location=no,toolbar=no,width=680,height=620,left=10,top=10,screenX=1,screenY=1,status=no,scrollbars=yes,resize=yes');return false\"><img src='/data/content/images/worldTourLogo.png' border='0' /></A><br>";
		}
	}
	xmlhttp.send(null);
}

/*-------------GALLERY FUNCTIONALITY----------*/
function imageDescription(imageid){
	xmlhttp.open("GET", "/thunder/gallery/image_edit.asp?imageid="+ imageid +"",true);
	 document.getElementById('image' + imageid).innerHTML = "loading....";
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4) {
			 document.getElementById('image' + imageid).innerHTML = xmlhttp.responseText;
		}
	}
	//document.getElementById('plus' + id).innerHTML = "";
	//document.getElementById('minus' + id).innerHTML = "<img src=/content/thunder/images/minus.gif border=0>";
	xmlhttp.send(null);
	
}

function saveDescription(imageid){
	var description = document.getElementById('description'+imageid).value;
	xmlhttp.open("GET", "/thunder/gallery/image_save.asp?imageid="+ imageid +"&description=" + description,true);
	 document.getElementById('image' + imageid).innerHTML = "loading....";
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4) {
			 document.getElementById('image' + imageid).innerHTML = xmlhttp.responseText;
		}
	}
	//document.getElementById('plus' + id).innerHTML = "";
	//document.getElementById('minus' + id).innerHTML = "<img src=/content/thunder/images/minus.gif border=0>";
	xmlhttp.send(null);
	
	
}
function confirmit(text,url){
	if(confirm(text)){
		window.location = url;
			   }
	
}
function confirmSubmitImage(text)
{
var agree=confirm("Are you sure you wish to delete the image for this record: " + text + "?");
if (agree)
	document.getElementById('formImage' + text).submit() ;
else
	return false ;
}

/*---------------END OF GALLERY FUNCTIONALITY--------------------*/


