$(document).ready(function(){	

    	//$.colorbox({href:'maps.php'}); 
        
        $('a.maps').click(function(){
        		var id = $(this).attr('id');
        		//$('a.maps').colorbox({href:"http://localhost/genesisshop/htdocs/maps.php", iframe: true,  height: "430px", width: "560px"});	
        		$('a.maps').colorbox({href:"maps.php?id=" + id, iframe: true,  height: "480px", width: "615px"});
            }); 
    	

    	
    	    						   
        $("ul.sf-menu").supersubs({ 
            minWidth:    13,   // minimum width of sub-menus in em units 
            maxWidth:    13,   // maximum width of sub-menus in em units 
            extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
                               // due to slight rounding differences and font-family 
        }).superfish({autoArrows:    false,
					  delay:25,
					  disableHI: true
					  });  // call supersubs first, then superfish, so that subs are 
                         // not display:none when measuring. Call before initialising 
                         // containing tabs for same reason. 
						 
						 
		/// initialize scrollable
			$("div.scrollable").scrollable({speed:1300}).autoscroll({steps:5, autopause: true, interval: 10000});


			/* 
			 * SET UP jq ZOOM 
			 * more options http://www.mind-projects.it/projects/jqzoom/index.php#documentation
			 */
			var options = {
		    zoomWidth: 524,
		    zoomHeight: 418,
	            xOffset: 10,
	            yOffset: 0,
				title:false,
	            position: "right" //and MORE OPTIONS
			};

			   
			$(".jqzoom").jqzoom(options);	
				
			
					 
			/* 
			 * SET UP slide show, and prev next links
			 * more options http://www.malsup.com/jquery/cycle/options.html
			 */
			
			$('.slideshow').cycle({
				timeout: 0, 	
				fx: 'fade', 
				pager:  'nav', 
				pagerAnchorBuilder: function(idx, slide) { 
					// return selector string for existing anchor 
					return '#nav li:eq(' + idx + ') a'; 
				} 
								  

			});
            
    //------------ validate / sheck only EN and _
    $('input.validEN').keyup(function() {
        if (this.value.match(/[^a-zA-Z0-9_]/g)) {
            this.value = this.value.replace(/[^a-zA-Z0-9_]/g, '');
            alert ("Моля, за парола използвайте само цифри и букви на Английски!");
        }
    });


    //----------- select price
    $('.selectPrice').click(function(){
       
            //----------- redirect to url
            //window.location($(this).val());
           // window.location('http://localhost/genesisshop/htdocs/bg/items/gifts.html');
           $(location).attr('href',$(this).val());

       
    });
    
    //----------- select brand
    
    $('#brand-usage-select2').change(function(){
       
            //----------- redirect to url
            //window.location($(this).val());
           // window.location('http://localhost/genesisshop/htdocs/bg/items/gifts.html');
           $(location).attr('href',$(this).val());

       
    });
        
    
    //--------------- show fb
    $('#fb-show').hover(function(){
        $('#fb-block').show('slow');
    });
    
    //-------------- BRANDS in home page
    $("#sc-brands").scrollable({
		vertical:true,
		speed:700,
		items: ".sc-brands-items",
		next: "#sc-brands-next",
		prev: "#sc-brands-prev",
		keyboard: true,		
		disabledClass: "none"
	});
            			
			
}); 

