function LoadGallery(pictureName,imageFile,titleCaption,captionText)
{
  var picture = document.getElementById(pictureName);
  if (picture.filters)
  {
    picture.style.filter="blendTrans(duration=1)";
    picture.filters.blendTrans.Apply();
  }
  picture.src = imageFile;
  if (picture.filters)
  {
    picture.filters.blendTrans.Play();
  }
  document.getElementById(titleCaption).innerHTML=captionText;
};
function ajax_item(e) {
	if (typeof e == 'string') e = document.getElementById(e);
	return e
};
function collect(a, f) {
	var n = [];
	for (var i = 0 ; i < a.length; i++) {
		var v = f(a[i]);
		if (v != null) n.push(v)
	}
	return n
};
ajax = {};
ajax.x = function() {
	try {
		return new ActiveXObject('Msxml2.XMLHTTP')
	} catch(e) {
		try {
			return new ActiveXObject('Microsoft.XMLHTTP')
		} catch(e) {
			return new XMLHttpRequest()
		}
	}
};
ajax.post = function(url, func, args) {
	ajax.send(url, func, 'POST', args)
};




// jQuery Togglers
$(document).ready(function(){
$('.toggle-more').hide();
$('#fadein-more').toggle(function() {
	$(this).siblings('.toggle-more').fadeIn('slow');
}, function() {
	$(this).siblings('.toggle-more').fadeOut('slow');
});
});

$(document).ready(function(){
$('.toggle-more-videos').hide();
$('#fadein-more-videos').toggle(function() {
	$(this).siblings('.toggle-more-videos').fadeIn('slow');
}, function() {
	$(this).siblings('.toggle-more-videos').fadeOut('slow');
});
});

$(document).ready(function(){
$('.toggle-bbcode').hide();
$('#fadein-bbcode').toggle(function() {
	$(this).siblings('.toggle-bbcode').fadeIn('slow');
}, function() {
	$(this).siblings('.toggle-bbcode').fadeOut('slow');
});
});

$(document).ready(function(){
$('#fadeout-carousel').toggle(function() {
	$(this).siblings('.toggle-carousel').fadeOut('slow');
}, function() {
	$(this).siblings('.toggle-carousel').fadeIn('slow');
});
});

// sfHover Menu Drop Down
sfHover = function() {
	if (!document.getElementsByTagName) return false;
	var sfEls = document.getElementById("nav").getElementsByTagName("li");

	// If you have two menus, remove comment below and change secnav to your class //
	// var sfEls1 = document.getElementById("secnav").getElementsByTagName("li");

	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}

	// If you have two menus, remove comments below //
	//for (var i=0; i<sfEls1.length; i++) {
	//	sfEls1[i].onmouseover=function() {
	//		this.className+=" sfhover1";
	//	}
	//	sfEls1[i].onmouseout=function() {
	//		this.className=this.className.replace(new RegExp(" sfhover1\\b"), "");
	//	}
	//}

}
if (window.attachEvent) window.attachEvent("onload", sfHover);



// JQuery hover fade-in
$(document).ready(function(){
$(".fadeit").fadeTo("slow", 1.0); // This sets the opacity to 100% when the page loads
$(".fadeit").hover(function(){
	$(this).fadeTo("slow", 0.6); // This should set the opacity down to 30% on hover
},function(){
	$(this).fadeTo("slow", 1.0); // This should set the opacity back to 100% on mouseout
});
});

// JQuery hover fade-out
$(document).ready(function(){
$(".fadeout").fadeTo("slow", 0.6); // This sets the opacity to 30% when the page loads
$(".fadeout").hover(function(){
	$(this).fadeTo("slow", 1.0); // This should set the opacity down to 100% on hover
},function(){
	$(this).fadeTo("slow", 0.6); // This should set the opacity back to 30% on mouseout
});
});

