

//meny ref javascript-array.com/scripts/jquery_simple_drop_down_menu

var timeout    = 500;
var closetimer = 0;
var umenuitem = 0;

function umeny_open()
{  umeny_canceltimer();
   umeny_close();
   umenuitem = $(this).find('ul').css('visibility', 'visible');}

function umeny_close()
{  if(umenuitem) umenuitem.css('visibility', 'hidden');}

function umeny_timer()
{  closetimer = window.setTimeout(umeny_close, timeout);}

function umeny_canceltimer()
{  if(closetimer)
   {  window.clearTimeout(closetimer);
      closetimer = null;}}


var imeny1 = '<li><a href="http://test.utleira.no">Utleira IL</a></li>';
imeny1 += '<li><a href="http://test2.utleira.no">UIL Idrett 1</a></li>';
imeny1 += '<li><a href="http://test3.utleira.no">UIL I1 Lag 1</a></li>';

var menyfotball = '<li><a href="http://fotball1995j.utleira.no">Jenter 1995</a>';
menyfotball += '<li><a href="http://fotball1996g.utleira.no">Gutter 1996</a>';

menyfotball += '<li><a href="http://fotball1996j.utleira.no">Jenter 1996</a>';
menyfotball += '<li><a href="http://fotball1997.utleira.no">Gutter 1997</a>';

menyfotball += '<li><a href="http://fotball1998g.utleira.no">Gutter 1998</a>';
menyfotball += '<li><a href="http://fotball1998j.utleira.no">Jenter 1998</a>';

menyfotball += '<li><a href="http://fotball1999g.utleira.no">Gutter 1999</a>';
menyfotball += '<li><a href="http://fotball1999j.utleira.no">Jenter 1999</a>';

menyfotball += '<li><a href="http://fotball2000g.utleira.no">Gutter 2000</a>';
menyfotball += '<li><a href="http://fotball2000j.utleira.no">Jenter 2000</a>';

menyfotball += '<li><a href="http://fotball2001.utleira.no">Gutter 2001</a>';

menyfotball += '<li><a href="http://fotball2002g.utleira.no">Gutter 2002</a>';
menyfotball += '<li><a href="http://fotball2002j.utleira.no">Jenter 2002</a>';

menyfotball += '<li><a href="http://fotball2003.utleira.no">Gutter/ jenter 2003</a>';
menyfotball += '<li><a href="http://fotball2004.utleira.no">Gutter/ jenter 2004</a>';

menyfotball += '<li><a href="http://fotballjuniorh.utleira.no">Junior herrer</a>';
menyfotball += '<li><a href="http://fotballjuniord.utleira.no">Junior damer</a>';

menyfotball += '<li><a href="http://fotballdamer.utleira.no">Damer</a>';
menyfotball += '<li><a href="http://fotballseniorer.utleira.no">Seniorer</a>';


var menyhandball = '';
//<li><a href="http://haandball1994j.utleira.no">Jenter 1994</a>';
//menyhandball += '<li><a href="http://haandball1995j.utleira.no">Jenter 1995</a>';

//menyhandball += '<li><a href="http://haandball1996j.utleira.no">Jenter 1996</a>';
menyhandball += '<li><a href="http://haandball1997j.utleira.no">Jenter 1997</a>';
//menyhandball += '<li><a href="http://haandball1998g.utleira.no">Gutter 1998</a>';
//menyhandball += '<li><a href="http://haandball1998j.utleira.no">Jenter 1998</a>';
//menyhandball += '<li><a href="http://haandball1999g.utleira.no">Gutter 1999-2000</a>';
menyhandball += '<li><a href="http://haandball1999j.utleira.no">Jenter 1999</a>';

menyhandball += '<li><a href="http://haandball2000j.utleira.no">Jenter 2000</a>';
menyhandball += '<li><a href="http://haandball2001g.utleira.no">Gutter 2001</a>';
menyhandball += '<li><a href="http://haandball2001j.utleira.no">Jenter 2001</a>';
menyhandball += '<li><a href="http://haandball2002g.utleira.no">Gutter 2002</a>';
menyhandball += '<li><a href="http://haandball2002j.utleira.no">Jenter 2002</a>';

menyhandball += '<li><a href="http://haandball2003g.utleira.no">Gutter 2003</a>';
menyhandball += '<li><a href="http://haandball2003.utleira.no">Jenter 2003</a>';
menyhandball += '<li><a href="http://haandball2004g.utleira.no">Gutter 2004</a>';
menyhandball += '<li><a href="http://haandball2004j.utleira.no">Jenter 2004</a>';

menyhandball += '<li><a href="http://haandballdamer1.utleira.no">Damer 1.div</a>';
menyhandball += '<li><a href="http://haandballdamer2.utleira.no">Damer 3.div</a>';
menyhandball += '<li><a href="http://haandballdamer3.utleira.no">Damer 4.div</a>';
menyhandball += '<li><a href="http://haandballdamer4.utleira.no">Damer 5.div</a>';
menyhandball += '<li><a href="http://haandballdamer-jr.utleira.no">Damer Junior</a>';
menyhandball += '<li><a href="http://haandballherrer.utleira.no">Herrer</a>';
menyhandball += '<li><a href="http://haandballutvalg.utleira.no">Sportslig utvalg</a>';

var menyelite = '<li><a href="http://haandballutvalg.utleira.no/p/aktiviteter-i-utleira-topphandball.html">Topph&aring;ndball</a>';
menyelite += '<li><a href="http://haandballdamer1.utleira.no">Topph&aring;ndball 1.divisjon damer</a>';
menyelite += '<li><a href="http://haandballdamer-jr.utleira.no">Topph&aring;ndball rekrutt damer</a>';

var infovenstre = '<div><h2>Praktisk info</h2>';
infovenstre += '<div>';

//infovenstre += '<a href="http://fotball.utleira.no/2010/04/fotballdag-lrdag-12-juni-2010.html">P&aring;melding kompis-cup fotballdag 19.juni</a>';
//infovenstre += '<a href="http://fotball.utleira.no/2010/06/fotballdag-kampoppsett-kompiscup.html">Kamp-oppsett kompis-cup fotballdag 19.juni</a>';
//infovenstre += '<br />';

infovenstre += '<a href="http://webmaster.utleira.no/2010/04/for-logge-pa.html">Logg inn</a>';
infovenstre += '<br />';
infovenstre += '<a href="http://www.utleira.no/p/konomi.html">Medlemsskap i UIL</a>';
infovenstre += '<br />';
infovenstre += '<a href="http://www.utleira.no/2010/04/grasrotandelen.html">Grasrotandelen</a>';
infovenstre += '<br />';
infovenstre += '<a href="http://www.utleira.no/p/logo-og-maler-profilprogram.html">Ny logo og nye maler</a>';

//infovenstre += '<br />';

infovenstre += '</div>';
infovenstre += '</div>';


var herervi = '<div><h2>Her er vi</h2>';
herervi += '<div>';
herervi += '<a href="http://kart.gulesider.no/m/pD0cZ">Utleira skole</a>';
herervi += '<br />';
herervi += '<a href="http://kart.gulesider.no/m/pD07R">Bj&oslash;rkmyr fotballbane</a>';
herervi += '<br />';
herervi += '<a href="http://kart.gulesider.no/m/pD0fm">Stordalen fotballbane</a>';
herervi += '<br />';
herervi += '<a href="http://kart.gulesider.no/m/pD0js">Bratsberg skistadion</a>';
herervi += '</div>';
herervi += '</div>';




//var fellesinfo - ref #fellesinfo til høgre... bort med fellesreklameoginfo...  
//nye kilder, kanskje direkte lesing av blogg m/blank template, kanskje feed



$(document).ready(function()
{  
   var urlhost = window.location.hostname;
   var gruppe = '';
   var pos = urlhost.indexOf("haandball");
   if (pos >= 0) gruppe = "haandball";
   var pos2 = urlhost.indexOf("fotball");
   if (pos2 >= 0) gruppe = "fotball";

   $('#idrettsmeny > li').bind('mouseover', umeny_open);
   $('#idrettsmeny > li').bind('mouseout',  umeny_timer);


//works men treig/vent...  $("#fellesreklameoginfo").html(sponsor);
//doesn't work... if (acontainsb(urlhost, "test2")) $("#fellesreklameoginfo").html(sponsor);
//else if (acontainsb(urlhost, "test3")) $("#fellesreklameoginfo").html(sponsor2);

//works... if (gruppe == "fotball") alert(urlhost);

 if (gruppe == "fotball") {
  $("#fellesinfo").html(sponsor);
 }else if (gruppe == "haandball") {
  $("#fellesinfo").html(felles);
 }
 
//works... if (gruppe == "fotball") alert(urlhost);



//$("#idrett1").html(populateMeny());

 $("#fotballmeny").html(menyfotball);
 $("#handballmeny").html(menyhandball);
 $("#elitemeny").html(menyelite);

 $("#webmastertips").html(wmtips);
 $("#webmasterkontakt").html(wmlenke);

//$("#infovenstre").html(infovenstre);

 $("#googlesok").html(googlesok);
 $("#infovenstre").html(infovenstre);
 $("#herervi").html(herervi);


//.replaceWith...
//$("#altnytt").html(altnytt);
//$(".tabs-outer").css('zIndex', 100);
//var testtt = populateMeny();


});



document.onclick = umeny_close;

//fotball
var sponsor = '';
sponsor+="<iframe src='http://utleirafotballfelles.blogspot.com'"; 
sponsor+="width='200' height='500' frameborder='0'>";
sponsor+='</iframe>'; 

//håndball
var felles = '';
felles+="<iframe src='http://utleirahaandballfelles.blogspot.com' ";
felles+="width='200' height='200' frameborder='0'>";
felles+='</iframe>'; 

//søk...
var googlesok = '';
googlesok += "<h2>S&oslash;k i utleira.no</h2>";
googlesok += "<div>";
googlesok += "<form method=GET action='http://www.google.com/search?q=site=utleira.no'>";
googlesok += "<input type=text name=q size=15 maxlength=200 value=''>";
googlesok += "<input type=hidden name='as_sitesearch' value='utleira.no'>";
googlesok += "<input type=submit name=btnG value='S&oslash;k' style='margin-left: 3px;'>";
googlesok += "</form>";
googlesok += "</div>";

//webmaster-tips...
var wmtips = '';
wmtips += "<div>";
wmtips += "<h2>Praktisk om websidene</h2>";
wmtips += "<div>";
wmtips += "<ul>";
wmtips += "<li><a href='http://webmaster.utleira.no/2010/04/for-logge-pa.html'>Logg p&aring;</a></li>";
wmtips += "<li><a href='http://webmaster.utleira.no/2010/04/laste-opp-fil-til-blogg.html'>Last opp fil (alternativ)</a></li>";
wmtips += "<li><a href='http://webmaster.utleira.no/2011/01/tilbakemelding-hva-nsker-du-for.html'>Tilbakemelding, &oslash;nskeliste</a></li>";

wmtips += "<li><a href='http://arkiv.utleira.no/webmaster/2010/04/nytt-websystem-bruksanvisning.shtml.html'>";
//wmtips += "Bakgrunn for endring p&aring; utleira.no (fra arkivet)</a></li>";

wmtips += "<a href='http://webmaster.utleira.no/2010/05/innhold-br-plasseres-i-innlegg-eller.html'>Innhold b&oslash;r i innlegg eller sider</a>";

//wmtips += "<li><a href=''></a></li>";
//wmtips += "<li><a href=''></a></li>";
wmtips += "</ul>";
wmtips += "</div></div>";

//webmaster-lenke...
var wmlenke = '';
wmlenke += "<div>";
wmlenke += "<a href='http://webmaster.utleira.no'>webmaster.utleira.no</a>: ";
wmlenke += "Har du sp&oslash;rsm&aring;l til selve webstedet? ";
wmlenke += "Se <a href='http://webmaster.utleira.no'>informasjon fra webmaster for utleira.no</a>.";
wmlenke += "</div>";


//not in use...
function populateMeny(){
 var linkhtml = '<li>jepp</li>';
 $.getJSON('http://skaug.no/utl/utleira.meny.i1.php?format=json&callback=?', 
  function(linkarray){
   $.each(linkarray,
    function(index) {
     var linkname = linkarray[index][0];
     var linkurl = linkarray[index][1];
     linkhtml += '<li><a href="' + linkurl + '">' + linkname + '</a></li>';
    }
   );
  }
 )
 return linkhtml;
}




