function change(){
		var obj = document.getElementById("nm");
		if(obj.value=="Anonymous")
		{
			obj.value="";
			obj.style.color = "#000000";
		}
	}
	function changeback(){
		var obj = document.getElementById("nm");
		if(!obj.value)
		{
			obj.value=obj.innerHTML="Anonymous";
			obj.style.color="#A9A9A9";
		}
	}	
	function bouncer(){
		var com = document.getElementById("cm");
		if(!com.value)
		{
			document.getElementById("err-comment").innerHTML = "You must fill in this field!"
			return;
		}
		else
		{
			document.getElementById("load_gif").innerHTML = "<img src='iui/iui/loading.gif' />";
			ajx_guestbook();
		}
	}
	function submit_ajx(){
		animatedcollapse.toggle('form_main');
                 document.getElementById("form_main2").innerHTML="<h2>Thank you for signing our guestbook!</h2>";
		
	}
function ajx_guestbook(){
       
	var theOne = new XMLHttpRequest();
	var param = "?name="+document.getElementById("nm").value + "&comment=" + document.getElementById("cm").value;
	theOne.onreadystatechange=function()
	{
		if (theOne.readyState==4 && theOne.status==200)
		{
                 
                 if(!theOne.responseText){
					animatedcollapse.toggle('form_main');
                    document.getElementById("form_main2").innerHTML="<h2>Thank you for signing our guestbook!</h2>";
                  }
                 
		}
	}
	theOne.open("GET","submit_lf.php"+param,true);
	theOne.send();
}
function browserDetect()
{
	var bn = navigator.userAgent.toLowerCase();
	if (bn.match("msie"))
	{
		alert("I see you are using a version of Internet Explorer.\nBecause of their lack of compatiblity with standards,\nthis site won't look its best.\nIn order to get the full experience, I suggest you use google Chrome.");
	}
}
function changeFrame(but)
{
	document.getElementById("inlinecontent").src = but;
}
function changeVideoFrame(source)
{
	document.getElementById("video-player").src = "http://img.youtube.com/vi/"+source+"/0.jpg";
	document.getElementById("video-player").src = "http://www.youtube.com/embed/"+source+"?rel=0";
}
function imageRetitling()
	{
		var theOne = new XMLHttpRequest();
		var dir = document.getElementById("dir").value;
		var param = "?ts=" + dir;
		theOne.onreadystatechange=function()
		{
			if (theOne.readyState==4 && theOne.status==200)
			{
				document.getElementById("renaming").innerHTML = theOne.responseText;		
				document.getElementById("form_dir").value = "http://www.lipkinfamily.com/" + dir;
				document.getElementById("thumb_dir").value = "http://www.lipkinfamily.com/" + dir + "/thumbnails";
				imageResizing();
				
			}
		}
		theOne.open("POST","imageRE.php"+param,true);
		theOne.send();
	}
	function imageResizing()
	{
		var theOne = new XMLHttpRequest();
		var dir = document.getElementById("dir").value;
		var param = "?dir=" + dir;
		theOne.onreadystatechange=function()
		{
			if (theOne.readyState==4 && theOne.status==200)
			{
					document.getElementById("please_wait").innerHTML = "";
					document.getElementById("tn").innerHTML = "Get The Thumbnails<br>";
					
			}
		}
		theOne.open("POST","thumbnailer.php"+param,true);
		theOne.send();
		document.getElementById("please_wait").innerHTML = "Please wait...loading...";
	}
	function getThumbnails()
	{
		var theOne = new XMLHttpRequest();
		var dir = document.getElementById("dir").value;
		var param = "?dir=" + dir;
		theOne.onreadystatechange=function()
		{
			if (theOne.readyState==4 && theOne.status==200)
			{
				document.getElementById("please_wait").innerHTML = "Click on the pic you would like to be the cover";
				 document.getElementById("thumbnails").innerHTML = theOne.responseText;
			}
		}
		theOne.open("POST","coverInner.php"+param,true);
		theOne.send();
		
		
	}
	function imageCover(param)
	{
		var theOne = new XMLHttpRequest();
			
		theOne.onreadystatechange=function()
		{
			if (theOne.readyState==4 && theOne.status==200)
			{
				 document.getElementById("cover").innerHTML = "<h3>The Cover Picture</h3>" + theOne.responseText;
				 document.getElementById("theForm").style.display = "block";
			}
		}
		theOne.open("POST","resize.php"+param,true);
		theOne.send();
	}
