function MM_preloadImages()
{
  var d = document;
  if (d.images)
  {
    if (!d.MM_p)
      d.MM_p = new Array();
    var i, j=d.MM_p.length, 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 clean(id)
{
  document.getElementById(id).value='';	
}

idsel = 'p1';
function menuUser(page)
{
//  page = window.location.pathname;
  if (page == "home.htm")
  {
    document.getElementById('p1').style.background='url(img/btn_sel.jpg)';
    idsel = 'p1';
  }
  else if (page == "articles.htm")
  {
    document.getElementById('p2').style.background='url(img/btn_sel.jpg)';
    document.getElementById(idsel).style.background='url(img/btn.jpg)';
    idsel = 'p2';
  }
  else if (page == "lender_reviews.htm")
  {
    document.getElementById('p3').style.background='url(img/btn_sel.jpg)';
    document.getElementById(idsel).style.background='url(img/btn.jpg)';
    idsel = 'p3';
  }
  else if (page == "faq.htm")
  {
    document.getElementById('p4').style.background='url(img/btn_sel.jpg)';
    document.getElementById(idsel).style.background='url(img/btn.jpg)';
    idsel = 'p4';
  }
  else if (page == "contact.htm")
  {
    document.getElementById('p5').style.background='url(img/btn_sel.jpg)';
    document.getElementById(idsel).style.background='url(img/btn.jpg)';
    idsel = 'p5';
  }
  else
  {
    document.getElementById('p1').style.background='url(img/btn_sel.jpg)';
    idsel = 'p1';
  }
}

idsel = 'p1';
function  menuAdmin(page)
{
  if (page == "home.php")
  {
    document.getElementById('p1').style.background='url(../img/btn_sel.jpg)';
    idsel = 'p1';
  }
  else if (page == "articles.php")
  {
    document.getElementById('p2').style.background='url(../img/btn_sel.jpg)';
    document.getElementById(idsel).style.background='url(../img/btn.jpg)';
    idsel = 'p2';
  }
  else if (page == "lender_reviews.php")
  {
    document.getElementById('p3').style.background='url(../img/btn_sel.jpg)';
    document.getElementById(idsel).style.background='url(../img/btn.jpg)';
    idsel = 'p3';
  }
  else if (page == "faq.php")
  {
    document.getElementById('p4').style.background='url(../img/btn_sel.jpg)';
    document.getElementById(idsel).style.background='url(../img/btn.jpg)';
    idsel = 'p4';
  }
  else if (page == "contact.php")
  {
    document.getElementById('p5').style.background='url(../img/btn_sel.jpg)';
    document.getElementById(idsel).style.background='url(../img/btn.jpg)';
    idsel = 'p5';
  }
  else if (page == "privacy_policy.php")
  {
    document.getElementById('p6').style.background='url(../img/btn_sel.jpg)';
    document.getElementById(idsel).style.background='url(../img/btn.jpg)';
    idsel = 'p6';
  }
  else if (page == "resources.php")
  {
    document.getElementById('p7').style.background='url(../img/btn_sel.jpg)';
    document.getElementById(idsel).style.background='url(../img/btn.jpg)';
    idsel = 'p7';
  }
  else if (page == "disclaimer.php")
  {
    document.getElementById('p8').style.background='url(../img/btn_sel.jpg)';
    document.getElementById(idsel).style.background='url(../img/btn.jpg)';
    idsel = 'p8';
  }
  else
  {
    document.getElementById('p1').style.background='url(../img/btn_sel.jpg)';
    idsel = 'p1';
  }
}

function ratin(kol)
{
  document.getElementById('rat').value=kol;

  for (k=1; k<=5; k++)
  {
    document.getElementById('i'+k).src = "../img/rating.jpg";
  }
  
  for (k=1; k<=kol; k++)
  {
    document.getElementById('i'+k).src = "../img/rating_sel.jpg";
  }
}







