		    $(document).ready($(function(){
	//navi version
		    	$("#partie_gauche").css({
		    	      'MozUserSelect' : 'none'
		    	    }).bind('selectstart', function() {
		    	      return false;
		    	    }).mousedown(function() {
		    	      return false;
		    	    });
		    	var uptodate=false,browurl="";
		    	function detectBrowserVersion(){
		    		var userAgent = navigator.userAgent.toLowerCase();
		    		$.browser.chrome = /chrome/.test(navigator.userAgent.toLowerCase());
		    		var version = 0;

		    		// Is this a version of IE?
		    		if($.browser.msie){
		    		userAgent = $.browser.version;
		    		userAgent = userAgent.substring(0,userAgent.indexOf('.'));
		    		version = userAgent;
		    		if(version<8) uptodate=true;
		    		browurl="http://www.microsoft.com/france/windows/internet-explorer/telecharger-ie9.aspx";
		    		}

		    		// Is this a version of Chrome?
		    		if($.browser.chrome){
		    		userAgent = userAgent.substring(userAgent.indexOf('chrome/') +7);
		    		userAgent = userAgent.substring(0,userAgent.indexOf('.'));
		    		version = userAgent;
		    		// If it is chrome then jQuery thinks it's safari so we have to tell it it isn't
		    		$.browser.safari = false;
		    		if(version<9) uptodate=true;
		    		browurl="http://www.google.com/chrome/";
		    		}

		    		// Is this a version of Safari?
		    		if($.browser.safari){
		    		userAgent = userAgent.substring(userAgent.indexOf('safari/') +7);
		    		userAgent = userAgent.substring(0,userAgent.indexOf('.'));
		    		version = userAgent;
		    		if(version<4) uptodate=true;
		    		browurl="www.apple.com/safari/download/";
		    		}

		    		// Is this a version of Mozilla?
		    		if($.browser.mozilla){
		    		//Is it Firefox?
		    		if(navigator.userAgent.toLowerCase().indexOf('firefox') != -1){
		    		userAgent = userAgent.substring(userAgent.indexOf('firefox/') +8);
		    		userAgent = userAgent.substring(0,userAgent.indexOf('.'));
		    		version = userAgent;
		    		if(version<3) uptodate=true;
		    		browurl="http://download.mozilla.org/";
		    		}
		    		// If not then it must be another Mozilla
		    		else{
		    			
		    		}
		    		}

		    		// Is this a version of Opera?
		    		if($.browser.opera){
		    		userAgent = userAgent.substring(userAgent.indexOf('version/') +8);
		    		userAgent = userAgent.substring(0,userAgent.indexOf('.'));
		    		version = userAgent;
		    		if(version<8) uptodate=true;
		    		browurl="http://www.opera.com/download/";
		    		}
		    		return version;
		    		} 
		    	detectBrowserVersion();
		    	if(uptodate==true){
		    		$("body").append('<div style="height:80px;width:150px;border:1px solid blue; background-color:#F7E199;font-size:1.1em; color:#0;position:absolute;top:0;left:0;">Mettez à jour votre navigateur, pour bénificier des fonctionalités du site.<button id="browlink">Upddate</button></div>');
		    		$("#browlink").button();
		    
			$("#browlink").click(function() {
				window.open(browurl);
			});
		    		
		    	}
		    
		    	
	//end navi version
		    	
	              // binds form submission and fields to the validation engine
	               $(function(){
	                jQuery("#formID").validationEngine();  //$(this).remove(); 
	                jQuery("#form_rais").validationEngine();
	                });
		        $('#slider1').bxSlider({
		            infiniteLoop: true,
		            auto: true,
		            controls: false, 
		            pager: true                
		        });
		        $("#menup").jchasing ();
 
			    if($("#profile").length) {	

  
 
        
  //tabbbbbbbbbbbbb       
               
		var nbtab=20;
	for(i=1;i<=nbtab;i++){
	    var v="#tabs"+i;
		 $( v ).tabs();
	}              
   
	$(function() {
		$( "#effect" ).dialog( "desable" );
		$( "#effect" ).dialog( "close" );
		$( "#effect" ).hide();
		
	});

	//page web 
	
		$(function() {
		// there's the gallery and the trash
		var $gallery = $( "#galleryy" );

		// let the gallery items be draggable
		$( "li", $gallery ).draggable({
			cancel: "a.ui-icon", // clicking an icon won't initiate dragging
			revert: "invalid", // when not dropped, the item will revert back to its initial position
			containment: $( "#Carte_viste" ).length ? "#carte_visite" : "document", // stick to demo-frame if present
			helper: "clone",
			cursor: "move"
		});
		});

		// image preview function, demonstrating the ui.dialog used as a modal window
		function viewLargerImage( $link ) {
			var src = $link.attr( "href" ),
				title = $link.siblings( "img" ).attr( "alt" ),
				$modal = $( "img[src$='" + src + "']" ),w = $link.siblings( "img" ).attr( "width" );


				var img = $( "<img alt='" + title + "' width='480' height='800' style='display: none; padding: 8px;' />" )
					.attr( "src", src ).appendTo( "body" );
				setTimeout(function() {
					img.dialog({
						title: title,
						width: 480,
						modal: true
					});
				}, 1 );
			}
		

		// resolve the icons behavior with event delegation
		$( "#galleryy  li *" ).click(function( event ) {
			var $item = $( this ),
				$target = $( event.target );
    if ( $target.is( "a.ui-icon" ) ) {
    	
				viewLargerImage( $target );
			}

			return false;
		});

	
	//page web fin
	
		function runEffect() {
			// get effect type from 
			var selectedEffect = $( "#effectTypes" ).val();

			// most effect types need no options passed by default
			var options = {};
			// some effects have required parameters
			if ( selectedEffect === "scale" ) {
				options = { percent: 100 };
			} else if ( selectedEffect === "size" ) {
				options = { to: { width: 280, height: 185 } };
			}

			// run the effect
			$( "#effect" ).show( selectedEffect, options, 500, callback );
		};

		//callback function to bring a hidden box back
		function callback() {
			setTimeout(function() {
				$( "#effect:visible" ).removeAttr( "style" ).fadeOut();
			}, 1000 );
		};

		
		var defaults = {
				name: 'Name',
				email: 'Email',
				message : 'Message',
				subject : 'A contactable message',
				recievedMsg : 'Thankyou for your message',
				notRecievedMsg : 'Sorry but your message could not be sent, try again later',
				disclaimer: 'Please feel free to get in touch, we value your feedback',
				hideOnSubmit: true
			};
		
		// a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
		$( "#dialog-form:ui-dialog" ).dialog( "destroy" );
		
		var name = $( "#name" ),
		     prenom = $( "#prenom" ),
		     tel = $( "#tel_" ),
			email = $( "#email" ),
			objet_ = $( "#objet_" ),
			message = $( "#message" ),
			idd = $( "#idd" ),
			allFields = $( [] ).add( name ).add( prenom ).add( tel ).add( email ).add( objet_ ).add( message ).add( idd),
			tips = $( ".validateTips" );

		function updateTips( t ) {
			tips
				.text( t )
				.addClass( "ui-state-highlight" );
			setTimeout(function() {
				tips.removeClass( "ui-state-highlight", 1500 );
			}, 500 );
		}

		function checkLength( o, n, min, max ) {
			if ( o.val().length > max || o.val().length < min ) {
				o.addClass( "ui-state-error" );
				updateTips( "Length of " + n + " must be between " +
					min + " and " + max + "." );
				return false;
			} else {
				return true;
			}
		}
		function checkRegexp( o, regexp, n ) {
			if ( !( regexp.test( o.val() ) ) ) {
				o.addClass( "ui-state-error" );
				updateTips( n );
				return false;
			} else {
				return true;
			}
		}
		$( "#dialog-form" ).dialog({
			autoOpen: false,
			height: 500,
			width: 350,
			modal: true,
			buttons: {
			"Envoyer":
			function() {	
			$.post('mail.php',{name: $('#name').val(),prenom: $('#prenom').val(),tel: $('#tel_').val(), email:$('#email').val(),idd:$('#idd').val(), objet_:$('#objet_').val(), message:$('#message').val()}
			,function(data){
				var chaine=data;
			
				if (chaine.match("success"))
				 {

					$("#dialog-form").dialog( "close" );	
					$(function() {
						// a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
						$("#abcdefg").html('<div id="dialog-message" title="Confirmation"><p><span class="ui-icon ui-icon-circle-check" style="float:left; margin:0 7px 50px 0;"></span>Votre message est envoyé.</p></div>');
						$( "#dialog-message" ).dialog( "Message envoyé avec succès...!" );
					
						$( "#dialog-message" ).dialog({
							modal: true,
							buttons: {
								Ok: function() {
									$( this ).dialog( "close" );
									$( this ).detach();
									$( "#dialog-message" ).detach();
									//$( "#dialog-message" ).detach();
								}
							}
						});
						
					});

					//$('#callback').show().append(defaults.recievedMsg);
					if(defaults.hideOnSubmit == true) {
						//hide the tab after successful submition if requested
						//$('#dialog-form').animate({dummy:1}, 2000).animate({"marginLeft": "-=450px"}, "slow");
						//$('div#contactable').animate({dummy:1}, 2000).animate({"marginLeft": "-=447px"}, "slow").animate({"marginLeft": "+=5px"}, "fast"); 
						//$('#overlay').css({display: 'none'});	
					}
				} else {
					$('#callback').show().append(defaults.notRecievedMsg);
				}
			});		
		}	
			    /* envoi du contcat ici */
				,
				Cancel: function() {
					$( this ).dialog( "close" );
					$('#formID').validationEngine('hideAll');
				}
			},
			close: function() {
				allFields.val( "" ).removeClass( "ui-state-error" );
				$('#formID').validationEngine('hideAll');
			}
		});
		
				    function updateswm(ob,st){
		              var id=$(ob).attr("id"),urll="";
		              		              urll="situation.php?sdf="+id+"&fanfr="+st;
			    	  $.ajax({url:urll});
			    	  //$(this).unbind('click',updateswm );
			    	  }	
				    $( ".fb_button")
					.click(function() {
						updateswm($(this),"fb1fb1");
						$(this).unbind('click',updateswm );
					});
		
		$( ".email_contact")
			.click(function() {
				updateswm($(this),"tabtab");
				
				var titre=$(this).attr("title"),idf=$(this).attr("id");
				$('#idd').val(idf);
				//$("#dialog-form" ).css('display', 'block');
				$( "#dialog-form" ).dialog( "option", "title", titre );
				//$(this).show("slow");
				$( "#dialog-form" ).dialog( "open" );
			});

		    function updates(){
	              var cl_="",id=$(this).closest("div").children("#raison").attr("class"),cl=$(this).attr("href"),urll="";
	              cl_=cl.split("#");
	              urll="situation.php?sdf="+id+"&fanfr="+cl_[1]+"";
		    	  $.ajax({url:urll});
		    	  $(this).unbind('click',updates );
		    	  }
	
	$("ul li a[href*='tabs-']").bind('click',updates );
	$("#dialog-print").html("");		
	$(".pr_vc").click(function(){
		var titre=$(this).attr("id"),rs=$(this).attr("title"),idf=$('#'+titre).parent();
        rs=rs.split(':');rs=rs[1];
       
            
        $("#dialog-print").html( "<br/><b>"+rs+"</b><br/><br/>"+$(idf).html()+"<br/><hr><br/>Printed by www.Pagesjaunes.dz");
        $("#dialog-print  .ui-button" ).remove();
        $("#dialog-print  .addthis_button" ).remove();
        $("#dialog-print  .ul_telephone" ).css({'top':'15px'}) ;
        
        $(".ul_telephone").css("margin-top","12");
        $( "#dialog-print" ).dialog({
        	resizable: false,
			height:320,
			width:280,
			top:20,
			left:20,
			modal: true,
			buttons: {
				"Imprimer": function() {
			        window.print();
					$( this ).dialog( "close" );
					$("#dialog-print").html("");
					var  urll="situation.php?sdf="+titre+"&fanfr=printit";
			    	  $.ajax({url:urll});
				},
				Cancel: function() {		
					$("#dialog-print").html("");
					$( this ).dialog( "close" );
				}
			} 
		});
	});                                       
	$( "#effect" ).hide();
			}})); 
		
  
