$(document).ready(function() {
    $('a').click(
        function() {
            var p = this.href.split('/').pop();
            //alert (p);
            switch (p) {
                case 'register':
                    window.open(this.href, 'register', 'width=480,height=540,scrollbars=no,status=yes,resizable=yes');
                    return false;
                    break;
                /* case 'samples':
                    window.open(this.href, 'samples', 'width=600,height=450,scrollbars=yes,status=yes,resizable=yes');
		            return false; */
                case 'studio':
                case 'painters':
                    window.open(this.href, 'pictures', 'width=600,height=450,scrollbars=yes,status=yes,resizable=yes');
    		        return false;
                default :
                    return true;
            } 
        }
    );
    
    
        
    $("div.desc").each( function() {
    		var a = $(this).find("p").not(".more").not(".less");	
	    	
    		var l = a.length;
	    	if (l > 1) {
		        for (var i=1; i<l;i++) {
		            $(a[i]).hide();
		        }
		        $(this).find("p.more").show().click(function() {
		    			for (var i=1; i<l;i++) {
		         		   $(a[i]).show();
		        		}
			        	$(this).hide().next().show();
			        	return false;
			        }
		        );
		        $(this).find("p.less").click(function() {
		    			for (var i=1; i<l;i++) {
		         		   $(a[i]).hide();
		        		}
			        	$(this).hide().prev().show();
			        	return false;
			        }
		        );
		    }
    	}
    );
     
});
