function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}
function setTopNav()
{
    var pgName = gup("pg");
    if (pgName == "A")
        document.getElementById("btnAboutUs").src = "/btns/aboutUsB.jpg";
    else if (pgName == "G")
        document.getElementById("btnGallery").src = "/btns/galleryB.jpg";
    else if (pgName == "E")
        document.getElementById("btnEst").src = "/btns/estB.jpg";
    else if (pgName == "P")
        document.getElementById("btnProducts").src = "/btns/productsB.jpg";
    else if (pgName == "B")
        document.getElementById("btnBP").src = "/btns/bpB.jpg";
    else if (pgName == "F")
        document.getElementById("btnFAQ").src = "/btns/faqB.jpg";
    else if (pgName == "C")
        document.getElementById("btnContact").src = "/btns/contactB.jpg";
    else
        document.getElementById("btnHome").src = "/btns/homeB.jpg";
}

function addLoadEvent(func) { 
	  var oldonload = window.onload; 
	  if (typeof window.onload != 'function') { 
	    window.onload = func; 
	  } else { 
	    window.onload = function() { 
	      if (oldonload) { 
	        oldonload(); 
	      } 
	      func(); 
	    } 
	  } 
	} 
