function info(sele)
{
//	var current_id = sele.id;
	var request_url = host_url+'/www/ajax_product_info.php?id='+sele.id;
    var json = new cmsAjaxResponse(request_url, {loader: false }).doRequest();
	
	$$('div.elem').setStyle('border', '');
	$(sele.id).setStyle('border', '1px solid #BAB0A6');

}

function series(id)
{
	//alert(id);
	var request_url = host_url+'/www/ajax_show_series.php?id='+id;
    var json = new cmsAjaxResponse(request_url, {loader: false }).doRequest();
    showInfo(  langLoadingSeries );

}

function patterns(id)
{
	//alert(id);
	var request_url = host_url+'/www/ajax_show_patt.php?id='+id;
    var json = new cmsAjaxResponse(request_url, {loader: false }).doRequest();

}

function updateId(obj)
{
	current_id = obj.id;
	//alert(current_id);
}

function addhash(id,site)
{
	window.location.hash=site+'/'+id;
}

function active(id)
{
	$(id).setStyle('text-decoration', 'underline');
}

function deactive(id)
{
	$(id).setStyle('text-decoration', 'none');
}

function readHash()
{
	var number = 0;
	var hash = window.location.hash.substring(1);
	var hashPath = hash.split('/');
	
	if (hashPath[0]=='gallery')
	{
		var number = hashPath[1];
		
	}
	
	//alert(number);
	return number;
	
}
	
window.addEvent('domready', function() {
	
	//alert(window.location.hash);
	
	//odczytanie URL i jeśli jest coś za # to przekierowuje do odpowiedniej lokalizacji
	if(window.location.hash != '') {
		
		var hash = window.location.hash.substring(1);
		var hashPath = hash.split('/');
		
		if (hashPath[0]=='series')
		{
			series(hashPath[1]);
		}
		else if (hashPath[0]=='pattern')
		{
			patterns(hashPath[1]);
		}
		else if (hashPath[0]=='gallery')
		{
			var number = hashPath[1];
			
			//$('sub-input').set('value', number + '/' + myScroller.abc);
			$('sub-input').set('value', number);
			myScroller.refresh();
			//$('sub-input').set('value', number + '/' + myScroller.abc);
			
			

		}
		else if (hashPath[0]=='product')
		{
			var link = $('back').get('href');
		//	alert(link);
			$('back').set('href',link+'#gallery/'+hashPath[1]);
		}
		else if (hashPath[0]=='gall')
		{
			var link = $('backc').get('href');
			//	alert(hashPath[1]);
			$('backc').set('href',link+'#gallery/'+hashPath[1]);
		}
		
	}
	
	
			
});


