$(document).ready(function() {
	
	// services open detail
	$('td.first a').live("click", function(event){
		service_id = this.id.substr(5);
		$('tr#detail-' + service_id).toggle();
		$('tr#detail2-' + service_id).toggle();
		
		if ($('tr#detail-' + service_id).is(":visible"))
		{
			$(this).css({background: 'url(img/ui/bg_arr_blue_open.gif) 0 3px no-repeat'});
			$(this).parent().parent().find('td').css({border: '0'});
		}
		else
		{
			$(this).css({background: 'url(img/ui/bg_arr_blue.gif) 0 2px no-repeat'});
			$(this).parent().parent().find('td').css({borderBottom: '1px #999 solid'});
			//$(this).parent().parent().find('td').css({background: 'url(img/ui/bg_td_tile.gif) left bottom repeat-x'});
			//$(this).parent().parent().find('td.first').css({background: 'url(img/ui/bg_td.gif) left bottom no-repeat'});
			//$(this).parent().parent().find('td.last').css({background: 'url(img/ui/bg_td.gif) right bottom no-repeat'});
		}
	});
	
	$('a.close').live("click", function(event){
		service_id = this.id.substr(6);								
		$('tr#detail-' + service_id).hide();	
		$('tr#detail2-' + service_id).hide();	
		$('a#name-' + service_id).css({background: 'url(img/ui/bg_arr_blue.gif) 0 2px no-repeat'});
		$('a#name-' + service_id).parent().parent().find('td').css({borderBottom: '1px #999 solid'});
	});
	
						
});

// get url parameters
function gup(name, url)
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec(url);
  if( results == null )
    return "";
  else
    return results[1];
}
