	var lun=(myWidth-17);$(".wraper").css("min-width",lun+"px");
	$("#contCat").css("width",lun-2 +"px");
	var col1=$(".col1").width();
	var galW=(myWidth-80-col1);//$(".container1").css("width",galW+"px");
var realise=(myWidth-100)/4 + "px";
$("#col2").find('.realizari').each(function(i){$(this).css("width",realise);})
var col2a=galW-$(".col3").width()-$(".col4").width()-21;
$(".wrapper1").css("width",col2a+"px");

var roundnumber=$(".wraper1").width()/70;
$("#items_per_page").val(Math.floor(roundnumber));
if($("#contor").val() < Math.floor(roundnumber)){
$(".wraper1").css({"width":col2a-15+"px","margin":'auto'});	
	}else{
$(".wraper1").css("width",col2a-70+"px");
var newW=$(".wraper1").width();
var dif=$(".wraper1").width() - (Math.floor(roundnumber)*72);	
//var rez=dif/roundnumber;alert(rez);	
$(".wraper1").css("width",newW-dif+2+"px");
}

		
if(myWidth >800 && myWidth <1280){
	//alert(".image-wrapper a img");
	var col4=galW-$(".col3").width()-530+"px";
	//alert(col4);
$(".imGal").css({"width":"500px","height":"385px"});
$(".gallerea,").css({"width":"500px","height":"385px"});
$(".imGal img").css({"margin":"26px 0"});
$(".col4").css({"min-height":"435px","width":col4});
$(".col2").css({"width":"500px"});
$(".col3").css({"min-height":"390px"});
$(".imGal").find(".imagine").css({"max-width":"500px", "max-height":"385px"});
}else if(myWidth >=1280 && myWidth <1900){
var col4=galW-$(".col3").width()-650+"px";
$(".col4").css({"min-height":"455px","width":col4});
$(".col3").css({"min-height":"405px"});
$(".col2").css({"width":"600px"});
$(".contCont").css({"min-height":"295px"});
$(".imGal").css({"width":"600px","height":"400px"});
$(".gallerea").css({"width":"600px","height":"400px"});
$(".imGal img").css({"margin":"0"});
$(".imGal").find(".imagine").css({"max-width":"600px", "max-height":"400px"});
	}
if(page=='home' ){var col2=myWidth-300+"px";//$("#col2").css("width",col2);
}else{var col2=myWidth-17+"px";$("#col2").css({"width":col2,"margin":"0","border":"0px solid"});}
		
if(page=='jurnal' && articol!=''){var col2=myWidth-300+"px";
$("#col2").css({"width":col2,"margin":"0","border":"0px solid"});

}	
if(page=='contacte'){var col2=myWidth-270+"px";
$("#col2").css({"width":col2,"margin":"0","border":"0px solid"});}	
$(".right").css({"width":"230px","margin-left":"20px"});

$(".rind").hover(function() {$(this).addClass('hover');}, function() {$(this).removeClass('hover');});

$(".scrollablel").delegate("div", "mouseover mouseout", function(e) {
	if (e.type == 'mouseover') {
	$(".scrollable .rind").not(this).dequeue().animate({opacity: "0.3"}, 300);
	$(this).addClass('hover');
    } else {
	$(".scrollable .rind").not(this).dequeue().animate({opacity: "1"}, 300);
	$(this).removeClass('hover');
   	}
});
	
$(".scrollable").scrollable({ vertical: true, mousewheel: true });	



$("#Searchresult").delegate("div", "mouseover mouseout", function(e) {
	if (e.type == 'mouseover') {
	$("#Searchresult div").not(this).dequeue().animate({opacity: "0.3"}, 300);
	$(this).addClass('hover');
	//alert('You have clicked the div element');
    } else {
	$("#Searchresult div").not(this).dequeue().animate({opacity: "1"}, 300);
	$(this).removeClass('hover');
   	}
	});
	
$("#Searchresult").delegate("div", "click", function(e) {
	if (e.type == 'click') {
	var currentid=$(this).attr('id');
	var currclient=$(this).attr('title');
	//$("#Searchresult div").not(this).dequeue().animate({opacity: "0.3"}, 300);
	$(this).addClass('activat1');
	//alert(currentid);
	$.ajax({
      url: "/files/ajaxd.php",
      global: false,
      type: "POST",
      data: ({id : currentid,title : currclient}),
      dataType: "html",
      async:false,
      success: function(msg){
		  $('#cont').html(msg);
		  }
   })
          }
	});
	//getthumb.php?path=<?php echo $resultl['foto'];?>&amp;size=40
	function pageselectCallback(page_index, jq){
                // Get number of elements per pagionation page from form
                var items_per_page = $('#items_per_page').val();
				//alert(items_per_page);
                var max_elem = Math.min((page_index+1) * items_per_page, user.length);
				var newcontent = '';
                // Iterate through a selection of the content and build an HTML string
                for(var i=page_index*items_per_page;i<max_elem;i++)
                {
                    if(user[i]==w1 || user[i]==w2){
					if(thumb[i]!=''){	
                   newcontent += '<div class="item activat" id="'+user[i]+'" title="'+client+'"><img src="/getthumb.php?path='+ thumb[i] +'&amp;size=68" ></div>';}
					}else{
						if(thumb[i]!=''){	
					newcontent += '<div class="item" id="'+user[i]+'" title="'+client+'"><img src="/getthumb.php?path='+ thumb[i] +'&amp;size=68"  ></div>';
						}
						}
                    //newcontent += '<dd class="party">' + members[i][2] + '</dd>';
                }

                // Replace old content with new content
                $('#Searchresult').html(newcontent);
              return false;
            }

            
            function getOptionsFromForm(){
                var opt = {callback: pageselectCallback};
                // Collect options from the text fields - the fields are named like their option counterparts
                $("input:text").each(function(){
                    opt[this.name] = this.className.match(/numeric/) ? parseInt(this.value) : this.value;
                });
                // Avoid html injections in this demo
                var htmlspecialchars ={ "&":"&amp;", "<":"&lt;", ">":"&gt;", '"':"&quot;"}
               		
				opt.prev_text='<img src="/img/arrowl.gif" height="43" width="22" >';
				opt.next_text='<img src="/img/arrowr.gif" height="43" width="22" >';
				return opt;
            }

            // When document has loaded, initialize pagination and form
			//if(pagina==""){
             var current_page = pagina;
			//}
		
                // Create pagination element with options from form
                var optInit = getOptionsFromForm();
               $("#Pagination").pagination(user.length, optInit,current_page);

                // Event Handler for for button
               

  	$('.rind').each(function(index) {
	var mas=$(this).attr('id');
	if(mas==i){
	$(this).addClass('active');	
}
 });

// execute your scripts when DOM is ready. this is a good habit




			
		
