function checkAll(id){
var f = document.getElementById(id);
var inputs = f.getElementsByTagName("input");
for(var t = 0;t < inputs.length;t++){
if(inputs[t].type == "checkbox")
inputs[t].checked = true;
}
}
function uncheckAll(id){
var f = document.getElementById(id);
var inputs = f.getElementsByTagName("input");
for(var t = 0;t < inputs.length;t++){
if(inputs[t].type == "checkbox")
inputs[t].checked = false;
}
}
function invertAll(id){
var f = document.getElementById(id);
var inputs = f.getElementsByTagName("input");
for(var t = 0;t < inputs.length;t++){
if(inputs[t].type == "checkbox")
inputs[t].checked = !inputs[t].checked;
}
}
function hideDiv(elName) {
var theElement = document.getElementById(elName);
if (theElement) {
theElement.style.display = "none";
}
}
function showDiv(elName) {
var theElement = document.getElementById(elName);
if (theElement) {
theElement.style.display = "block";
}
}
function getNodeValue(obj,tag)
{
node=obj.getElementsByTagName(tag);
if(node!=null && node.length>0) {
return node[0].firstChild.nodeValue;
} else {
return null;
}
}
function getRootNode(xmlHttpReq)
{
return xmlHttpReq.responseXML.getElementsByTagName('root')[0];
}
function toggleVisibility(eleName, setVisible)
{
var newstate = "none"
if(setVisible == true)
newstate = ""
var style = document.getElementById(eleName).style;
style.display = newstate;
}
function setInnerHTML(div_id, value)
{
var dstDiv = document.getElementById(div_id);
dstDiv.innerHTML = value;
}
function toggleDisplay(divName){
var tempDiv = document.getElementById(divName);
if (!tempDiv) {
return false;
}
if (tempDiv.style.display=="block"){
tempDiv.style.display="none";
return false;
} else if (tempDiv.style.display=="none"){
tempDiv.style.display="block";
return true;
}
}
function showLoading(div_id)
{
var temp_HTML = "<br><br><br><br><br><center><img src='"+base_url+"images/icons/ajax_loading.gif'></center><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>";
document.getElementById(div_id).innerHTML = temp_HTML;
document.body.focus();
}
function getFileName(file) {
document.upload.filename_fl.value = file;
}

var changing_thumbs = new Array();
function changeThumb(index, i, num_thumbs, thumb, attempt)
{
if (changing_thumbs[index])
{
if ( i > num_thumbs )
{
i = 1;
}	lthumb = new Image();
lthumb.src = pic_url + "thumbs/" + thumb + "-" + i + ".jpg";
//	--- .complete property not supported in IE9, replaced with .onload function --- // if ( lthumb.complete )
lthumb.onload = function()
{
document.getElementById(index).src = pic_url + "thumbs/" + thumb + "-" + i + ".jpg";
i++;
setTimeout("changeThumb('" + index + "'," + i + ", " + num_thumbs + ", '" + thumb + "', 1)", 600);
}
// --- replaced with lthumb.onerror function --- // else
lthumb.onerror = function()
{
setTimeout("changeThumb('" + index + "'," + i + ", " + num_thumbs + ", '" + thumb + "', 1)", 20);
}
}
}	function startThumbChange(index, num_thumbs, thumb)
{	
	if(thumb != "no_image.gif"){
	  	changing_thumbs[index] = true;	
		num_thumbs = num_thumbs - 1;	changeThumb(index, 1, num_thumbs, thumb, 1);
	}
 }
function endThumbChange(index, thumb)
{
changing_thumbs[index] = false;
document.getElementById(index).src = pic_url + "thumbs/" + thumb;
}
function openit()
{
var which="http://gaytube.com/form.html"
whichit=window.open(which,"","width=430,height=680")
}
