
function facebookShare(what) {
	
	
	var d=document,f='http://www.facebook.com/share',l=d.location,e=encodeURIComponent;
	if(what) {
	var p='.php?src=bm&v=4&i=1276129013&u='+e(what)+'&t='+e(d.title);
	} else {
	var p='.php?src=bm&v=4&i=1276129013&u='+e(l.href)+'&t='+e(d.title);	
	}
	1;
	

	try{if (!/^(.*\.)?facebook\.[^.]*$/.test(l.host))throw(0);
	share_internal_bookmarklet(p)}
	catch(z) {a=function() {if (!window.open(f+'r'+p,'sharer','toolbar=0,status=0,resizable=1,width=626,height=436'))l.href=f+p};
	if (/Firefox/.test(navigator.userAgent))setTimeout(a,0);else{a()}}void(0)
}


function pushbut(dat) {

		jQuery('#fav_'+dat).removeClass('notpushed');
		jQuery('#fav_'+dat).addClass('pushed');
		jQuery('#fav_'+dat).children().children('.ajouter').html('Ajout&eacute;');
		jQuery.post('/wp-content/plugins/another-wordpress-classifieds-plugin/easyfav.php?action=fav', { fav: dat }, function(val) {		
		});
		jQuery('#fav_'+dat).attr('onclick', 'unpushbut('+dat+')');
	
}

function unpushbut(dat) {
		jQuery('#fav_'+dat).removeClass('pushed');
		jQuery('#fav_'+dat).addClass('notpushed');
		jQuery('#fav_'+dat).children().children('.ajouter').html('Ajouter');
		jQuery.post('/wp-content/plugins/another-wordpress-classifieds-plugin/easyfav.php?action=unfav', { fav: dat }, function(val) {
			});
		jQuery('#fav_'+dat).attr('onclick', 'pushbut('+dat+')');
	
}

function spushbut(dat) {

		jQuery('#sfav_'+dat).removeClass('snotpushed');
		jQuery('#sfav_'+dat).addClass('spushed');
		jQuery.post('/wp-content/plugins/another-wordpress-classifieds-plugin/easyfav.php?action=fav', { fav: dat }, function(val) {		});
		jQuery('#sfav_'+dat).attr('onclick', 'sunpushbut('+dat+')');
	
}

function sunpushbut(dat) {

		jQuery('#sfav_'+dat).removeClass('spushed');
		jQuery('#sfav_'+dat).addClass('snotpushed');
		jQuery.post('/wp-content/plugins/another-wordpress-classifieds-plugin/easyfav.php?action=unfav', { fav: dat }, function(val) {		});
		jQuery('#sfav_'+dat).attr('onclick', 'spushbut('+dat+')');
	
}



jQuery(document).ready(function() {

//	if(screen.width < 1200) { alert('Votre résolution est trop petite, pesez sur Control et tournez la roulette de votre souris, ou cliquez sur + ou - pour rapetisser le site.'); }


			jQuery('#send').click(function() {
				jQuery.post("/mailer.php", jQuery("#mailform").serialize(), function(dat) {
					jQuery('#mailwidget').html(dat);
				});
			});
	
		
/*	
	jQuery('.notpushed').click(function() {
		var fav = jQuery(this).attr('rel');
		jQuery(this).removeClass('notpushed');
		jQuery(this).addClass('pushed');
		jQuery(this).children().children('.ajouter').html('Ajout&eacute;');
		jQuery.post('/wp-content/plugins/another-wordpress-classifieds-plugin/easyfav.php?action=fav', { fav: fav }, function(dat) {
		});
		
		jQuery('.pushed').click(function() {
			var fav = jQuery(this).attr('rel');
			jQuery(this).addClass('notpushed');
			jQuery(this).removeClass('pushed');
			jQuery(this).children().children('.ajouter').html('Ajouter');
			jQuery.post('/wp-content/plugins/another-wordpress-classifieds-plugin/easyfav.php?action=unfav', { fav: fav }, function(dat) {			});
		});
			
	});
	
	jQuery('.pushed').click(function() {
		var fav = jQuery(this).attr('rel');
		jQuery(this).addClass('notpushed');
		jQuery(this).removeClass('pushed');
		jQuery(this).children().children('.ajouter').html('Ajouter');
		jQuery.post('/wp-content/plugins/another-wordpress-classifieds-plugin/easyfav.php?action=unfav', { fav: fav }, function(dat) {		});

		jQuery('.notpushed').click(function() {
			var fav = jQuery(this).attr('rel');
			jQuery(this).removeClass('notpushed');
			jQuery(this).addClass('pushed');
			jQuery(this).children().children('.ajouter').html('Ajout&eacute;');
			jQuery.post('/wp-content/plugins/another-wordpress-classifieds-plugin/easyfav.php?action=fav', { fav: fav }, function(dat) {
			});
		});

	});
*/


	if(jQuery.browser.msie) {
		
		jQuery('#othervedette').cycle({ 
			fx: 'scrollLeft',
			slideResize: false,
			timeout: 10000,
			prev: '#slideprev',
			next: '#slidenext'			
		});

	} else {

		jQuery('#othervedette').cycle({ 
			fx: 'scrollLeft',
			slideResize: true,
			timeout: 10000,
			prev: '#slideprev',
			next: '#slidenext'
			
		});
	

	}

  

	jQuery('.homeannonce').css({display: 'block'})
/*
	jQuery('#sidebar ul#latestads').cycle({ 

		fx: 'scrollDown',
		timeout: 10000

	});
	*/

	var tabContainers = jQuery('div.tabs > div');

	jQuery('div.tabs ul.tabNavigation a').click(function () {
		tabContainers.hide().filter(this.hash).show();

		jQuery('div.tabs ul.tabNavigation a').removeClass('selected');
		jQuery(this).addClass('selected');

		return false;
	}).filter(':first').click();
	
	
     jQuery(".cornerpeel").hover(function() { //Hover Over
 		 jQuery('.cornerpeel .message').css('backgroundImage', 'url(/wp-content/themes/jevends3/images/vraiepub.png)');
         jQuery(".cornerpeel img , .message").stop()
	 .animate({ //Expand the Message and the Hover Image
	    width: '200px',
	    height: '200px'
	 }, 600);

      } , function() {
 		 jQuery('.cornerpeel .message').css('backgroundImage', 'url(/wp-content/themes/jevends3/images/vraiepub1.png)');
         jQuery(".cornerpeel img").stop() //Hover Out Go Back To Original
	 .animate({
	    width: '80px',
	    height: '80px'
	 }, 200);
	 jQuery(".message").stop() //Hover Out Go Back To Original
	 .animate({
            width: '80px',
	    height: '80px'
	 }, 180); //This should be a tad faster than the image because IE is known to glitch
      });
  
/*	 jQuery("select.select, input:checkbox, input:radio, input:file").uniform();*/
 
	  jQuery('#shorturl').click(function() {
		 var txt = jQuery('#shorturl').val();
		 jQuery('#shorturl').select();
		 jQuery.copy(txt) ;
	  });


	geocode();
	
	jQuery('#etape1 input').keyup(function() {
		valideStepOne();
	});
	
	jQuery('#etape1 input').focusout(function() {
		valideStepOne();
	});
	
	jQuery('#etape1 input').click(function() {
		valideStepOne();
	});


//var cc = jQuery('#etape1 #ville').val();
//alert('cc')
	jQuery('#etape1 #ville').change(function() {
//		alert(cc);
		geocode();

	});
	
	jQuery('#add').keyup(function() {
		geocode();
		jQuery('#dansrue input').attr('checked', false);

	});

	jQuery('#ville').keyup(function() {
		geocode();
		jQuery('#dansrue input').attr('checked', false);

	});
	
	jQuery('#pays').keyup(function() {
		geocode();
		jQuery('#dansrue input').attr('checked', false);

	});

	jQuery('#province').keyup(function() {
		geocode();
		jQuery('#dansrue input').attr('checked', false);
	});

	jQuery('#pays, #province, #ville, #add, #adcontact_name').keyup(function(event) {
		var textBox = event.target;
		var start = textBox.selectionStart;
		var end = textBox.selectionEnd;
		textBox.value = textBox.value.charAt(0).toUpperCase() + textBox.value.slice(1);
		textBox.setSelectionRange(start, end);
	});


	jQuery('#step1next').click(function() {
		var form = jQuery('#etape1').serialize();
		var deja = jQuery('#deja').val();

		jQuery('#etape').html('');	
		
		jQuery.post('/wp-content/plugins/another-wordpress-classifieds-plugin/easyinsert.php?deja='+deja+'&step=1', form, function(data) {
			jQuery('#deja').val('1');
			jQuery('#step2').load('/annonces/mettre-une-annonce/?etape=2', function() {
				jQuery('#step1').hide();
				jQuery('#step2').show();
				jQuery('#currentstep').val(2);
				jQuery('#currentpage').val(2);
				jQuery('#etape').html('&Eacute;tape 2/5');				
			});
			
		});
	});
	

	jQuery('#streetview').click(function() {
		streetView();	
	});

	jQuery('#mapview').click(function() {
		geocode();	
	});


	

});


(function($) {

  var cache = [];
  // Arguments are image paths relative to the current page.
  $.preLoadImages = function() {
    var args_len = arguments.length;
    for (var i = args_len; i--;) {
      var cacheImage = document.createElement('img');
      cacheImage.src = arguments[i];
      cache.push(cacheImage);
    }
  }

})(jQuery)

function godave() {
	jQuery.get('http://jevends.net/pub-random/', function(data) {
	var rand_no = randomXToY(1,4);
	  jQuery('#topad_'+rand_no).html(data);
	});
}


//function to get random number upto m
function randomXToY(minVal,maxVal,floatVal)
{
  var randVal = minVal+(Math.random()*(maxVal-minVal));
  return typeof floatVal=='undefined'?Math.round(randVal):randVal.toFixed(floatVal);
}

var c=0;
var t;
var timer_is_on=0;

function timedCount()
{
godave();
t=setTimeout("timedCount()",5000);
}

function doTimer()
{
if (!timer_is_on)
  {
  timer_is_on=1;
  timedCount();
  }
}


 (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
  
  

function isValidEmailAddress(emailAddress) {
var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
return pattern.test(emailAddress);
};

function valideStepOne() {

	var error;
	if(jQuery('#adcontact_name').val() == '' || jQuery('#adcontact_email').val() == '' || !isValidEmailAddress(jQuery('#adcontact_email').val())) {
		error = 1;
	} else {
		error = 0;	
	}

	
	if(error == 0) {
		jQuery('#step1next').show();	
	} else {
		jQuery('#step1next').hide();	
	}
	
}




function autre() {
	jQuery('#villeselect').html('<input onkeyup="geocode();" type="text" id="ville" name="adcontact_city"/>');
	jQuery('#autre').remove();
}




jQuery("#loading").ajaxStart(function(){
   jQuery(this).show();
 });

jQuery("#loading").ajaxStop(function(){
   jQuery(this).hide();
 }); 



function prev() {

	var wat = jQuery('#currentpage').val();	


	if(wat > 1) {
		wat = parseInt(wat) - 1;
		jQuery('.step').hide();
		jQuery('#step'+wat).show();
		jQuery('#currentpage').val(wat);
	}

	var cs = jQuery('#currentstep').val();

	if(cs > wat) {
		jQuery('#nextcache').hide();	

	} else {

		jQuery('#nextcache').show();			

	}

	

	if(wat == 1) {

		jQuery('#prevcache').show();	

	}

				

}


/*
function next() {
	var wat = jQuery('#currentpage').val();	
	
	if(wat < 5) {
		wat = parseInt(wat) + 1;
		jQuery('.step').hide();
		jQuery('#step'+wat).show();
		jQuery('#currentpage').val(wat);
	}
	
	var cs = jQuery('#currentstep').val();
	
	if(cs == wat) {
		jQuery('#nextcache').show();			
	} else {
		jQuery('#nextcache').hide();	  

}

	if(cs >= wat) {
		jQuery('#prevcache').hide();	  			
	}
}
*/


function catC(wat) {
	jQuery('#etape').html('');								
	jQuery('#step3').load('/annonces/mettre-une-annonce/?etape=3&cat='+wat, function() {
		jQuery('#etape').html('&Eacute;tape 3/5');								
		jQuery('#pcategorie').val(wat);
		jQuery('#step3').slideDown();	
		jQuery('#currentstep').val(3);
		jQuery('#currentpage').val(3);

	});

	
}





function clickclear(thisfield, defaulttext) {
	if (thisfield.value == defaulttext) {
		thisfield.value = "";
	}
}

function clickrecall(thisfield, defaulttext) {
	if (thisfield.value == "") {
		thisfield.value = defaulttext;
	}

}



function initialize() {

	if(document.getElementByID("map")) {
			
			
		var map;
		// Create new map object
		map = new GMap2(document.getElementById("map"));
	
		// Retrieve the latitude and longitude
		point = new GLatLng(45.545447,
						  -73.639076);
	
		// Center the map on this point
		map.setCenter(point, 5);
		map.addControl(new GSmallMapControl());
	
	}
}



function geocode() {
	
	if(document.getElementById("map")) {

    var geocoder;
    var address = jQuery('#add').val();
    var ville = jQuery('#ville').val();
    var province = jQuery('#province').val();
    var pays = jQuery('#pays').val();

    var map;

    // Create new map object
    map = new GMap2(document.getElementById("map"));

    // Create new geocoding object
    geocoder = new GClientGeocoder();

//	map.addControl(new GSmallMapControl());
//	map.addControl(new GMapTypeControl());

    // Retrieve location information, pass it to addToMap()
    geocoder.getLocations(address+','+ville+','+province+','+pays, fillForm);

	}
	
	
   function fillForm(response)
   {
        // Retrieve the object
        place = response.Placemark[0];

        jQuery('#latitude').val(place.Point.coordinates[1]);
        jQuery('#longitude').val(place.Point.coordinates[0]);

        // Retrieve the latitude and longitude
        point = new GLatLng(place.Point.coordinates[1],
                          place.Point.coordinates[0]);

        // Center the map on this point
        map.setCenter(point, 15);

        // Create a marker
        marker = new GMarker(point);

        

        // Add the marker to map
        map.addOverlay(marker);

   }

}

function fill(province, pays) {
    jQuery('#province').val(province);
    jQuery('#pays').val(pays);

}


function streetView() {

    var lat = jQuery('#latitude').val();
    var lng = jQuery('#longitude').val();

    var resto = new GLatLng(lat,lng);

    var panoramaOptions = {
      features: {
        streetView: true
      },
      latlng:resto
    };

    var myPano = new GStreetviewPanorama(document.getElementById("map"), panoramaOptions);

    GEvent.addListener(myPano, "yawchanged", yawChange);  
    GEvent.addListener(myPano, "pitchchanged", pitchChange);  
    GEvent.addListener(myPano, "zoomchanged", zoomChange);  
    GEvent.addListener(myPano, "initialized", handleChange);  
}


function handleChange(data) {
    jQuery('#latitude').val(data['lat']);
    jQuery('#longitude').val(data['lng']);
}

function zoomChange(data) {
    jQuery('#zoom').val(data);
}

function yawChange(data) {
    jQuery('#yaw').val(data);
}

function pitchChange(data) {
    jQuery('#pitch').val(data);
}


/*
 *
 * Copyright (c) 2006-2011 Sam Collett (http://www.texotela.co.uk)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 * 
 * Version 1.3
 * Demo: http://www.texotela.co.uk/code/jquery/numeric/
 *
 */
(function($) {
/*
 * Allows only valid characters to be entered into input boxes.
 * Note: fixes value when pasting via Ctrl+V, but not when using the mouse to paste
  *      side-effect: Ctrl+A does not work, though you can still use the mouse to select (or double-click to select all)
 *
 * @name     numeric
 * @param    config      { decimal : "." , negative : true }
 * @param    callback     A function that runs if the number is not valid (fires onblur)
 * @author   Sam Collett (http://www.texotela.co.uk)
 * @example  $(".numeric").numeric();
 * @example  $(".numeric").numeric(","); // use , as separater
 * @example  $(".numeric").numeric({ decimal : "," }); // use , as separator
 * @example  $(".numeric").numeric({ negative : false }); // do not allow negative values
 * @example  $(".numeric").numeric(null, callback); // use default values, pass on the 'callback' function
 *
 */
$.fn.numeric = function(config, callback)
{
	if(typeof config === 'boolean')
	{
		config = { decimal: config };
	}
	config = config || {};
	// if config.negative undefined, set to true (default is to allow negative numbers)
	if(typeof config.negative == "undefined") config.negative = true;
	// set decimal point
	var decimal = (config.decimal === false) ? "" : config.decimal || ".";
	// allow negatives
	var negative = (config.negative === true) ? true : false;
	// callback function
	var callback = typeof callback == "function" ? callback : function(){};
	// set data and methods
	return this.data("numeric.decimal", decimal).data("numeric.negative", negative).data("numeric.callback", callback).keypress($.fn.numeric.keypress).keyup($.fn.numeric.keyup).blur($.fn.numeric.blur);
}

$.fn.numeric.keypress = function(e)
{
	// get decimal character and determine if negatives are allowed
	var decimal = $.data(this, "numeric.decimal");
	var negative = $.data(this, "numeric.negative");
	// get the key that was pressed
	var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
	// allow enter/return key (only when in an input box)
	if(key == 13 && this.nodeName.toLowerCase() == "input")
	{
		return true;
	}
	else if(key == 13)
	{
		return false;
	}
	var allow = false;
	// allow Ctrl+A
	if((e.ctrlKey && key == 97 /* firefox */) || (e.ctrlKey && key == 65) /* opera */) return true;
	// allow Ctrl+X (cut)
	if((e.ctrlKey && key == 120 /* firefox */) || (e.ctrlKey && key == 88) /* opera */) return true;
	// allow Ctrl+C (copy)
	if((e.ctrlKey && key == 99 /* firefox */) || (e.ctrlKey && key == 67) /* opera */) return true;
	// allow Ctrl+Z (undo)
	if((e.ctrlKey && key == 122 /* firefox */) || (e.ctrlKey && key == 90) /* opera */) return true;
	// allow or deny Ctrl+V (paste), Shift+Ins
	if((e.ctrlKey && key == 118 /* firefox */) || (e.ctrlKey && key == 86) /* opera */
	|| (e.shiftKey && key == 45)) return true;
	// if a number was not pressed
	if(key < 48 || key > 57)
	{
		/* '-' only allowed at start and if negative numbers allowed */
		if(this.value.indexOf("-") != 0 && negative && key == 45 && (this.value.length == 0 || ($.fn.getSelectionStart(this)) == 0)) return true;
		/* only one decimal separator allowed */
		if(decimal && key == decimal.charCodeAt(0) && this.value.indexOf(decimal) != -1)
		{
			allow = false;
		}
		// check for other keys that have special purposes
		if(
			key != 8 /* backspace */ &&
			key != 9 /* tab */ &&
			key != 13 /* enter */ &&
			key != 35 /* end */ &&
			key != 36 /* home */ &&
			key != 37 /* left */ &&
			key != 39 /* right */ &&
			key != 46 /* del */
		)
		{
			allow = false;
		}
		else
		{
			// for detecting special keys (listed above)
			// IE does not support 'charCode' and ignores them in keypress anyway
			if(typeof e.charCode != "undefined")
			{
				// special keys have 'keyCode' and 'which' the same (e.g. backspace)
				if(e.keyCode == e.which && e.which != 0)
				{
					allow = true;
					// . and delete share the same code, don't allow . (will be set to true later if it is the decimal point)
					if(e.which == 46) allow = false;
				}
				// or keyCode != 0 and 'charCode'/'which' = 0
				else if(e.keyCode != 0 && e.charCode == 0 && e.which == 0)
				{
					allow = true;
				}
			}
		}
		// if key pressed is the decimal and it is not already in the field
		if(decimal && key == decimal.charCodeAt(0))
		{
			if(this.value.indexOf(decimal) == -1)
			{
				allow = true;
			}
			else
			{
				allow = false;
			}
		}
	}
	else
	{
		allow = true;
	}
	return allow;
}

$.fn.numeric.keyup = function(e)
{
	var val = this.value;
	if(val.length > 0)
	{
		// get carat (cursor) position
		var carat = $.fn.getSelectionStart(this);
		// get decimal character and determine if negatives are allowed
		var decimal = $.data(this, "numeric.decimal");
		var negative = $.data(this, "numeric.negative");
		
		// prepend a 0 if necessary
		if(decimal != "")
		{
			// find decimal point
			var dot = val.indexOf(decimal);
			// if dot at start, add 0 before
			if(dot == 0)
			{
				this.value = "0" + val;
			}
			// if dot at position 1, check if there is a - symbol before it
			if(dot == 1 && val.charAt(0) == "-")
			{
				this.value = "-0" + val.substring(1);
			}
			val = this.value;
		}
		
		// if pasted in, only allow the following characters
		var validChars = [0,1,2,3,4,5,6,7,8,9,'-',decimal];
		// get length of the value (to loop through)
		var length = val.length;
		// loop backwards (to prevent going out of bounds)
		for(var i = length - 1; i >= 0; i--)
		{
			var ch = val.charAt(i);
			// remove '-' if it is in the wrong place
			if(i != 0 && ch == "-")
			{
				val = val.substring(0, i) + val.substring(i + 1);
			}
			// remove character if it is at the start, a '-' and negatives aren't allowed
			else if(i == 0 && !negative && ch == "-")
			{
				val = val.substring(1);
			}
			var validChar = false;
			// loop through validChars
			for(var j = 0; j < validChars.length; j++)
			{
				// if it is valid, break out the loop
				if(ch == validChars[j])
				{
					validChar = true;
					break;
				}
			}
			// if not a valid character, or a space, remove
			if(!validChar || ch == " ")
			{
				val = val.substring(0, i) + val.substring(i + 1);
			}
		}
		// remove extra decimal characters
		var firstDecimal = val.indexOf(decimal);
		if(firstDecimal > 0)
		{
			for(var i = length - 1; i > firstDecimal; i--)
			{
				var ch = val.charAt(i);
				// remove decimal character
				if(ch == decimal)
				{
					val = val.substring(0, i) + val.substring(i + 1);
				}
			}
		}
		// set the value and prevent the cursor moving to the end
		this.value = val;
		$.fn.setSelection(this, carat);
	}
}

$.fn.numeric.blur = function()
{
	var decimal = $.data(this, "numeric.decimal");
	var callback = $.data(this, "numeric.callback");
	var val = this.value;
	if(val != "")
	{
		var re = new RegExp("^\\d+$|\\d*" + decimal + "\\d+");
		if(!re.exec(val))
		{
			callback.apply(this);
		}
	}
}

$.fn.removeNumeric = function()
{
	return this.data("numeric.decimal", null).data("numeric.negative", null).data("numeric.callback", null).unbind("keypress", $.fn.numeric.keypress).unbind("blur", $.fn.numeric.blur);
}

// Based on code from http://javascript.nwbox.com/cursor_position/ (Diego Perini <dperini@nwbox.com>)
$.fn.getSelectionStart = function(o)
{
	if (o.createTextRange)
	{
		var r = document.selection.createRange().duplicate();
		r.moveEnd('character', o.value.length);
		if (r.text == '') return o.value.length;
		return o.value.lastIndexOf(r.text);
	} else return o.selectionStart;
}

// set the selection, o is the object (input), p is the position ([start, end] or just start)
$.fn.setSelection = function(o, p)
{
	// if p is number, start and end are the same
	if(typeof p == "number") p = [p, p];
	// only set if p is an array of length 2
	if(p && p.constructor == Array && p.length == 2)
	{
		if (o.createTextRange)
		{
			var r = o.createTextRange();
			r.collapse(true);
			r.moveStart('character', p[0]);
			r.moveEnd('character', p[1]);
			r.select();
		}
		else if(o.setSelectionRange)
		{
			o.focus();
			o.setSelectionRange(p[0], p[1]);
		}
	}
}

})(jQuery);
