

function show(div1){
  document.getElementById(div1).style.visibility = "visible";
  if(div1 == "tab1")
  {
	  document.getElementById("tabtit1").style.color = "#868585";
	  document.getElementById("tabtit1").style.fontWeight = "normal";
  }
  else if(div1 == "tab2")
  {
	  document.getElementById("tabtit2").style.color = "#868585";
	  document.getElementById("tabtit2").style.fontWeight = "normal";
  }
  else if(div1 == "tab3")
  {
	  document.getElementById("tabtit3").style.color = "#868585";
	  document.getElementById("tabtit3").style.fontWeight = "normal";
  }
  else if(div1 == "tab4")
  {
	  document.getElementById("tabtit4").style.color = "#868585";
	  document.getElementById("tabtit4").style.fontWeight = "normal";
  }
  else if(div1 == "tab5")
  {
	  document.getElementById("tabtit5").style.color = "#868585";
	  document.getElementById("tabtit5").style.fontWeight = "normal";
  }
}

function hide(div1){
  document.getElementById(div1).style.visibility = "hidden";
  if(div1 == "tab1")
  {
	  document.getElementById("tabtit1").style.color = "#0D216D";
	  document.getElementById("tabtit1").style.fontWeight = "bold";
  }
  else if(div1 == "tab2")
  {
	  document.getElementById("tabtit2").style.color = "#0D216D";
	  document.getElementById("tabtit2").style.fontWeight = "bold";
  }
  else if(div1 == "tab3")
  {
	  document.getElementById("tabtit3").style.color = "#0D216D";
	  document.getElementById("tabtit3").style.fontWeight = "bold";
  }
  else if(div1 == "tab4")
  {
	  document.getElementById("tabtit4").style.color = "#0D216D";
	  document.getElementById("tabtit4").style.fontWeight = "bold";
  }
  else if(div1 == "tab5")
  {
	  document.getElementById("tabtit5").style.color = "#0D216D";
	  document.getElementById("tabtit5").style.fontWeight = "bold";
  }
}

function getURLParam(strParamName){
  var strReturn = "";
  var strHref = window.location.href;
  if ( strHref.indexOf("?") > -1 ){
    var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
    var aQueryString = strQueryString.split("&");
    for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
      if (
		aQueryString[iParam].indexOf(strParamName + "=") > -1 ){
        var aParam = aQueryString[iParam].split("=");
        strReturn = aParam[1];
        break;
      }
    }
  }
  return strReturn;
}

function operaMobile()
{
	if(navigator.appVersion.indexOf("Opera Mobi") > 0 && getURLParam("portal")!="all")
	{
		//korzystasz z przeglądarki Opera Mobile
		document.location = 'http://91.213.108.85/MobilnaMalopolska/Choice.aspx';
	}
}

function displayTabs(current){

  operaMobile();
  count = countTabs();
  switch(current)
  {
    case 1:
        show("tab5");
        hide("active5");
        show("tab4");
        hide("active4");
        show("tab3");
        hide("active3");
        show("tab2");
        hide("active2");
        hide("tab1");
        show("active1");
        show("content1");
        hide("content2");
        hide("content3");
        hide("content4");
        hide("content5");
    break;    
    case 2:
        show("tab5");
        hide("active5");
        show("tab4");
        hide("active4");
        show("tab3");
        hide("active3");
        hide("tab2");
        show("active2");
        show("tab1");
        hide("active1");
        hide("content1");
        show("content2");
        hide("content3");
        hide("content4");
        hide("content5");
    break;
    case 3:
        show("tab5");
        hide("active5");
        show("tab4");
        hide("active4");
        hide("tab3");
        show("active3");
        show("tab2");
        hide("active2");
        show("tab1");
        hide("active1");
        hide("content1");
        hide("content2");
        show("content3");
        hide("content4");
        hide("content5");
    break;    
    case 4:
        show("tab5");
        hide("active5");
        hide("tab4");
        show("active4");
        show("tab3");
        hide("active3");
        show("tab2");
        hide("active2");
        show("tab1");
        hide("active1");
        hide("content1");
        hide("content2");
        hide("content3");
        show("content4");
        hide("content5");
    break;
    case 5:
        hide("tab5");
        show("active5");
        show("tab4");
        hide("active4");
        show("tab3");
        hide("active3");
        show("tab2");
        hide("active2");
        show("tab1");
        hide("active1");
        hide("content1");
        hide("content2");
        hide("content3");
        hide("content4");
        show("content5");
    break;
  }
  switch(count)
  {
    case 1:
        hide("tab2");
        hide("active2");
        hide("tabtit2");
    case 2:
        hide("tab3");
        hide("active3");
        hide("tabtit3");
    case 3:
        hide("tab4");
        hide("active4");
        hide("tabtit4");
    case 4:
        hide("tab5");
        hide("active5");
        hide("tabtit5");
  }
}


