$(document).ready(function() {
    
    $("#findUserFormLabel").click(function(){
         $("#findUserFormDiv").slideToggle(); 
    });
    
    $("#findWorksFormLabel").click(function(){
         $("#findWorksFormDiv").slideToggle();
    });    
    
    $(".cdPhotos a").fancybox({
    	hideOnContentClick: true,
    	overlayShow: true,
    	overlayOpacity: 0.3,
    	zoomSpeedIn: 600,
    	zoomSpeedOut:300
    });
    
   
    
    
var index = 0;
$("input.customFile").each(function(){
   $(this).parents('.inputDiv').removeClass("inputFile").removeClass("inputDiv");
   index ++;
   $(this).attr("id", "customFile_"+index);
   $(this).addClass('customFileInv');
   $(this).before('<div class="customFileBlocker"></div>');
   $(this).after('<div title="Выбрать файл" class="customFileBut "></div><div class="customFileName" id="customFileName_'+index+'"></div>');
   $(this).parents('div::first').after('<div style="height: 20px;"></div>');
   
   $(this).change(function() {
      
      var idTmp = $(this).attr('id').replace(/customFile_/i, "");
      file = $(this).val();
      reWin = /^(.*\\)?([^\\]+)$/g; //для видновс
      var fileTitle = file.replace(reWin, "$2"); //выдираем название файла для windows
      reWin = /^(.*\/)?([^\/]+)$/g; //для юникс
      fileTitle = fileTitle.replace(reWin, "$2"); //выдираем название файла для windows
      $("#customFileName_"+idTmp).html(fileTitle).css({display :'block'});

      var RegExExt =/.*\.([^\.]+)$/;
      var ext = fileTitle.replace(RegExExt, "$1");//и его расширение

      var pos = '';
      if (ext) {
         switch (ext.toLowerCase()) {
         case 'jpg': pos = '0'; break;
         case 'jpeg': pos = '0'; break;
         case 'png': pos = '16'; break;
         case 'gif': pos = '32'; break;
         case 'mp3': pos = '48'; break;
         default: pos = ''; break;
      };
      if (pos != '') {
         $("#customFileName_"+idTmp).css({background : 'url(/images/upload_icons.png) no-repeat 0 -'+pos+'px'});
      }
   };
});

   
});
    

   
});


var develop = function() {
   window.open('http://www.bondsoft.ru/portfolio.html', '', 'left=100, top=50, resizable=1, scrollbars=1, menubar=1, toolbal=1,location=1,status=1');
}