function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function addClass(element,value) {
  if (!element.className) {
    element.className = value;
  } else {
    newClassName = element.className;
    newClassName+= " ";
    newClassName+= value;
    element.className = newClassName;
  }
}

addLoadEvent(stripeTables);

function stripeTables() {
  if (!document.getElementsByTagName) return false;
  var tables = document.getElementsByTagName("tbody");
  for (var i=0; i<tables.length; i++) {
    var odd = false;
    var rows = tables[i].getElementsByTagName("tr");
    for (var j=0; j<rows.length; j++) {
      if (odd == true && rows[j].className.indexOf("categoryName") == -1) {
        addClass(rows[j],"odd");
        odd = false;
      } else {
        odd = true;
      }
    }
  }
}



//showDetails
$(document).ready(function() {
  $('div.showDetails:eq(0)> div').hide();
  $('div.showDetails:eq(0)>div>ul>li>ul').hide();
  
  $('div.showDetails:eq(0)> h5').click(function() {
   $(this).next().slideToggle('fast')
   .siblings('div:visible').slideUp('fast'); 
  });
  
  $('div.showDetails:eq(0)> div > ul > li').click(function() {
   $(this)
	.parents("ul").eq(0)
		.find("ul:visible")
			.slideUp("fast")
			.end()
		.end()
	.end()
	.find("ul")
		.slideToggle("fast");
  });
});
//step-by-step
$(document).ready(function() {
        $('ul.steps li.step1 a').addClass('active'); 
        $('ul.steps li a').click(function() {
            $('ul.steps li a').removeClass('active');
            $(this).addClass('active');
        });
    });


function AdorGetUrl(url)
{
$("#loadGif").show();
$.get(url,
  function(data){
$("#contentTargetDiv").empty();	
$("#contentTargetDiv").append(data);
$("#loadGif").hide();
  });
}




function shdivs( s ) {
	if( !document.getElementById ) return;
	s = document.getElementById( s );
	if( s ) s.style.display = "block";
	for( var i=1; i<arguments.length; i++ ) {
		s = document.getElementById( arguments[ i ] );
		if( s ) s.style.display = "none";
	};
}

function popup( url, width, height ) {

  eval("window.open('" + url + "','_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + width + ",height=" + height + "')");

}

$(function() {
    $("#search-map").hide();
    $("#search-poi").hide();
    
    
    $("#search-radio-web").click(function(e) {
        $("#search-map").hide();
        $("#search-poi").hide();
        $("#search-web").show();

    });
    
    $("#search-radio-map").click(function(e) {
        $("#search-poi").hide();
        $("#search-web").hide();
        $("#search-map").show();
    });
    
    $("#search-radio-poi").click(function(e) {
        $("#search-web").hide();
        $("#search-map").hide();
        $("#search-poi").show();
    });
});


