function href_tab(){
	var doc_href = document.location.href;
	var delim = '#tab_id:';
	var tab_begin = 'th';
	var id_delim = '_';
	var index = doc_href.indexOf(delim);
	if(index != -1){
		// we have tab marker
		tab_id = doc_href.substr(index+delim.length);			//'th1799_2'
		// get just element id	
		tab_base = tab_id.substr(tab_begin.length); 			  //'1799_2'
		index_delim = tab_base.indexOf(id_delim);
		if(index_delim != -1){
			tab_base_id =tab_base.substr(0,index_delim );		//'1799'
			th = document.getElementById(tab_id);
			if(th){		
				showTab_href(th, tab_base_id);
					
			}
		}
	}
}

function showTabMod( th, pid ) {
		res = showTab( th, pid );
		res = changeLocation( th, pid );
		 return false;
		}
				
function  changeLocation( th, pid ){
	var doc_href = document.location.href;
	var delim = '#tab_id:';
	var tab_begin = 'th';
	var id_delim = '_';
	var index = doc_href.indexOf(delim);
	if(index != -1){
		// we have tab marker
		doc_href = doc_href.substr(0,index);
	}
	doc_href = doc_href + delim + th.parentNode.id;
	document.location = doc_href;	
	return false;
}		
		
function showTab_href( th, pid ) {
		 Ext.select('*[id^=th'+contID[pid]+']').each(function(el){
		  el.removeClass('act');
		 });
		 Ext.select('*[id^=tc'+contID[pid]+']').each(function(el){
		  el.addClass('nodisplay');
		 });
		 Ext.get( th.id.replace('h','c') ).removeClass('nodisplay');
		 Ext.get( th ).addClass('act');
		 return false;
}

Ext.onReady(function(){
	href_tab();
});