var count_all = new Array(0,1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,17);
     var contents = new Array();
     var mycurrentPost=0;
     contents[0]={'content':'<h3 id=\'head_id\'><h3>Welcome To Upside!</h3> <div class=\'features\'><ul class=\'f_inner\'><li>Click the next button for a step by step tour or select one of the boxes above to move directly to another part of the application.</li></ul>'};
     contents[1]={'content':'<h3 id=\'head_id\'><h3>Entry Page</h3> <div class=\'features\'><p id=\'para_id\' style=\'position:relative; float:left; width:100%; margin:5px 0px 0px 0px;line-height:15px;font-size:12px;font-family:Helvetica;\'>Here\'s\ where you start.</b></p><ul class=\'f_inner\'><li>Four primary tabs for entering data & reporting.</li><li>Located at the bottom of every screen is global navigation (preferences, properties list, help and more).</ul></div>'};
     contents[2]={'content':'<h3 id=\'head_id\'><h3>Info Summary</h3> <div class=\'features\'><p id=\'para_id\' style=\'position:relative; float:left; width:100%; margin:5px 0px 0px 0px;line-height:15px;font-size:12px;font-family:Helvetica;\'>The info tab gives a brief summary of what is located deeper in this tab.  Drill down using the blue arrows to enter as much general or detailed data about the property as you can.</b></p><ul class=\'f_inner\'><li>Property details: APN number, lot size, home square footage, bedrooms, bathrooms, fireplaces, type of roof and more.</li><li>Estimated value and any contingency adjustment.</li><li>Ownership: The primary owner displays in the summary.  Add up to four different owners including their contact and bankruptcy information.</li></ul></div>'};
     contents[3]={'content':'<h3 id=\'head_id\'><h3>Owner Information</h3> <div class=\'features\'><p id=\'para_id\' style=\'position:relative; float:left; width:100%; margin:5px 0px 0px 0px;line-height:15px;font-size:12px;font-family:Helvetica;\'>This is an example of one of the pages you will access from the info tab.</b></p><ul class=\'f_inner\'><li>Enter information for one to four owners.</li><li>Contact information can be imported from your iPhone address book or just create a new contact.</li><li>Store social Security number with password protection.</li><li>\The \'in bankruptcy\' field\ allows you to specify the type of bankruptcy with helpful definitions of chapter 7 and 13 and dismissal information.</li></ul></div>'};
     contents[4]={'content':'<h3 id=\'head_id\'><h3>Property Value</h3> <div class=\'features\'><p id=\'para_id\' style=\'position:relative; float:left; width:100%; margin:5px 0px 0px 0px;line-height:15px;font-size:12px;font-family:Helvetica;\'>Rarely will you start to evaluate a potential property knowing its actual value. By entering the estimated value and applying skillful use of the contingency factor you can continue to evaluate the opportunity with confidence. The contingency provides a safety cushion if the estimate seems high or it can zero in on the true potential if the estimate seems low.</p><ul class=\'f_inner\'><li>Contingency can be entered in positive or negative numbers.</li><li>Contingency is entered as a percentage and shown as currency.</li><li>As the deal firms up, continue to fine tune the contingency.</li><li>The adjusted value is the result of the estimated value plus or minus the contingency factor. </li></ul></div>'};
     contents[5]={'content':'<h3 id=\'head_id\'><h3>Costs Tab</h3><div class=\'features\'><p id=\'para_id\' style=\'position:relative; float:left; width:100%; margin:5px 0px 8px 0px;line-height:15px;font-size:12px;font-family:Helvetica;\'>From the moment you enter the costs tab the meter display slides into the top of the screen. It remains active as you work and enter data continually reflecting the financial state of the property.</p> <p style=\'position:relative; float:left; width:100%; margin:5px 0px 0px 0px;\'>The costs tab is also where you work with the following fields:</p>    <p id=\'para_id\' style=\'position:relative; float:left; width:100%; margin:5px 0px 0px 0px;\'>Meter Display</b></p>    <ul class=\'f_inner\'>        <li> As you enter data, the meter display at the top of the page actively updates equity, debt, profit and LTV. </li></ul>      <p id=\'para_id\' style=\'position:relative; float:left; width:100%; margin:5px 0px 0px 0px;\'>Loans/HELOC</p>  <ul class=\'f_inner\'> <li> Enter mortgages or home equity lines of credit against the property. Up to four can be entered.  </li>  </ul>     <p id=\'para_id\' style=\'position:relative; float:left; width:100%; margin:5px 0px 0px 0px;\'>Improvements</p>    <ul class=\'f_inner\'>        <li> Itemize improvement costs for things such as kitchen, exterior, mechanical systems, landscape, paint and more. </li>    </ul>    <p id=\'para_id\' style=\'position:relative; float:left; width:100%; margin:5px 0px 0px 0px;\'>Reinstate</p>    <ul class=\'f_inner\'>        <li>  If a property is in Notice of Default (NOD) or Foreclosure, Upside totals the costs to reinstate the mortgages, judgements, liens, child support or alimony, and any past due tax payments.</li>    </ul>    <p id=\'para_id\' style=\'position:relative; float:left; width:100%; margin:5px 0px 0px 0px;\'>Monthly Carry</p>    <ul class=\'f_inner\'>        <li>Calculates the property\'s monthly operating costs (i.e. monthly mortgage payments, property taxes, insurance, water, gas, electric, HOA dues and more).</li>    </ul></div>'};
     contents[6]={'content':'<h3 id=\'head_id\'><h3>Carry Costs</h3><div class=\'features\'><p id=\'para_id\' style=\'position:relative; float:left; width:100%; margin:5px 0px 0px 0px;line-height:15px;font-size:12px;font-family:Helvetica;\'>Tabulates the monthly cost of ownership should you assume the property.</p>    <ul class=\'f_inner\'>        <li>Tabs for financials and utilities.</li>        <li>Enter operating costs such as monthly mortgage payments, property taxes, insurance, water, gas, electric, HOA dues and more.</li>        <li>The sum total of these monthly costs will be displayed in the reports tab.</li>    </ul></div>'};
     
     contents[7]={'content':'<h3 id=\'head_id\'><h3>Defaults</h3><div class=\'features\'>    <p id=\'para_id\' style=\'position:relative; float:left; width:100%; margin:5px 0px 0px 0px;line-height:15px;font-size:12px;font-family:Helvetica;\'> In addition to a mortgage being past due (or in Notice of Default or foreclosure), there can be other hidden obligations levied against the property.  Accurately factoring these in can be the difference between making money or taking a loss.</p>    <p id=\'para_id\' style=\'position:relative; float:left; width:100%; margin:5px 0px 0px 0px;\'>You must include:</p><ul class=\'f_inner\'><li>Judgements</li><li>Back child support / alimony court orders</li><li>Liens</li><li>Back taxes</li><li>Loan defaults (automatically populated from loans/HELOC in the costs tab)</li></ul></div>'};
     contents[8]={'content':'<h3 id=\'head_id\'><h3>Number Keypad</h3><div class=\'features\'>    <p id=\'para_id\' style=\'position:relative; float:left; width:100%; margin:5px 0px 0px 0px;line-height:15px;font-size:12px;font-family:Helvetica;\'>Upside\'s\ large number keys allow for fast and easy numerical entry and includes decimal point & double zero keys.</p>    <ul class=\'f_inner\'>        <li>The red delete key eliminates one character at a time.</li>        <li>The clear key quickly erases all values.</li>        <li>When you\'re\ done, touch the large blue Done key.</li>    </ul></div>'};
     contents[9]={'content':'<h3 id=\'head_id\'><h3>Reports Overview</h3><div class=\'features\'>    <p id=\'para_id\' style=\'position:relative; float:left; width:100%; margin:5px 0px 0px 0px;line-height:15px;font-size:12px;font-family:Helvetica;\'>No need to waste time going after a property if there\'s no money in it.  With Upside\'s powerful reports overview, quickly determine if the property is under water or not.</p>    <ul class=\'f_inner\'>        <li> Property value displays the property\'s estimated value.</li>        <li>The property\'s total equity, debt, and profit is displayed in currency and as a percentage.</li>        <li> The property\'s LTV (Loan-to-Value) is displayed as a percentage.</li>    </ul></div>'};
     
     contents[10]={'content':'<h3 id=\'head_id\'><h3>Reports Negotiation - Commission</h3><div class=\'features\'>    <p id=\'para_id\' style=\'position:relative; float:left; width:100%; margin:5px 0px 0px 0px;line-height:15px;font-size:12px;font-family:Helvetica;\'>Upside\'s\ commission calculator is powerful giving you fast and accurate commission calculations. </p>    <ul class=\'f_inner\'>        <li>The Gross Profit (total equity) is displayed so you know how much you have to work with.</li>        <li>Just touch the + or - buttons and watch Upside carve your commission right in front of your eyes (indicated on the meter in orange).</li>        <li>The Net Profit is displayed at the bottom of the page (the amount remaining after the commission and owner buyout have been taken).</li>    </ul></div>'};
     contents[11]={'content':'<h3 id=\'head_id\'><h3>Reports Negotiation - Buyout</h3><div class=\'features\'>    <p id=\'para_id\' style=\'position:relative; float:left; width:100%; margin:5px 0px 0px 0px;line-height:15px;font-size:12px;font-family:Helvetica;\'>Upside\'s\ buyout calculator is an investors best friend because you can negotiate on-the-fly an amount to pay the owner to walk from his property.  Accurately see your margin as the negotiation twists and turns.</p>    <ul class=\'f_inner\'>        <li>The Gross Profit (total equity) is displayed so you know how much you have to work with.</li>        <li>Just touch the + or - buttons and watch Upside carve the owner buyout right in front of your eyes (indicated on the meter in yellow).</li>        <li>The Net Profit is displayed at the bottom of the page (the amount remaining after the commission and owner buyout have been taken).</li></ul></div>'};
     contents[12]={'content':'<h3 id=\'head_id\'><h3>Reports Negotiation - Equity Split</h3><div class=\'features\'>    <p id=\'para_id\' style=\'position:relative; float:left; width:100%; margin:5px 0px 0px 0px;line-height:15px;font-size:12px;font-family:Helvetica;\'>Upside\'s\ equity split calculator is unique in that it opens up another acquisition strategy.  It\'s completely independent from the Commission and Buyout calculators. </p>    <ul class=\'f_inner\'>        <li>Touch the + or - buttons or move the slider to quickly determine an amount.  Negotiate quickly with numbers right in front of you.  </li>    </ul></div>'};
     
     contents[13]={'content':'<h3 id=\'head_id\'><h3>Reports Purchase Tab</h3><div class=\'features\'><p id=\'para_id\' style=\'position:relative; float:left; width:100%; margin:5px 0px 0px 0px;line-height:15px;font-size:12px;font-family:Helvetica;\'>This tab imports the calculated values of property improvements needed, estimates the possible short sale price and summarizes a total reinstatement cost.</p>  <p id=\'para_id\' style=\'position:relative; float:left; width:100%; margin:5px 0px 0px 0px;\'>Property Improvements </p><ul class=\'f_inner\'> <li>Totals the amount required for all property improvements</li></ul>    <p id=\'para_id\' style=\'position:relative; float:left; width:100%; margin:5px 0px 0px 0px;\'>Estimated Short Sale </p>    <ul class=\'f_inner\'>        <li>With short sales becoming more and more common, Upside will calculate the expected amount for you automatically.</li>    </ul>  <p id=\'para_id\' style=\'position:relative; float:left; width:100%; margin:5px 0px 0px 0px;\'>Amount Required to Reinstate </p>    <ul class=\'f_inner\'>        <li> See the total amount needed to payoff pasts due penalties.  Includes loans, liens, alimony, child support, judgements, and taxes.</li>    </ul>    <p id=\'para_id\' style=\'position:relative; float:left; width:100%; margin:5px 0px 0px 0px;\'>Carry Costs </p>    <ul class=\'f_inner\'>        <li>Select how many months you expect to own the property and Upside will show you how much it will cost.</li>    </ul>     <p id=\'para_id\' style=\'position:relative; float:left; width:100%; margin:5px 0px 0px 0px;\'>Lease Buyback </p>    <ul class=\'f_inner\'>        <li> Select how many months you expect to own the property (with the original owner renting back from you) and Upside will show you how much it will cost.</li>    </ul>     </div>'};
     
     
     
     contents[14]={'content':'<h3 id=\'head_id\'><h3>Properties List</h3><div class=\'features\'>    <p id=\'para_id\' style=\'position:relative; float:left; width:100%; margin:5px 0px 0px 0px;line-height:15px;font-size:12px;font-family:Helvetica;\'></p>    <ul class=\'f_inner\'>        <li>Displays the full property address.</li>        <li>Icon indicates property type: Land, Single Family, Condo or Commercial.</li>        <li>LTV % indicates property health at a glance.</li>        <li>Touch the summary button to view the property summary window.</li>         <li>Touch the export button to transfer property data to an excel or text file using email.</li>        <li>Sort and view properties by property type, city, state or value.</li>    </ul></div>'};
     contents[15]={'content':'<h3 id=\'head_id\'><h3>Properties List - Summary Window, Exporting & Map</h3><div class=\'features\'>    <ul class=\'f_inner\'>        <li> Touch the summary button and Upside will flip the address window and display the property\'s current equity, debt, profit and LTV.</li>        <li> Export and email the detail for one or more properties by touching the export button.</li><li>Touch the map button and see the property within Google Maps.</li>    </ul></div>'};
     
     contents[16]={'content':'<h3 id=\'head_id\'><h3>Properties List - Export Feature</h3><div class=\'features\'>    <ul class=\'f_inner\'> <li> Exporting is simple with Upside. Touch the export button and easily email the property data using an Excel or text file format.</li>       </ul></div>'};
     contents[17]={'content':'<h3 id=\'head_id\'><h3>Properties List - Map Feature</h3><div class=\'features\'>    <ul class=\'f_inner\'> <li>Click the map button and Upside will show you the property using Google Maps. When done, simply click the back button and Upside will return you to the property listings page.</li></ul></div>'};
  
     //contents[1]={'content':''};
   function resetStyles(){
        for(var i=0;i<=count_all.length;i++){
            var manage_id = '#indi_'+i;
            if(i==0){
                $(manage_id).removeClass('off');
                $(manage_id).addClass('on');
            }else{
                $(manage_id).removeClass('on');
                $(manage_id).addClass('off');
            }
        }
   }
   function setStyles(pos){
        for(var i=0;i<=count_all.length;i++){
            var manage_id = '#indi_'+i;
            if(i==pos){
                $(manage_id).removeClass('off');
                $(manage_id).addClass('on');
            }else{
                $(manage_id).removeClass('on');
                $(manage_id).addClass('off');
            }
        }
   }
   
$(document).ready(function(){
    resetStyles();
    var currentPosition = 0;
    var slideWidth = 300;
    var slides = $('.slide');
    var numberOfSlides = slides.length;
    
    function goforward(){
        currentPosition = currentPosition+1 ;
        manageControls(currentPosition);
        $('#slideInner').stop(true).animate({
          'marginLeft' : slideWidth*(-currentPosition)
        });
    }
    $('#slidesContainer').css('overflow', 'hidden');
    slides.wrapAll('<div id="slideInner"></div>').css({'float' : 'left','width' : slideWidth});
    $('#slideInner').css('width', slideWidth * numberOfSlides);
    manageControls(currentPosition);
    $('#backer').bind('click', backward);
    function backward(){
	currentPosition =  currentPosition-1;
        manageControls(currentPosition);
        $('#slideInner').stop(true).animate({
          'marginLeft' : slideWidth*(-currentPosition)
        });
    }
    $('#nextone').bind('click', goforward);
    function manageContent(posi){
        $('#content_html').html(contents[posi].content);
        setStyles(posi);   
    }
    function manageControls(position){
	mycurrentPost = position;
	manageContent(position);
	    if(position==0){ $('#backer').hide() } else{ $('#backer').show() }
	if(position==numberOfSlides-1){ $('#nextone').hide() } else{ $('#nextone').show() }
    }
    for(var i=0;i<=count_all.length;i++){
          var sub_in = "#indi_"+i;
          $(sub_in).bind('click',{'current': i},newPos);
    }
    
    
    function newPos(posit){
	posit = posit.data.current;
        if(currentPosition>posit){
            currentPosition = posit+1;
          backward();
        }else{
	    currentPosition = posit-1;
            goforward();
        }
    }
});

