

function process_string(string){

	// strip out any HTML tags
	var re= /<\S[^><]*>/g
	string = string.replace(re, "")

	// equivalent to URLEncode in PHP
	string = escape(string)
	
	return string;
}


function download_pics(email) {

	window.open("http://touringphotobooth.com/jj/download.py?email=" + email,"","resizable=1,scrollbars=1,toolbar=no,location=no,status=no,width=320,height=400,menubar=no");

}


function send_to_friend(email, name1, friend1, friend2, friend3, message1, photo1, photo2, photo3, photo4, folder_name, date_seconds, pledge) {

	// Flash submits with html tags, so strip the HTML
	var email = process_string(email);
	var name1 = process_string(name1);
	var friend1 = process_string(friend1);
	var friend2 = process_string(friend2);
	var friend3 = process_string(friend3);
	var message1 = process_string(message1);
	
	var url = "http://touringphotobooth.com/jj/send_to_friend.php?email=" + email + "&name=" + name1 + "&friend1=" + friend1 + "&friend2=" + friend2 + "&friend3=" + friend3 + "&message=" + message1 + "&photo1=" + photo1 + "&photo2=" + photo2 + "&photo3=" + photo3 + "&photo4=" + photo4 + "&folder_name=" + folder_name + "&date_seconds=" + date_seconds + "&pledge=" + pledge;
	
	window.open(url,"","resizable=1,scrollbars=1,toolbar=no,location=no,status=no,width=320,height=400,menubar=no");


}

