/**************************************

User Interface functions for web pages.

***************************************/

// Clears a field with label text on focus.
function ClearFieldLabelText(field, labelText)
{
	if (field.value == labelText)
	{
		field.className = 'fieldLabelTextCleared';
		field.value = '';
		field.select();
	}
}

// Restores label text to a field on blur.
function RestoreFieldLabelText(field, labelText)
{
	if (field.value == '')
	{
		field.className = 'fieldLabelText';
		field.value = labelText;
	}
}

// Changes the css class of the specified element.
g_restoreCssClass = "";
g_restoreCssElement = null;
function ChangeCssClass(element, className)
{
	g_restoreCssElement = element;
	g_restoreCssClass = element.className;
	element.className = className;
}

// Restores changed css class.
function RestoreCssClass()
{
	if (g_restoreCssElement != null) {
		g_restoreCssElement.className = g_restoreCssClass;
	}
}

// Changes the image of an element.
function ChangeImage(element, image)
{
	element.src = image;
}

function MM_swapImgRestore() //v3.0
{
	var i;
	var x;
	var a = document.MM_sr;
	for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++) {
		x.src = x.oSrc;
	}
}

function MM_preloadImages() //v3.0
{
	var d = document;
	if (d.images) {
		if (!d.MM_p) {
			d.MM_p=new Array();
		}
		var i;
		var j = d.MM_p.length;
		var a = MM_preloadImages.arguments;
		for (i = 0; i < a.length; i++) {
			if (a[i].indexOf("#") != 0) {
				d.MM_p[j] = new Image;
				d.MM_p[j++].src=a[i];
			}
		}
	}
}

function MM_findObj(n, d) //v4.01
{
	var p;
	var i;
	var x;
	if (!d) {
		d=document;
	}
	if ((p = n.indexOf("?")) > 0 && parent.frames.length) {
		d = parent.frames[n.substring(p + 1)].document;
		n = n.substring(0,p);
	}
	if (!(x = d[n]) && d.all) {
		x = d.all[n];
	}
	for (i = 0; !x && i < d.forms.length; i++) {
		x = d.forms[i][n];
	}
	for (i = 0; !x && d.layers && i < d.layers.length; i++) {
		x = MM_findObj(n, d.layers[i].document);
	}
	if (!x && d.getElementById) {
		x = d.getElementById(n);
	}
	return x;
}

function MM_swapImage() //v3.0
{
	var i;
	var j = 0;
	var x;
	var a = MM_swapImage.arguments;
	document.MM_sr = new Array;
	for (i = 0; i < (a.length - 2); i += 3) {
		if ((x = MM_findObj(a[i])) != null) {
			document.MM_sr[j++] = x;
			if (!x.oSrc) {
				x.oSrc = x.src; 
			}
			x.src=a[i+2];
		}
	}
}



prevStep = 0;

difference_text1 = "You can then zoom-in and see the information added. The separate work of several submitters is often chained together creating a massive family tree.  Users who tie into the core of our family tree through a match often gain hundreds, thousands or tens of thousands of ancestors.";
difference_text2 = "Saves you a lot of time while also making it easier to research your family tree by condensing hundreds or thousands of duplicates down to a single record. Why look at a hundred duplicate records with minor variations when you can look at a single record with variations highlighted.";
difference_text3 = "Whether you add 5, 500 or 5,000 names, including all names uploaded in a GEDCOM, OneGreatFamily will do all the search work for you. This saves you the time and effort of conducting these searches manually.  OneGreatFamily often finds information for people or family lines you aren&#8217;t even researching right now.";
difference_text4 = "We have discovered that, just as a fingerprint is a unique identifier for a person, so also a genealogy &quot;handprint&quot;, as we call it, is a unique genealogical identifier. This special handprint is made up of a person and their immediate family connections. Handprint matching is far more accurate than manual searching on just names, dates, and places and makes it more likely you will find additional ancestors. ";
difference_text5 = "When there are differences of opinion, OneGreatFamily maintains all those differences, and allows each person to see each version and choose the one he or she determines to be correct for their personal family tree. Your data is safe with us.  Nobody can change your view of the tree without your consent. But everybody can see your version, collaborate with you to find out why you think your version is right, and accept your view if they choose to.";
difference_text6 = "Collaboration is built right into the system to help resolve differences. Genealogy is less effective when done in isolation.  At OneGreatFamily, you are always working in a collaborative environment.  You can easily see, collaborate with and gain the benefit of the work of others.";

function showDescText(step)
{
	var stepCell = document.getElementById("step" + step);
	stepCell.className = "bodyTextLink_hover";
	var dataHolder = document.getElementById("dataHolder");
	dataHolder.innerHTML = window["difference_text" + step];
	//alert (prevStep);
	if (prevStep > 0 && prevStep != step) {
		var previous = document.getElementById("step" + prevStep);
		previous.className = "bodyTextLink";
	}
	prevStep = step;
}



learn_step1 = "The OneGreatFamily Tree is a powerful genealogy database that is shared and built by people like you all over the world.<br /><br />Every single name, date, place, picture, biography and video clip has been submitted by people like you. In fact, the OneGreatFamily Tree started without a single name. Users in over 170 countries have submitted millions of names . . . and we've only just begun!<br /><br />So what does a \"shared\" worldwide database mean to you? It means someone else may have already entered dozens or even hundreds of your ancestors!";
learn_step2 = "Spend some time searching for your ancestors at OneGreatFamily and pay special attention to new information that is added to your pedigree over time. This will help you know what research others have already done or are doing on your family tree.<br /><br />You can then spend your time conducting new research or simply verifying information that others have provided.";
learn_step3 = "OneGreatFamily allows people around the world to work on one common family tree. This means others can be researching and improving information on your ancestors.<br /><br />Wouldn't you like to meet and collaborate with these genealogical cousins? You can! OneGreatFamily provides collaboration features that allow you to work with other researchers and family members.";
learn_step4 = "At OneGreatFamily, you can search millions of names in the OneGreatFamily Tree and in the Social Security Death Index.<br /><br />When you find an individual that you would like to learn more about, simply click on them to view detailed information that we store in our databases.";
learn_step5 = "OneGreatFamily provides you with powerful software for viewing, organizing, and saving your family tree.<br /><br />As your family tree continues to grow, you can easily see what you have accomplished and where OneGreatFamily has helped. OneGreatFamily does what no other family tree software can do by letting you see your entire family tree at one time! You can zoom in to see more detail and zoom out to get a view of your family tree.";
learn_step6 = "As long as you have an internet connection and appropriate computer setup, you can view and edit your data from anywhere in the world.";
learn_step7 = "Create your family tree and watch it grow automatically over time.<br /><br />OneGreatFamily searches for ALL of your ancestors, ALL the time. Automatic processes continually review the ever-growing OneGreatFamily Tree.<br /><br />If two individuals are identical, they are automatically identified as being the same. If the individuals appear to be the same person but have different relationships, birth data, or death data, you will be able to manually determine if they are the same and merge the records together.";
learn_step8 = "OneGreatFamily stores your data on our servers and regularly stores a back up.<br /><br />As a result, you don't have to worry anymore about your computer getting a virus, having a hardware failure, or otherwise causing the loss of your genealogy data.";
learn_step9 = "We connect you to the largest family tree online so you can see how you are related to the rest of humanity!<br /><br />Start by creating your family tree at OneGreatFamily or by submitting a family tree you have already created. If anyone else has been working on your family tree, OneGreatFamily will automatically identify common ancestors and tie your family's branch into the largest single family tree available.";

function showLearnDoText(step)
{
	var stepCell = document.getElementById("step" + step);
	stepCell.className = "learnDoLinks_hover";
	var dataHolder = document.getElementById("dataHolder");
	dataHolder.innerHTML = window["learn_step" + step];
	//alert (prevStep);
	if (prevStep > 0 && prevStep != step) {
		var previous = document.getElementById("step" + prevStep);
		previous.className = "learnDoLinks";
	}
	prevStep = step;
}
