function slideshow_homepage(){
	$(".ngg-galleryoverview").each(function(i){
		
		// alert( + " ---- ")
		
		$( "#" + $(this).attr("id") ).prependTo( "#" + $("#" + $(this).attr("id")).parents("div:first").attr("id") );
		$( "#" + $(this).attr("id") ).attr("style", "float: right; width: 115px; margin: 0px;");
		
		// $('#box3').prependTo('#container')
		
		
		$("#" + $(this).attr("id") + " .ngg-gallery-thumbnail-box").each(function(i){
			if(i>0){ $(this).attr("style", "display: none;"); }
		});
	});
}


function ajaxsubmit(obj){
	
	var queryString = "?";
	
	if(validemail(obj.email.value)){
		
		var linkarr = obj.elements;
		for (var i = 0; i < linkarr.length; i++) {
			queryString += linkarr[i].getAttribute("name") + "=" + escape(linkarr[i].value) + "&";
		}

		var submission_result = getremotevalue(obj.action + queryString);
		
		if(submission_result == "error"){
			alert("There was an error adding you to the mailing list. You can try again if you like.");
		} else {
			alert("Thanks for subscribing to our spam, it means so much to us!");
			obj.email.value = "Your Email Address Here";
		}
		
	} else {
		
		alert("Invalid Email Address!");
		
	}
	
	return false;
}

function getremotevalue(url)
{
	var content = '';
	
	if (window.XMLHttpRequest) {
		request = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		request = new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	if (request){
		request.open("GET", url, false);
		request.send(null);
		
		if (request.status == 200) {
			content = request.responseText;
		} else {
			content = 'Error: ' + request.status + ' ' + request.statusText;
		}
	}
	return content;
}
