 
// Corners
jQuery(document).ready(function() {
	/*$('.corner-30').corner("keep bevel tr 30px");*/
});

$(document).ready(function(){
	/*
	$("area[rel^='prettyPhoto']").prettyPhoto();
	
	$(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'normal',theme:'facebook',slideshow:3000, autoplay_slideshow: false});
	$(".gallery:gt(0) a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'fast',slideshow:10000, hideflash: true});

	$("#custom_content a[rel^='prettyPhoto']:first").prettyPhoto({
		custom_markup: '<div id="map_canvas" style="width:260px; height:265px"></div>',
		changepicturecallback: function(){ initialize(); }
	});

	$("#custom_content a[rel^='prettyPhoto']:last").prettyPhoto({
		custom_markup: '<div id="bsap_1259344" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6"></div><div id="bsap_1237859" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6" style="height:260px"></div><div id="bsap_1251710" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6"></div>',
		changepicturecallback: function(){ _bsap.exec(); }
	});
	*/

	// tady budeme pracovat s obrazky v clancich a textovych strankach (colorbox)
	$("#page #txt a img").each(function(index, img) {
		var imgParent = $(img).parents("a"); // promenna obsahujici odkaz <a>
		
		var aURL = imgParent.attr("href"); // odkaz pro dany obrazek
		// pokud neni odkaz platny (href neexistuje), nastavime prazdnou priponu
		if (typeof(aURL) === "undefined") {
			var urlExt = "";
		} else {
			var urlExt = aURL.substring(aURL.length-4); // pripona souboru
		}
		
		switch (urlExt) {
			case ".jpg":
			case ".png":
			case ".gif":
			case ".JPG":
			case ".PNG":
			case ".GIF":
				isColorbox = true; // dle pripony jsme poznali, ze chceme colorbox
				break;
			default:
				isColorbox = false; // jina pripona nez jpg/png/gif
		}
		
		// pokud si tento prvek zaslouzi colorbox, dame mu jej :-)
		if (isColorbox) {
			imgParent.attr("rel", "article");
			imgParent.colorbox({current: "{current} / {total}", maxWidth:"90%", maxHeight:"90%"});
		}
	});
	
	
	$(".forcolorbox").colorbox(
			{
				current: "{current} / {total}", maxWidth:"90%", maxHeight:"90%"
			}
	);
	
	//jTipster - config - obchodni zastupci - celkova mapa
	jQuery('#map_all').jTipster({
      'width': 150,
      'popup': '.popup',
      'marker': '.marker',
      'offset': 0,
      'baseimageurl': '/images/jtipster/'
	});

	
	//jTipster - config - obchodni zastupci - detail
	jQuery('#map').jTipster({
      'width': 200,
      'popup': '.popup',
      'marker': '.marker',
      'offset': 0,
      'baseimageurl': '/images/jtipster/'
	});

	
    //zvyrazni firmu v obchodnich zastupcich
	jQuery('#map a.marker').click(function(e) {
	        var id = $(this).attr("name");
	        $('#firms ul li').css('background-color', 'transparent');
	        $('#fir'+id).css('background-color', '#ddd');
	});
	
	
});
