function Set_Cookie(name,value,expires,path,domain,secure) { 
    var cookieString = name + "=" +escape(value) + 
       ( (expires) ? ";expires=" + expires.toGMTString() : "") + 
       ( (path) ? ";path=" + path : ";path=/") + 
       ( (domain) ? ";domain=" + domain : ";domain=LegalZoomAkamai") + 
       ( (secure) ? ";secure" : ";"); 
    document.cookie = cookieString; 
} 
function popUp(url) {
  var sealWin = null;
  self.name = "mainWin"; 
  sealWin = window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=no,scrollbars=no,resizable=1,width=500,height=420');
}
function openPopup(sURL){
  var hndWin = null;
  if(sURL != "uslegalforms/raw/popup.html")
    hndWin = window.open(sURL, "PRESSPASS", 'height=400,width=650,scrollbars=yes,status=no,resizable=yes')
  else
    hndWin = window.open(sURL, "PRESSPASS", 'height=400,width=650,scrollbars=yes,status=no,resizable=yes,toolbar=yes')
}
function validate_newsLetterEmailField( fieldObj ){
  var val = fieldObj? fieldObj.value.replace( /^[ ]+|[ ]+$/gi, "" ): "";
  var emailRE = /^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/gi;
  if (val.match(emailRE))
  {
  	alert("Thank you! You are now subscribed to the LegalZoom newsletter.");
  	return "";
  }
  else
  return "Invalid email address try again.";
}

function validate_newsLetterEmailFieldDownload( fieldObj ){
  var val = fieldObj? fieldObj.value.replace( /^[ ]+|[ ]+$/gi, "" ): "";
  var emailRE = /^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/gi;
  if (val.match(emailRE))
  {
  	//alert("Thank you. Your downloadable guide will be sent to the email address you just entered.");
  	alert("Thank you. Instructions for retrieving your guide will be sent to your email address shortly.");
  	return "";
  }
  else
  return "Invalid email address try again.";
}

function validate_newsLetterEmail( formObj ){
  var val = formObj.elements[ "sEmail" ]? formObj.elements[ "sEmail" ].value.replace( /^[ ]+|[ ]+$/gi, "" ): "";
  var emailRE = /^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/gi;
  
  if (val.match(emailRE))
  {
  	alert("Thank you! You are now subscribed to the LegalZoom newsletter.");
  	return "";
  }
  else
  return "Invalid email address try again.";
}
function newsletterSignup_onSubmit( item ){
  var err = validate_newsLetterEmail( item );
  if ( err != "" ){
    alert( err );
  }
  return err == "";
}
function validate_newsLetterEmail( formObj ){
    if (formObj.elements[ "pdfID" ])
    {
        return formObj.elements[ "sEmail" ]? validate_newsLetterEmailFieldDownload( formObj.elements[ "sEmail" ] ): "";
    }else{
        return formObj.elements[ "sEmail" ]? validate_newsLetterEmailField( formObj.elements[ "sEmail" ] ): "";
    }    
}
function form_doSubmit_getForm( fieldName ){
  var retval = null;
  for ( var i = 0; !retval && i < document.forms.length; i++ ){
    if ( document.forms[ i ].elements[ fieldName ] ){
      retval = document.forms[ i ];
    }
  }
  return retval;
}
function form_doSubmit( url, validate ){
  var fObj = form_doSubmit_getForm( "sEmail" );
  var field = fObj? null: fieldExists( "sEmail" );
  var errStr = "";
  if ( validate && fObj ){
    errStr = validate( fObj );
  } else if ( String( validate ).match( /validate_newsLetterEmail/gi ) && field ){
    errStr = validate_newsLetterEmailField( field );
  }
  if ( errStr == "" ){
    if ( fObj ){
      fObj.action = url;
      fObj.onsubmit = function(){ return true; }
      fObj.submit()
    } else if ( field ){
      url += "?sEmail=" + field.value;
      url += "&referer=" + document.location
       document.location = url;
    }
  } else {
    alert( errStr )
  }
  return errStr;
}
function setField( fieldID, newValue ){
  var ostr = "";
  try{
    if( document.getElementById ){
      document.getElementById( fieldID ).value = newValue;
    }else if( document.all ){
      document.all[ fieldID ].value =  newValue ;
    }
  } catch( e ){}
}
function fieldExists( fieldID ){
  var retval = false;
  try{
    if( document.getElementById && document.getElementById( fieldID ) ){
      retval = document.getElementById( fieldID );
    }else if( document.all.length ){
      retval = document.all[ fieldID ];
    }
  } catch( e ){ }
  
  return retval;
}
function setFieldVisibility( fieldID, visibility ){
  var obj = fieldExists( fieldID )
  if ( obj ){
    obj.style.visibility = visibility;
  }
}
function writeIt(sText,objID) {
	if (document.getElementById) {
		var objX = document.getElementById(objID);
		if ( objX ){
			objX.innerHTML = '';
			objX.innerHTML = sText;
		}
	} else if (document.all) {
		var objX = document.all[objID];
		if ( objX ){
			objX.innerHTML = sText;
		}
	} else if (document.layers) {
		var objX = document.layers[objID];
		if ( objX ){
			sText2 = '' + sText + '';
			objX.document.open();
			objX.document.write(sText2);
			objX.document.close();
		}
	}
}

/* form hander onload ------------------------------------------------------------------------ start */
var sAction="";

var objForm

function reset_newsletter_handler(e)

{

            objForm.action = sAction;

}

function blur_handler(o)

{

            objForm.action = "/welcome/subscribeNewsLetter.asp";

}

function init() {

            // looking forms which containt newsletter subscribe

            bFound = false;

            for(var d=0; d<document.forms.length; d++)

            {

                        for(var i=0; i<document.forms[d].elements.length; i++)

                        {

                                    if(document.forms[d].elements[i].name == "sEmail")

                                    {

                                                bFound = true;

                                    }

                        }

            }

 

            if(bFound)

            {

                        for(var d=0; d<document.forms.length; d++)

                        {

                                    for(var i=0; i<document.forms[d].elements.length; i++)

                                    {

                                                if(document.forms[d].elements[i].name == "sEmail")

                                                {

                                                            objForm = document.forms[d];

                                                            sAction = objForm.action;


                                                            document.forms[d].elements[i].onfocus = blur_handler;
                                                }

                                                else

                                                {

                                                            document.forms[d].elements[i].onfocus = reset_newsletter_handler;

                                                }

                                    }

                        }

            }

}

window.onload = function (e) {

if (self.init)

            init();

}

/* form hander onload ------------------------------------------------------------------------ end */
//------------------------------------------------ newsletter signup sett status start
function setContent( fieldID, newValue ){
  try{
    if( document.getElementById ){
      document.getElementById( fieldID ).innerHTML = newValue;
    }else if( document.all ){
      document.all[ fieldID ].innerHTML =  newValue ;
    }else if(document.layers){
      with(document.layers[ fieldID ].document){
        open();
        write( newValue );
        close();
      }
    }
  } catch( e ){}
}
function setNewsLetterSignupContent(){
  var sLocation = document.location.href;
  var saQuery = sLocation.split("?")
  var nla1Content = "";
  var nla2Content = "DONT SET";
  if(saQuery.length >= 2) {
    var sToFind_a = "signup=1"; //successful
    var sToFind_b = "signup=2"; //error
    var sQuerySmooth = saQuery[1].toLowerCase();

    if(sQuerySmooth.indexOf(sToFind_a) > -1) {
      nla1Content += "Thank you for subscribing to our newsletter.";
      nla2Content = "";
	} else if(sQuerySmooth.indexOf(sToFind_b) > -1) {
      nla1Content += "There appears to be an issue with the e-mail address you typed. Please try entering it again."
	}
    if ( nla1Content != "" ){
      setContent( "nla1", nla1Content ); // if error or ok 
      if ( nla2Content != "DONT SET" ){
        setContent( "nla2", nla2Content ); // if error you want to leave intact
      }
    }
  }
}
//------------------------------------------------ newsletter signup sett status end

//---------------------------------------------- patch for SharePoint no script in reusable content start
var g_openWindow_ext_features = "height=700,width=650,scrollbars=1,resizable=1";
var g_openWindow_namePrefix = "aws_";

function openWindow_ext( url, windowName, windowFeatures ){
  window.open( url, windowName, windowFeatures )
}

function windowFeature( newMatchRE, newCleanRE, newFeatureRE, newFeatureName, newDefaultValue ){
  this.matchRE = newMatchRE;  // match in the src definition string
  this.cleanRE = newCleanRE;
  this.featureRE = newFeatureRE;
  this.featureName = newFeatureName;
  this.defaultValue = newDefaultValue;

  this.getSourceStr = function( tag ){
    var tagName = tag.name? tag.name: "";
    var tagNameRE = new RegExp( g_openWindow_namePrefix, "gi" );
    return tagName.match( tagNameRE )? tagName: "";
  }
  this.getValue = function( tag ){
    var srcStr = this.getSourceStr( tag )
    var valueMatch = srcStr.match( this.matchRE );
    var tmp = valueMatch? String( valueMatch ): "";
    var value = tmp? String( tmp ).replace( this.cleanRE, "" ): this.defaultValue;
    return value;
  }
  this.updateFeatureStr = function( tag, featureStr ){
    var retval = featureStr;
    var value = this.getValue( tag );
    var featureMatch = retval.match( this.featureRE );
    if ( featureMatch ){
      retval = retval.replace( this.featureRE, ( value == ""? "": this.featureName + "=" + value ) );
    } else if ( value != "" ){
      retval += "," + this.featureName + "=" + value;
    }
    return retval.replace( /[,]{2,}/gi, "" );
  }
}
var g_openWindow_knownFeatures = new Array();
    g_openWindow_knownFeatures[ g_openWindow_knownFeatures.length ] = new windowFeature( /w[0-9]+/gi, /w+/gi, /width=[0-9]+/gi, "width", 650 );
    g_openWindow_knownFeatures[ g_openWindow_knownFeatures.length ] = new windowFeature( /h[0-9]+/gi, /h+/gi, /height=[0-9]+/gi, "height", 700 );
    g_openWindow_knownFeatures[ g_openWindow_knownFeatures.length ] = new windowFeature( /sb(yes|no|0|1)/gi, /sb+/gi, /scrollbars=(1|0|yes|no)/gi, "scrollbars", 1 );

function getWindowFeaturesStr( tag ){
  var retval = g_openWindow_ext_features;
  for ( var i = 0; i < g_openWindow_knownFeatures.length; i++ ){
    retval = g_openWindow_knownFeatures[ i ].updateFeatureStr( tag, retval );
  }
  return retval;
}

function resetBlankTargets(){
  var ignorePopup = String( document.location ).match( /sharepoint-test/gi );
  var lObj = false;
  var url = "";
  var onclick = "";
  var trackRe = new RegExp( "[\.]{1}pdf$|[\.]{1}doc$|[\.]{1}txt$", "gi" );
  var dcsMultiTrackRE = new RegExp( "dcsMultiTrack", "gim" );
  var dcsMultiTrack_call_exists = false; try{ dcsMultiTrack_call_exists = dcsMultiTrack_call? true: false; } catch( e ){ }
  var ignoreRE = new RegExp( "^_new$", "gi" );
  var windowFeatures = "";
  try{
    lObj = document.getElementsByTagName( "a" );
  } catch( e ){}
  for ( var i = 0; lObj && i < lObj.length; i++ ){
    url = String( lObj[ i ].href )
    onclick = lObj[ i ].onclick? String( lObj[ i ].onclick ): "";
    if ( !ignorePopup && lObj[ i ].target && !lObj[ i ].target.match( ignoreRE ) ){
      windowFeatures = getWindowFeaturesStr( lObj[ i ] );
      lObj[ i ].href = "javascript:openWindow_ext( '" + url + "', '" + lObj[ i ].target + "', '" + windowFeatures + "' );"
      lObj[ i ].target = "_self";
    } 
    if ( url.match( trackRe ) && !onclick.match( dcsMultiTrackRE ) && dcsMultiTrack_call_exists ){
      if (lObj[ i ].addEventListener ){
        lObj[ i ].addEventListener( "click", function(){ dcsMultiTrack( 'DCS.dcsuri',this.href.replace(/http[s]*:\/\/www.legalzoom.com/ig, ''), 'WT.ti', this.href ); }, false )
      }else if ( window.attachEvent ){
        lObj[ i ].attachEvent( "onclick", function(){ dcsMultiTrack( 'DCS.dcsuri',window.event.srcElement.href.replace(/http[s]*:\/\/www.legalzoom.com/ig, ''), 'WT.ti', window.event.srcElement.href ); } );
      }
    }
  }
}
if (window.addEventListener){ //DOM method for binding an event
  window.addEventListener("load", resetBlankTargets, false)
}else if (window.attachEvent){
  window.attachEvent("onload", resetBlankTargets);
}
//---------------------------------------------- patch for SharePoint no script in reusable content end
var g_sortSelectList_skipFirstOption = true;
function sortSelectList( fieldID, skipFirstOption ){
  var obj = fieldExists( fieldID );
  var options = null;
  var tmp = null;
  var start = skipFirstOption? 1: 0;
  if ( obj ){
    options = obj.options;
    for ( var i = 1; i < options.length; i++ ){
      for ( var j = i + 1; j < options.length; j++ ){
        if ( options[ i ].text > options[ j ].text ){
          tmp = new Option( options[ i ].text, options[ i ].value )
          options[ i ] = new Option( options[ j ].text, options[ j ].value )
          options[ j ] = new Option( tmp.text, tmp.value );
        }
      }
    }
  }
}
/* ----------------------------------------------------------------------------------- added for welcome back start ------------------------- */
function ICA()
{

	NAME_TUPLE = 0;
	PRODUCT_TUPLE = 1;
	DFIELD_TUPLE = 2;
	PRODUCTSTATUS_TUPLE = 3;
	SELLPRODUCT_TUPLE = 4;

	var allcookies = document.cookie;

	if(allcookies == "")
		return 0;
	var sCookies = allcookies.split(';');

	for (iIter in sCookies)
	{
		sCookie = new String(sCookies[iIter]);
		if(sCookie.indexOf("ICA=") > -1)
		{
			
			sValues = sCookie.replace( /^[^=]+=/gi, "" );
			sValues = unescape( sValues ).replace( /\+/gi, " " );
			saValues = sValues.split('|');

			this.firstname = saValues[NAME_TUPLE];
			this.product = saValues[PRODUCT_TUPLE];
			this.dfield = saValues[DFIELD_TUPLE];
			this.productstatus = saValues[PRODUCTSTATUS_TUPLE];
			this.sellproduct = saValues[SELLPRODUCT_TUPLE];
		}
	}
}

function SetICACookie(sMyProduct){

//Get the ICA Cookie



	NAME_TUPLE = 0;
	PRODUCT_TUPLE = 1;
	DFIELD_TUPLE = 2;
	PRODUCTSTATUS_TUPLE = 3;
	SELLPRODUCT_TUPLE = 4;

	var bICAFound = false;
	var allcookies = document.cookie;

	if(allcookies != "")
	{
	  var sCookies = allcookies.split(';');

	  for (iIter in sCookies)
	  {
		sCookie = new String(sCookies[iIter]);
		if(sCookie.indexOf("ICA=") > -1)
		{
			saCookie = unescape(sCookie).split('|');
			if (saCookie[PRODUCTSTATUS_TUPLE]==0)  // in process
			{
				bICAFound = true;
			}
		}
	  }
	}
	if (!bICAFound)
	{
  		var sCookieStr = "";
		var today = new Date();
		var dtExpires = new Date( today.getTime() + (1000 * 60 * 60 * 24))
		//var sDomain = '';
		//var dtExpires = new Date()
		//var sDomain = 'domain=www.legalzoom.com;';
		var sDomain = ""; //'domain=.legalzoom.com;';
        dtExpires.setDate( dtExpires.getDate() + 90 );

		sExpires = dtExpires.toGMTString()

		sCookieStr = "ICA=" + escape( "|" + sMyProduct + "||-1||" )  + ";expires=" + sExpires + ";path=/;" + sDomain;
		document.cookie = sCookieStr;
		//write the ICA cookie
		//Set_Cookie('ICA','|' + sMyProduct + '||-1|',dtExpires, "/", "legalzoomakamai");		
		//Set_Cookie('ICA','|' + sMyProduct + '|-1|',dtExpires, "/", "legalzoomakamai");		
		//Set_Cookie('ICA','|' + sMyProduct + '|-1|',dtExpires, "/", "");		
	}



}

function welcomeBackContentInf(){
  this.cookie = new ICA();
  this.name = "";
  this.product = "";
  this.distinguish = "";
  this.status = -1;
  this.url = "/questionnaire/pre_process1.asp?bICA=True";
  //this.url = "/welcome/signin.asp?ICAJump=true";
  
  
  this.bRenderGuarantee = false;

  this.greetingsStyle = " style='color: #3366ff; font-size: 12pt; font-weight: bold;' "
  
  this.set = function(){
    if ( this.cookie ){
  	  this.name = this.cookie.firstname;
	  this.product = this.cookie.product;
	  this.distinguish = this.cookie.dfield;
	  this.status = this.cookie.productstatus;
	  
	}


  }
  this.inProgress = function(){ return this.status == 0; }
  

  this.getGreatings = function(){ return this.name == ""? "Welcome Back!": "Welcome Back, " + this.name + "."; }

  this.writeGreetings = function(){
    var sOut = this.getGreatings();
    if ( sOut != "" ){
      document.write( "<div " + this.greetingsStyle + ">" + sOut + "</div>" );
    }
  }
  
  this.isDistinguished = function(){ return ((this.distinguish != "") && (this.distinguish != "~N/A")); }
  this.getContinueURL = function(){ return this.url; }
  this.getContinueLink = function(){ return "<a href='" + this.getContinueURL() + "'><img src='/img/buttonGo.gif' border=0></a>"; }
  
  this.getContinuePrompt = function(){
    var basicPrompt = "Are you ready to continue your " + this.product;
    var distinguishPrompt = " for " + this.distinguish;
    var retval = basicPrompt;
    retval += ( this.isDistinguished()? distinguishPrompt: "" ) + "?";
    return retval;
  }
  this.shouldShowHelp = function(){ return this.distinguish != ""; }
  this.writeContent = function( sIn ){  document.write( sIn ); }
  this.getHelpContent = function(){
    return "LegalZoom is ready to help you with a wide range of common legal needs.  " +
           "We've already helped over a million Americans get the protection they need.  " +
           "And 94% of our customers recommend us to their friends and family.";
  }
  this.getGuaranteeContent = function(){
    return this.bRenderGuarantee? "<img title='100% Satisfaction Guarantee' style='margin-right: 5px; border-right:0px solid;border-top:0px solid;border-left:0px solid;border-bottom:0px solid' alt='100% Satisfaction Guarantee' src='/img/freeshipping_08.gif' border=0>": "";
  }
  this.getDefaultTopContent = function(){
    return "<table cellpadding=0 cellspacing=0 border=0 style='width: 100%;'>" +
           "<tr>" + 
           "<td style='vertical-align: top;'>" + 
           "<img style='border-right:0px solid;border-top:0px solid;border-left:0px solid;border-bottom:0px solid; float:left;' alt='Documentation Service' src='/img/legalzoom-homepage-title_logo.gif' border=0><h1 style='float:left; color:#009; font-size:12px; font-weight:blod; padding:12px 0 0 10px; margin:0;'>LEGAL DOCUMENT SERVICE</h1><br clear='left' />" +
           "<DIV CLASS='Text_Standard' STYLE='padding-top:15px; padding-bottom:15px;'>" +
           "Save time and money on common legal matters! Created by top attorneys," +
           " LegalZoom helps you create reliable legal documents from your home or" +
           " office. Simply answer a few questions online and your documents will be" +
           " prepared within 48 hours.* We even review your answers and guarantee" +
           " your satisfaction. </DIV>" + 
           "</td>" +
           "<td style='vertical-align: top;'>" + 
           this.getGuaranteeContent() + 
           "</td>" +
           "</tr>" +
           "</table>";
  }  
  this.getContent = function(){
    var retval =  this.getDefaultTopContent();
    if ( this.inProgress() ){
      retval = "<table cellpadding=0 cellspacing=0 border=0 style='width: 100%;'>" + 
               "<tr>" + 
               "<td style='vertical-align: top;'>" + 
               "<table cellpadding=0 cellspacing=0 border=0  CLASS='Text_Standard'>" +
                "<tr><td colspan=2 " + this.greetingsStyle + ">" + this.getGreatings() + "</td><tr>" +
                "<tr><td colspan=2 style='font-size: 5pt;'>&nbsp;</td><tr>" +
                "<tr>" +
                "<td style='vertical-align: top; font-weight: bold;'>" + this.getContinuePrompt() + "</td>" +
                "<td style='vertical-align: top; text-align: left; width: 110px;'>" + this.getContinueLink() + "</td>" +
                "</tr>" +
                "<tr><td colspan=2 style='font-size: 3pt;'>&nbsp;</td><tr>" +
                "<tr>" +
                "<td colspan=2 style='text-align: top; font-size:8pt'>(If you have already placed your order, <A href=\"/welcome/instant_order_status.asp\">click here</A> for order status.)</td>" +
                "</tr>" +
                "<tr><td colspan=2 style='font-size: 5pt;'>&nbsp;</td><tr>" +
                "<tr>" +
                "<td colspan=2 style='text-align: top;'>" + ( this.shouldShowHelp()? this.getHelpContent(): "" ) + "</td>" +
                "</tr>" +
                "</table>" +
                "</td>" + 
                "<td style='vertical-align: top;'>" + 
                this.getGuaranteeContent() + 
                "</td>" +
                "</table>" +
                "<br>"
    }
    return retval;
  }
  this.getMainRightContent = function(){
    return "<div style='border-bottom: 3px solid #6C9EED;height: 27px; padding-bottom: 5px;margin-bottom: 9px;'>" +
	                 "<IMG SRC='/img/textHelpMeCompare.gif' BORDER=0 width='153' height='16'>" +
	                 "</div>" +
	                 "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 style=' font-family:arial; font-size:11px; padding-left: 2px;'>" +
	                 "<tr>" +
	                 "<td style='vertical-align:top;padding-top:5px; padding-right:5px;' width=1>" +
	                 "<img src='/img/imageSmallArrow.gif' border=0 width='2' height='4'></td>" +
	                 "<TD VALIGN=TOP style='padding-bottom:5px; padding-left: 1px;'><a href='/business-formations/summary-compare-business-formations.html' STYLE='color:#3c6cf4;'>" +
	                 "Should I incorporate or form an LLC?</A></TD>" +
	                 "</TR>" +
	                 "<tr>" +
	                 "<td style='vertical-align:top;padding-top:5px; padding-right:5px;' width=1>" +
	                 "<img src='/img/imageSmallArrow.gif' border=0 width='2' height='4'></td>" +
	                 "<TD VALIGN=TOP style='padding-bottom:5px; padding-left: 1px;'><a href='/wills-estate-planning/summary-compare-wills.html' STYLE='color:#3c6cf4;'>" +
	                 "Last Will, Living Trust or Living Will? </A></TD>" +
	                 "</TR>" +
	                 "<tr>" +
	                 "<td style='vertical-align:top;padding-top:5px; padding-right:5px;' width=1>" +
	                 "<img src='/img/imageSmallArrow.gif' border=0 width='2' height='4'></td>" +
	                 "<TD VALIGN=TOP style='padding-bottom:5px; padding-left: 1px;'><a href='/trademarks-patents-copyrights/summary-compare-trademark-copyright.html' STYLE='color:#3c6cf4;'>" +
	                 "Do I need a Trademark or a Copyright?</A></TD>" +
	                 "</TR>" +
	                 "<tr>" +
	                 "<td style='vertical-align:top;padding-top:5px; padding-right:5px;' width=1>" +
	                 "<img src='/img/imageSmallArrow.gif' border=0 width='2' height='4'></td>" +
	                 "<TD VALIGN=TOP style='padding-bottom:5px; padding-left: 1px;'><a href='/trademarks-patents-copyrights/summary-compare-patents.html' STYLE='color:#3c6cf4;'>" +
	                 "Which type of Patent?</A></TD>" +
	                 "</TR>" +
	                 "</TABLE>";
  }
  this.writeMainRightContent = function(){ this.writeContent( this.getMainRightContent() ); }
  this.getCenterTileContent = function(){
    return "<div style='border-bottom: 3px solid #6C9EED;height: 27px; padding-bottom: 5px; margin-bottom:14px;'>" +
    	             "<IMG SRC='/img/textChooseAService.gif' BORDER=0 width='147' height='16'>" +
    	             "</div>" +
    	             "<table border=0 WIDTH='100%' cellpadding=0 cellspacing=0 STYLE='width:1px; padding-right:0px; height: 220px; vertical-align: top;'>" +
    	             "<tr>" +
    	             "<td STYLE='padding-right:3px; padding-bottom:3px;'>" +
    	             "<a href='/legal-incorporation/incorporation-overview.html' style='color:#000099;text-decoration:underline;font-size:11px;font-weight:bold;'>" +
    	             "<img src='/img/tileinc_off_TESTC.gif' border=0 onMouseOver=\"this.src='/img/tileinc_on_TESTC.gif';\"  onMouseOut=\"this.src='/img/tileinc_off_TESTC.gif';\"></a>" +
    	             "</td>" +
    	             "<td STYLE='padding-bottom:3px;'>" +
    	             "<a href='/limited-liability-company/limited-liability-company-overview.html' style='color:#000099;text-decoration:underline;font-size:11px;font-weight:bold;'>" +
    	             "<img src='/img/tilellc_off_TESTC.gif'  border=0 onMouseOver=\"this.src='/img/tilellc_on_TESTC.gif';\" onMouseOut=\"this.src='/img/tilellc_off_TESTC.gif';\"></A>" +
    	             "</td>" +
    	             "</tr>" +
    	             "<tr>" +
    	             "<td STYLE='padding-right:3px; padding-bottom:3px;'>" +
    	             "<a href='/legal-Wills/wills-overview.html' style='color:#000099;text-decoration:underline;font-size:11px;font-weight:bold;'>" +
    	             "<img src='/img/tilewill_off_TESTC.gif'  border=0 onMouseOver=\"this.src='/img/tilewill_on_TESTC.gif';\" onMouseOut=\"this.src='/img/tilewill_off_TESTC.gif';\"></A>" +
    	             "</td>" +
    	             "<td STYLE='padding-bottom:3px;'>" +
    	             "<a href='/trademarks/trademarks-overview.html' style='color:#000099;text-decoration:underline;font-size:11px;font-weight:bold;'>" +
    	             "<img src='/img/tiletm_off_TESTC.gif'  border=0 onMouseOver=\"this.src='/img/tiletm_on_TESTC.gif';\" onMouseOut=\"this.src='/img/tiletm_off_TESTC.gif';\"></a>" +
    	             "</td>" +
    	             "</tr>" +
    	             "</table>"
  }
  this.writeCenterTileContent = function(){ this.writeContent( this.getCenterTileContent() ); }
  
  this.set();
}
function getWelcomeBackContent(){

  var inf = new welcomeBackContentInf();
  var retval = "";  
 // inf.set();
  retval = inf.getContent()
  return retval;
}

function getStandardContent()
{

    var retval =  "<img style='border-right:0px solid;border-top:0px solid;border-left:0px solid;border-bottom:0px solid' alt='Documentation Service' src='/img/legalzoom-legal-document-service.gif' border=0>" +
                "<DIV CLASS='Text_Standard' STYLE='padding-top:15px; padding-bottom:15px;'>" +
                "Save time and money on common legal matters! Created by top attorneys," +
                " LegalZoom helps you create reliable legal documents from your home or" +
                " office. Simply answer a few questions online and your documents will be" +
                " prepared within 48 hours.* We even review your answers and guarantee" +
                " your satisfaction. </DIV>";
   return retval;


  }
  
var sHTMLFileName;
var sHTMLProductName;
// CODE GOES HERE TO GET PAGE LOCATION INTO sHTMLFileName
sHTMLFileName = String( document.location ).match( /[^\/\\]+$/gi )

if ( sHTMLFileName ){
    sHTMLFileName = String( sHTMLFileName );
    switch (sHTMLFileName)
    {
	    case 'incorporation-overview.html':
	    case 'incorporation-pricing.html':
	    case 'definition-of-a-corporation.html':
	      sHTMLProductName = 'Incorporation'
	      break;
	    case 'trademarks-overview.html':
	    case 'trademarks-pricing.html':
	    case 'trademarks-service-mark-definition.html':
	      sHTMLProductName = 'Trademark'
	      break;
	    case 'wills-overview.html':
	    case 'wills-pricing.html':
	    case 'importance-of-wills.html':
	      sHTMLProductName = 'Last Will and Testament'
	      break;
	    case 'limited-liability-company-overview.html':
	    case 'limited-liability-company-pricing.html':
	    case 'limited-liability-company.html':
	      sHTMLProductName = 'LLC'
	      break;

	    default:
	      sHTMLProductName = '';
    	/*
	    case 'bankruptcy-overview.html':
	    case 'bankruptcy-pricing.html':
	      sHTMLProductName = 'Bankruptcy'
	      break;
	    case 'copyrights-overview.html':
	    case 'copyrights-pricing.html':
	      sHTMLProductName = 'Copyrights'
	      break;
	    case 'dba-doing-business-as-overview.html':
	    case 'dba-pricing.html':
	      sHTMLProductName = 'DBA'
	      break;
	    case 'design-patents-overview.html':
	    case 'design-patents-pricing.html':
	      sHTMLProductName = 'Design Patents'
	      break;
	    case 'divorce-overview.html':
	    case 'divorce-pricing.html':
	      sHTMLProductName = 'Divorce'
	      break;
	    case 'immigration-overview.html':
	    case 'immigration-pricing.html':
	      sHTMLProductName = 'Immigration'
	      break;
	    case 'limited-liability-partnership-overview.html':
	    case 'llp-pricing.html':
	      sHTMLProductName = 'LLP'
	      break;
	    case 'limited-partnership-overview.html':
	    case 'limited-partnership-pricing.html':
	      sHTMLProductName = 'LP'
	      break;
	    case 'living-trusts-overview.html':
	    case 'living-trusts-pricing.html':
	      sHTMLProductName = 'Living Trusts'
	      break;
	    case 'living-wills-overview.html':
	    case 'living-wills-pricing.html':
	      sHTMLProductName = 'Living Wills'
	      break;
	    case 'name-change-overview.html':
	    case 'name-change-pricing.html':
	      sHTMLProductName = 'Name Change'
	      break;
	    case 'non-profit-corporation-overview.html':
	    case 'non-profits-pricing.html':
	      sHTMLProductName = 'Non Profit'
	      break;
	    case 'patent-overview.html':
	      sHTMLProductName = 'Patent Overview'
	      break;
	    case 'patent-search-overview.html':
	    case 'patent-search-pricing.html':
	      sHTMLProductName = 'Patent Search'
	      break;
	    case 'power-of-attorney-overview.html':
	    case 'power-of-attorney-pricing.html':
	      sHTMLProductName = 'Power of Attorney'
	      break;
	    case 'provisional-patents-overview.html':
	    case 'provisional-patents-pricing.html':
	      sHTMLProductName = 'Provisional Patents'
	      break;
	    case 'real-estate-deed-transfer-overview.html':
	    case 'real-estate-deed-transfer-pricing.html':
	      sHTMLProductName = 'Real Estate Dead Transfer'
	      break;
	    case 'real-estate-leases-overview.html':
	    case 'real-estate-leases-pricing.html':
	      sHTMLProductName = 'Real Estate Leases'
	      break;
	    case 'small-claims-overview.html':
	    case 'small-claims-pricing.html ':
	      sHTMLProductName = 'Small Claims'
	      break;
	    case 'trademark-monitoring-overview.html':
	    case 'trademark-monitoring-pricing.html':
	      sHTMLProductName = 'Trademark Monitoring'
	      break;
	    case 'trademarks-assignment-overview.html':
	    case 'trademarks-assignment-pricing.html':
	      sHTMLProductName = 'Trademark Assignment'
	      break;
	    case 'trademark-search-overview.html':
	    case 'trademark-search-pricing.html':
	      sHTMLProductName = 'Trademark Search'
	      break;
	    case 'trademarks-section8-declaration\trademarks-section8-declaration-overview.html':
	    case 'trademarks-section8-declaration-pricing.html':
	      sHTMLProductName = 'Trademarks Section 8 Declaration'
	      break;
	    case 'trademarks-section9-renewal\trademarks-section9-renewal-overview.html':
	    case 'trademarks-section9-renewal-pricing.html':
	      sHTMLProductName = 'Trademarkes Section 9 Renewal'
	      break;
	    case 'trademarks-statement-of-use-extension-overview.html':
	    case 'trademarks-statement-of-use-extension-pricing.html':
	      sHTMLProductName = 'Trademarks Statement of Use Extension'
	      break;
	    case 'trademarks-statement-of-use-overview.html':
	    case 'trademarks-statement-of-use-pricing.html':
	      sHTMLProductName = 'Trademarks Statement of Use'
	      break;
	    case 'utility-patents-overview.html':
	    case 'utility-patents-pricing.html':
	      sHTMLProductName = 'Utility Patents'
	      break;
	*/
    }
    if ( sHTMLProductName != "" ){
      SetICACookie( sHTMLProductName );
    }
}
/* ----------------------------------------------------------------------------------- added for welcome back end ------------------------- */
/* added for divorce pricing test START ceg */
function setDivorcePricingCookie( sVal ){
  var cookie = "DIVORCE-GROUP=" + sVal;
  var dt = new Date();
  var expires
  dt.setDate( dt.getDate() + 90 );
  expires = ";expires=" + dt.toGMTString();
  cookie += expires + ";path=/"; //";domain=.legalzoom.com;";
  document.cookie = cookie;
}
/* added for divorce pricing test END */
/* added for trademark pricing test START ceg */
function setTrademarkPricingCookie( sVal ){
  var cookie = "TRADEMARK-GROUP=" + sVal;
  var dt = new Date();
  var expires
  dt.setDate( dt.getDate() + 90 );
  expires = ";expires=" + dt.toGMTString();
  cookie += expires + ""; //";domain=.legalzoom.com;path=/";
  document.cookie = cookie;
}
/* added for trademark pricing test END */
/* table hadnling START */
var sTHandlerCellContentEmpty = "&nbsp;"
var sTHandlerCellContentBlueCheck = "<img src='/img/iconBlueCheck.gif'>"
var sTHandlerCellContentBlackCheck = "<img src='/img/iconBlackCheck.gif'>"
var sTHandlerCellContentOrangeCheck = "<img src='/img/iconOrangeCheck.gif'>"

function tableHandler( sNewTableID ){
  this.sTableID = sNewTableID;
  
  this.bUsePricingTableClasses = true;
  this.sBaseColorMatch = "price_white_row";
  this.sBaseColor = "#ffffff";
  this.sAltColor = "#fdf7d8";
  
  this.getTableObj = function(){ return document.getElementById( this.sTableID ) };
  this.getTableRowsLength = function(){ return this.getTableObj().rows.length; }
  this.getTableRow = function( iIndex ){ 
    return this.getTableObj().rows.item( iIndex )
    // return this.getTableObj().rows[ iIndex ]; 
  }
  this.getFindRowMatchRE = function(){ return new RegExp( this.sBaseColorMatch, "gim" ); }
  this.findRow = function( sContent ){ 
    var iOut = -1;
    var oTable = this.getTableObj();
    var reFind = new RegExp( sContent, "gim" );
    for ( var i = 0; iOut == -1 && i < oTable.rows.length; i++ ){
      iOut = oTable.rows[ i ].innerHTML.match( reFind )? i: iOut 
    }
    return iOut;
  }
  this.rowUsesBase = function( oInRow ){ return oInRow.className.match( this.getFindRowMatchRE() ); }
  this.getRowClassName = function( iIndex ){
    return this.getTableRow( iIndex ).className;  // will return blank if no class is used
  }
  this.sGetNewRowClass = function(){ return this.bUsePricingTableClasses? " newRowClass ": ""; }
  this.sGetNewRowLeftClass = function(){ return this.bUsePricingTableClasses? " newRowClass_left ": ""; }
  this.sGetNewRowRightClass = function(){ return this.bUsePricingTableClasses? " newRowClass_right ": ""; }
  this.processRow = function( oInRow ){
    var sNewRowClass = this.sGetNewRowClass();
    var sCellClass = "";
    var sRowClass = "";
    var sBGColor = "";
    var bUsesBase = this.rowUsesBase( oInRow )
    sBGColor = bUsesBase? this.sAltColor: this.sBaseColor;
    sRowClass = bUsesBase? "": this.sBaseColorMatch;
    oInRow.className = sRowClass;
    oInRow.style.backgroundColor = sBGColor;
    for ( var i = 0; i < oInRow.cells.length; i++ ){
      if ( i == 0 ){
        sCellClass = this.sGetNewRowLeftClass();
      }else if( i == oInRow.cells.length - 1 ){
        sCellClass = this.sGetNewRowRightClass()
      }else{
        sCellClass = sNewRowClass;
      }
      oInRow.cells[ i ].style.backgroundColor = oInRow.style.backgroundColor;
      oInRow.cells[ i ].className += oInRow.className + sCellClass;
    }
  }
  this.deleteRow = function( iIndex ){
    var oTable = this.getTableObj();
    if ( iIndex > -1 && iIndex < oTable.rows.length ){
      oTable.deleteRow( iIndex )
      for ( var i = iIndex; i < oTable.rows.length; i++ ){
        this.processRow( oTable.rows[ i ] );
      }
    }
  }
  this.findAndDeleteRow = function( sTargetContent ){
    var iIndex = this.findRow( sTargetContent );
    if ( iIndex != -1 ){
      this.deleteRow( iIndex );
    }
  }
}
tableHandler.prototype.replaceRow = function( iRowIndex, saCellContents ){
  var oCells = this.getTableObj().rows.item( iRowIndex ).cells;
  for ( var i = 0; i < saCellContents.length && i < oCells.length; i++ ){
    oCells[ i ].innerHTML = saCellContents[ i ];
  }
}
tableHandler.prototype.insertRow = function( iRowIndex, saCellContents ){
  var iRow = iRowIndex;
  var oRow = null; //this.getTableObj().insertRow( iRow );
  var oCells = null; //oRow.cells;
  var sNewRowClass = this.sGetNewRowClass();
  var sClassName = "";
  sClassName = this.getRowClassName( iRow - 1 ) == "" || iRow == 3? this.sBaseColorMatch: "";
  oRow = this.getTableObj().insertRow( iRow );
  oCells = oRow.cells;
  if ( sClassName == "" ){
    oRow.style.backgroundColor = this.sAltColor;
  }else {
    oRow.className = this.sBaseColorMatch;
  }
  oCell = oRow.insertCell(0)
  oCell.className = sClassName + sNewRowClass + this.sGetNewRowLeftClass()
  oCell.innerHTML = saCellContents[ 0 ];

  oCell = oRow.insertCell(1)
  oCell.className = sClassName + sNewRowClass
  oCell.innerHTML = saCellContents[ 1 ];

  oCell = oRow.insertCell(2)
  oCell.className = sClassName + sNewRowClass
  oCell.innerHTML = saCellContents[ 2 ];

  oCell = oRow.insertCell(3)
  oCell.className = sClassName + sNewRowClass + this.sGetNewRowRightClass()
  oCell.innerHTML = saCellContents[ 3 ];
  
  var iEndRow = this.getTableRowsLength()
  for ( var i = iRow + 1; i < iEndRow - 1; i++ ){
    this.processRow( this.getTableRow( i ) );
  }
}
tableHandler.prototype.insertRowSimple = function( iRowIndex, saCellContents ){
  var iRow = iRowIndex;
  var oRow = this.getTableObj().insertRow( iRow )
  var oCell = null;
  for ( var i = 0; i < saCellContents.length; i++ ){
    oCell = oRow.insertCell( i )
    oCell.innerHTML = saCellContents[ i ];
  }
}
/* table handling END */
// ----------------------------------------------- 10/31/08 CEG added simple office open check - start
var iTimeOK_Not = 0;
var iTimeOK = 1;

function iGetTimeOK(){
  var iStartHr = 9;
  var iEndHr = 14;
  var dt = new Date();
  var re = /DT|Daylight Time/gi
  var sTime = dt.toString();
  var iPCOffset = sTime.match( re )? 7: 8;
  var iTZOffset = dt.getTimezoneOffset()/60;
  var dtCheck = new Date( dt.getFullYear(), dt.getMonth(), dt.getDate(), dt.getHours() + ( iPCOffset - iTZOffset ) );
  var iDay = dtCheck.getDay();
  var iHour = dtCheck.getHours();
  var iOut = iDay >= 1 && iDay <= 5 && iHour >= iStartHr && iHour <= iEndHr? iTimeOK: iTimeOK_Not
  return iOut;
}
// ----------------------------------------------- 10/31/08 CEG added simple office open check - end
// ------------------------------------------ Omniture Vid1 test start -----------------
var gsVid1CookieName = "ov1c";

function getOmnitureVid1TestKeynoteParam(){
  var re = /keynote=yes/gim;
  var sLocation = String( document.location );
  var match = sLocation.match( re );
  var sOut = match? String( match ).split( "=" )[ 1 ].toLowerCase(): "";
  return sOut;
}
function shouldIncludeInVid1Test( sProduct ){
  var sKeyNoteParam = getOmnitureVid1TestKeynoteParam();
  return sKeyNoteParam != "yes" || sProduct != "LLC";
}
function getVid1Cookie(){
  var sAllCookies = document.cookie;
  var reGet = new RegExp( gsVid1CookieName + "[^;]+", "gim" );
  var reClean = new RegExp( gsVid1CookieName + "=", "gim" );
  var match = sAllCookies.match( reGet );
  var sCookie = match? String( match ): "";
  var sOut = sCookie.replace( reClean, "" );
  return sOut;
}
function setVid1Cookie(){
  var sLocation = String( document.location );
  var reLLC = /business-formations|limited-liability-company|llc-guide/gim;
  var reLWT = /legal-Wills|wills-estate-planning|Wills-Guide/gim;
  var reSEMTSALLC = /llcpage[0-9]+.html/gim;
  var reSEMTSALWT = /lastwillspage[0-9]+.html/gim;
  var reSEMTSAINC = /incpage[0-9]+.html/gim;
  var reSEMTSATM = /trademarkpage[0-9]+.html/gim;
  var reSEMTSAPurch = /review_purchase.asp/gim;
  var reWillMonth = /^\/$|index.html|^http:\/\/www.legalzoom.com[\/]*$/gim;
  var mLWT = sLocation.match( reLWT );
  var mLLC = sLocation.match( reLLC );
  var mSEMTSALLC = sLocation.match( reSEMTSALLC );
  var mSEMTSALWT = sLocation.match( reSEMTSALWT );
  var mSEMTSAINC = sLocation.match( reSEMTSAINC );
  var mSEMTSATM = sLocation.match( reSEMTSATM );
  var mSEMTSAPurch = sLocation.match( reSEMTSAPurch );
  var mWillMonth = sLocation.match( reWillMonth );
  var sOrigCookie = getVid1Cookie();
  var sCookieValue = "";
  var sCookie = gsVid1CookieName + "=";
  var sExpire = "";
  var dt = new Date();
  var bShouldIncludeInTest = true;
  dt.setDate( dt.getDate() + 120 );
  sExpire = ( dt.getMonth() + 1 ) + "/" + dt.getDate() + "/" + dt.getFullYear()
  if ( mLLC ){
    sCookieValue = "LLC";
  } else if ( mLWT ){
    sCookieValue = "LWT";
  } else if ( mSEMTSALLC ){
    sCookieValue = "SEMTSALLC";
  } else if ( mSEMTSALWT ){
    sCookieValue = "SEMTSALWT";
  } else if ( mSEMTSAINC ){
    sCookieValue = "SEMTSAINC";
  } else if ( mSEMTSATM ){
    sCookieValue = "SEMTSATM";
  } else if ( mSEMTSAPurch ){
    var saPurchProducts = [];
        saPurchProducts[ 27 ] = "LLC";
        saPurchProducts[ 49 ] = "LWT";
    var sProduct = "";
    var mIQ = sLocation.match( /iq=[0-9]+/gim );
    var iQ = mIQ? String( mIQ ).replace( /iq=/gim, "" ): null;
    if ( iQ ){
      sCookieValue = saPurchProducts[ iQ ]? saPurchProducts[ iQ ]: "";
    }
  } else if ( mWillMonth ){
    sCookieValue = "NAT-WILL-MONTH";
  }
  bShouldIncludeInTest = shouldIncludeInVid1Test( sCookieValue );
  sCookie += sCookieValue;
  sCookie += ";expires=" + sExpire + ";path=/;";
  if ( bShouldIncludeInTest && sCookieValue != "" && ( sOrigCookie == "" || sOrigCookie == "NEW" ) ){
    document.cookie = sCookie;
  }
}
function getVid1Parameter(){
  var sKeyNoteParam = getOmnitureVid1TestKeynoteParam();
  var sCookie = getVid1Cookie();
  var sOut = sCookie == ""? "NEW": sCookie;
  sOut = sKeyNoteParam == "yes"? "KEYNOTE": sOut;
  return sOut;
}
// ------------------------------------------ Omniture Vid1 test end -----------------
