/* Added by Santanu on 8-03-2010*/

 var BrowserDetect = {
    init: function () {
        this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
        this.version = this.searchVersion(navigator.userAgent)
            || this.searchVersion(navigator.appVersion)
            || "an unknown version";
        this.OS = this.searchString(this.dataOS) || "an unknown OS";
    },
    searchString: function (data) {
        for (var i=0;i<data.length;i++)    {
            var dataString = data[i].string;
            var dataProp = data[i].prop;
            this.versionSearchString = data[i].versionSearch || data[i].identity;
            if (dataString) {
                if (dataString.indexOf(data[i].subString) != -1)
                    return data[i].identity;
            }
            else if (dataProp)
                return data[i].identity;
        }
    },
    searchVersion: function (dataString) {
        var index = dataString.indexOf(this.versionSearchString);
        if (index == -1) return;
        return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
    },
    dataBrowser: [
        {
            string: navigator.userAgent,
            subString: "Chrome",
            identity: "Chrome"
        },
        {     string: navigator.userAgent,
            subString: "OmniWeb",
            versionSearch: "OmniWeb/",
            identity: "OmniWeb"
        },
        {
            string: navigator.vendor,
            subString: "Apple",
            identity: "Safari",
            versionSearch: "Version"
        },
        {
            prop: window.opera,
            identity: "Opera"
        },
        {
            string: navigator.vendor,
            subString: "iCab",
            identity: "iCab"
        },
        {
            string: navigator.vendor,
            subString: "KDE",
            identity: "Konqueror"
        },
        {
            string: navigator.userAgent,
            subString: "Firefox",
            identity: "Firefox"
        },
        {
            string: navigator.vendor,
            subString: "Camino",
            identity: "Camino"
        },
        {        // for newer Netscapes (6+)
            string: navigator.userAgent,
            subString: "Netscape",
            identity: "Netscape"
        },
        {
            string: navigator.userAgent,
            subString: "MSIE",
            identity: "Explorer",
            versionSearch: "MSIE"
        },
        {
            string: navigator.userAgent,
            subString: "Gecko",
            identity: "Mozilla",
            versionSearch: "rv"
        },
        {         // for older Netscapes (4-)
            string: navigator.userAgent,
            subString: "Mozilla",
            identity: "Netscape",
            versionSearch: "Mozilla"
        }
    ],
    dataOS : [
        {
            string: navigator.platform,
            subString: "Win",
            identity: "Windows"
        },
        {
            string: navigator.platform,
            subString: "Mac",
            identity: "Mac"
        },
        {
               string: navigator.userAgent,
               subString: "iPhone",
               identity: "iPhone/iPod"
        },
        {
            string: navigator.platform,
            subString: "Linux",
            identity: "Linux"
        }
    ]

};
BrowserDetect.init();

/* End Over Here*/
$(function() {
   $("#tabs").html('<div style="background:url(styles/oakviewlaw/img/top.gif) no-repeat; width:550px; height:18px;" ></div> <ul><li><a href="#tabs-1">Debt Relief</a></li><li><a href="#tabs-2">Defamation Protection</a></li><li><a href="#tabs-3">Company Formation</a></li><li><a href="#tabs-4">Wills and Trusts</a></li></ul><div id="tabs-1"><h1 style="text-align:center; font-size:24px; padding-bottom:0px; margin-bottom:0px; border:none; font-family:Georgia, "Times New Roman", Times, serif;">Find the right way to get out of debt</h1><table border="0"><tr><td rowspan="2" style="padding-left:5px 0px 0px 12px;"><div id="videoDiv" name="'+location.protocol+'" title="'+location.host+'"></div><div id="ParticularCaseStudy" style="float:left; padding-top: 5px;margin-left:13px"></div><div id="videoControls" style="float:right; padding-top:5px;"><a href="javascript:void(0);" onclick="loadVideo(\'prev\');"> <img src="/styles/oakviewlaw/img/focus-prev.gif"  width="84" height="14" /> </a>  <a style="cursor:pointer;" onclick="loadVideo(\'next\');"> <img src="/styles/oakviewlaw/img/focus-next.gif" width="62" height="14" /> </a></div></td><td style="font-size:14pt; font-family:Georgia, Times New Roman, Times, serif; text-align:left; padding:5px 5px 0px 10px; color:#767676;" valign="top">Our <a href="http://www.ovlg.com/attorneys/" onclick="return SendVisitorToSecureSite(\'/attorneys/\',true);">Attorneys</a> will help you choose the right debt relief option using unique <a href="http://www.ovlg.com/waterfall-approach-debt-free.html" onclick="return SendVisitorToSecureSite(\'/waterfall-approach-debt-free.html\',true);">waterfall approach</a>. Here is <a href="http://www.ovlg.com/process.html" onclick="return SendVisitorToSecureSite(\'/process.html\',true);">the process</a>.</td></tr><tr><td valign="top" style="font-size:22px; text-align:center;"><a href="http://www.ovlg.com/signup/" onclick="return SendVisitorToSecureSite(\'/signup/\',true);"><img src="/styles/oakviewlaw/img/signup-for-attorney-approval.png" width="245" height="39" /></a></td></tr></table><p style="text-align:left; font-size:12px; padding: 5px 20px; font-weight:bold; color:#767676;"><!-- <span style="color:#333333;">Quick Links:</span>&nbsp;&nbsp;&nbsp; --> <a href="http://www.ovlg.com/debt-settlement/" style="color:#767676;" onclick="return SendVisitorToSecureSite(\'/debt-settlement/\',true);">Debt Settlement</a> |  <a href="http://www.ovlg.com/debt-consolidation/" style="color:#767676;" onclick="return SendVisitorToSecureSite(\'/debt-consolidation/\',true);">Debt Consolidation</a>  |  <a href="http://www.ovlg.com/bankruptcy/" style="color:#767676;" onclick="return SendVisitorToSecureSite(\'/bankruptcy/\',true);">Bankruptcy</a></p></div><div id="tabs-2"><h1 style="text-align:center; font-size:24px; border:none; font-family:Georgia, "Times New Roman", Times, serif;">Defamation Protection</h1><p style="font-size:18px; text-align:left;color:#767676;">Does your business depend on word of mouth promotion?<br/>Are your competitors spreading rumors about your business?<br/>Is your brand image at stake?We can help you in <a href="http://www.ovlg.com/reputation-protection/" onclick="return SendVisitorToSecureSite(\'/reputation-protection/\',true);">online reputation management</a> with proper legal advice and technical support. </p></div><div id="tabs-3"><h1 style="text-align:center; font-size:24px; border:none; font-family:Georgia, "Times New Roman", Times, serif;">Company Formation</h1><p  style="font-size:18px; text-align:left; padding:10px 5px 10px 10px;color:#767676;">Do you want to start your own company but not sure about the legal procedures? We have some of the best lawyers to help you in proper company formation. Meet our lawyers or <a href="http://www.ovlg.com/company-formation/" onclick="return SendVisitorToSecureSite(\'/company-formation/\',true);">learn more about company formation</a>.</p></div><div id="tabs-4"><h1 style="text-align:center; font-size:24px; border:none; font-family:Georgia, "Times New Roman", Times, serif;">Wills and Trusts</h1><p style="font-size:18px; text-align:left; padding:10px 5px 10px 10px;color:#767676;">Developing wills and trusts are not a very easy thing to do always. There may be different problems if you are not represented by experienced and qualified attorneys or lawyers. Let us talk about how we can make the process simple. Learn more about <a href="http://www.ovlg.com/wills-trusts/" onclick="return SendVisitorToSecureSite(\'/wills-trusts/\',true);">Wills and Trust</a></p></div><div style="background:url(styles/oakviewlaw/img/bottom.gif) no-repeat; float:left;width:550px;height:18px;"></div>');
    //$("#tabs").html();
    $("#tabs").tabs().addClass('ui-tabs-vertical ui-helper-clearfix');
    $("#tabs li").removeClass('ui-corner-top').addClass('ui-corner-left');
   
	
	/* For all browser configuration rather than IE 6*/

    var cond_value_positive_other = "245px";
    var cond_value_negetive_other = "-245px";

    var animate_positive_other = "+=245px";
    var animate_negetive_other = "-=245px";

    var first_to_last_other = "-=2000px";
    var last_to_first_other = "+=2000px";

    var last_to_first_cond_other = "-1960px";

    /* Configuration end over here*/

     /* For IE 6 configuration*/

    var cond_value_positive_ie = "249px";
    var cond_value_negetive_ie = "-249px";

    var animate_positive_ie = "+=249px";
    var animate_negetive_ie = "-=249px";

    var first_to_last_ie = "-=2032px";
    var last_to_first_ie = "+=2032px";

    var last_to_first_cond_ie = "-1992px";

    /* Configuration end over here*/

    if(BrowserDetect.browser=="Explorer" && BrowserDetect.version==6){
        var cond_value_positive = cond_value_positive_ie
        var cond_value_negetive = cond_value_negetive_ie
        var animate_value_positive = animate_positive_ie
        var animate_value_negetive = animate_negetive_ie
	var first_to_last = first_to_last_ie;
	var last_to_first = last_to_first_ie
	var last_to_first_cond = last_to_first_cond_ie
    }
   else{
        var cond_value_positive = cond_value_positive_other
        var cond_value_negetive = cond_value_negetive_other
        var animate_value_positive = animate_positive_other
        var animate_value_negetive = animate_negetive_other
	var first_to_last = first_to_last_other;
	var last_to_first = last_to_first_other;
	var last_to_first_cond = last_to_first_cond_other;
    }

	

	

    $("#HPrev").click(function(){  
                                                   
                                                     
    
      

     if($(".TestimonialBlock").css("left") == "0px")
      {
          $(".TestimonialBlock").animate({"left": "+=40px"}, "slow").animate({"left": first_to_last}, 1200);
      }
      else if($(".TestimonialBlock").css("left") == cond_value_negetive)
      {
          $(".TestimonialBlock").animate({"left": animate_value_positive}, "slow");
      }
      else
      {
        $(".TestimonialBlock").animate({"left": animate_value_positive}, "slow");
      }
          
    });

    $("#HNext").click(function(){  
       	if($(".TestimonialBlock").css("left") == last_to_first_cond)
        {
	   
            $(".TestimonialBlock").animate({"left": "-=40px"}, "slow").animate({"left": last_to_first}, 1200);
        }
        else if($(".TestimonialBlock").css("left") == "0px")
        {
            $(".TestimonialBlock").animate({"left": animate_value_negetive}, "slow");
        }
        else
        {
            $(".TestimonialBlock").animate({"left": animate_value_negetive}, "slow");
        }
    });

});

function toggleDdebtAmountOption(LookingFor)
{      
  
   if(LookingFor != 1)
    {
       	$('#DebtAmount').animate({"opacity":0}, 700);
        $('#DebtAmount').attr("disabled","disabled");
    }
    else
    {
        $('#DebtAmount').animate({"opacity":1}, 700);
        $('#DebtAmount').attr("disabled","");
    }
    
}

function emptyElementOnClick(pelement)
{       
    if((pelement.value == 'Full Name') || (pelement.value == 'Email') || (pelement.value == 'Best Phone'))
    {
        pelement.value = '';
    }
}

function fillElementOnBlur(pelement)
{
    if(pelement.value == '')
    {
        switch(pelement.id)
        {
            case 'FirstName': pelement.value = 'Full Name';
                                break;
                                
            case 'EmailAddress': pelement.value = 'Email';
                                break;
            
            case 'HomePhone': pelement.value = 'Best Phone';
                                break;
                                
        }
    }
}
