$(function()
{
	$('.ro').mbRollover();
	
    $("a[rel^='lightbox']").prettyPhoto({
			animationSpeed: 'slow',
			padding: 40,
			opacity: 0.85,
			showTitle: false,
			allowresize: true,
			counter_separator_label: '/',
			theme: 'light_rounded'
    });
    
    var replace;
    $("input[title!='']").focus(function(){
    	replace = $(this).attr("title");
    	var thisVal = $(this).val();
    	if(thisVal == replace)
    		$(this).val("");
    });
    
    $("input[title!='']").blur(function(){
    	var thisVal = $(this).val();
    	if(thisVal == "")
    		$(this).val(replace);
    });
    
    $("input.hasInputReplace").click(function(){
    	var prevVal = $(this).prev().val();
    	var prevTitle = $(this).prev().attr("title");
    	//alert(prevVal + " " + prevTitle);
    	if(prevVal == prevTitle)
    		 $(this).prev().val('');
    	
    });
    
    
    $("#catMenu").superfish({
    	delay:       750,                            // one second delay on mouseout 
        animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
        speed:       'fast',                          // faster animation speed 
        autoArrows:  false,                           // disable generation of arrow mark-up 
        dropShadows: false,                            // disable drop shadows
    }).supposition();
    
    
    $('#browseSubCatMenuID').change(function(){
    	var val = $('#browseSubCatMenuID option:selected').val();
    	if(val!=""){
    		with(document.browseSubCatForm){
    			searchString.value = val;
    			category_id.value = val;
    			submit();
    		}
    	}
    });
});
