
function encodeEmail(addy) {

	var regEmail = addy;
	var codeEmail = "";

	regLength = regEmail.length;
	for (i = 0; i < regLength; i++) {
		var charNum = "000";
		var curChar = regEmail.charAt(i)
		if (curChar == "A")
			charNum = "065";
		else if(curChar == "a")
			charNum = "097";
		else if(curChar == "B")
			charNum = "066";
		else if(curChar == "b")
				charNum = "098";
		else if(curChar == "C")
				charNum = "067";
		else if(curChar == "c")
				charNum = "099";
		else if(curChar == "D")
				charNum = "068";
		else if(curChar == "d")
				charNum = "100";
		else if(curChar == "E")
				charNum = "069";
		else if(curChar == "e")
				charNum = "101";
		else if(curChar == "F")
				charNum = "070";
		else if(curChar == "f")
				charNum = "102";
		else if(curChar == "G")
				charNum = "071";
		else if(curChar == "g")
				charNum = "103";
		else if(curChar == "H")
				charNum = "072";
		else if(curChar == "h")
				charNum = "104";
		else if(curChar == "I")
				charNum = "073";
		else if(curChar == "i")
				charNum = "105";
		else if(curChar == "J")
				charNum = "074";
		else if(curChar == "j")
				charNum = "106";
		else if(curChar == "K")
				charNum = "075";
		else if(curChar == "k")
				charNum = "107";
		else if(curChar == "L")
				charNum = "076";
		else if(curChar == "l")
				charNum = "108";
		else if(curChar == "M")
				charNum = "077";
		else if(curChar == "m")
				charNum = "109";
		else if(curChar == "N")
				charNum = "078";
		else if(curChar == "n")
				charNum = "110";
		else if(curChar == "O")
				charNum = "079";
		else if(curChar == "o")
				charNum = "111";
		else if(curChar == "P")
				charNum = "080";
		else if(curChar == "p")
				charNum = "112";
		else if(curChar == "Q")
				charNum = "081";
		else if(curChar == "q")
				charNum = "113";
		else if(curChar == "R")
				charNum = "082";
		else if(curChar == "r")
				charNum = "114";
		else if(curChar == "S")
				charNum = "083";
		else if(curChar == "s")
				charNum = "115";
		else if(curChar == "T")
				charNum = "084";
		else if(curChar == "t")
				charNum = "116";
		else if(curChar == "U")
				charNum = "085";
		else if(curChar == "u")
				charNum = "117";
		else if(curChar == "V")
				charNum = "086";
		else if(curChar == "v")
				charNum = "118";
		else if(curChar == "W")
				charNum = "087";
		else if(curChar == "w")
				charNum = "119";
		else if(curChar == "X")
				charNum = "088";
		else if(curChar == "x")
				charNum = "120";
		else if(curChar == "Y")
				charNum = "089";
		else if(curChar == "y")
				charNum = "121";
		else if(curChar == "Z")
				charNum = "090";
		else if(curChar == "z")
				charNum = "122";
		else if(curChar == "0")
				charNum = "048";
		else if(curChar == "1")
				charNum = "049";
		else if (curChar == "2")
				charNum = "050";
		else if(curChar == "3")
				charNum = "051";
		else if(curChar == "4")
				charNum = "052";
		else if(curChar == "5")
				charNum = "053";
		else if(curChar == "6")
				charNum = "054";
		else if(curChar == "7")
				charNum = "055";
		else if(curChar == "8")
				charNum = "056";
		else if(curChar == "9")
				charNum = "057";
		else if(curChar == "&")
				charNum = "038";
		else if(curChar == " ")
				charNum = "032";
		else if(curChar == "_")
				charNum = "095";
		else if(curChar == "-")
				charNum = "045";
		else if(curChar == "@")
				charNum = "064";
		else if(curChar == ".")
				charNum = "046";
		
		if (charNum == "000") {
				codeEmail += curChar
		}
		else {
				codeEmail += "&#" + charNum + ";"               
		}
	}
	return codeEmail;

}

var timeout    = 500;
var closetimer = 0;
var ddmenuitem = 0;
var ddparent=0;

function jsddm_open()
{  jsddm_canceltimer();
   jsddm_close();
   ddmenuitem = jQuery(this).find('ul').css('visibility', 'visible');
   }

function jsddm_close()
{  if(ddmenuitem) jQuery(ddmenuitem).css('visibility', 'hidden');
}

function jsddm_timer()
{  closetimer = window.setTimeout(jsddm_close, timeout);}

function jsddm_canceltimer()
{  if(closetimer)
   {  window.clearTimeout(closetimer);
	  closetimer = null;}}

document.onclick = jsddm_close;

jQuery(document).ready(function($){
	
	oldVal = '';
	$('#header_wrap #exp_cats li').hover(function(){
		$(this).addClass("active")
		if(!$(this).hasClass("cur_page")){
			$(this).find('a span').hide();
			$(this).find('small').show();
		}
	}, function(){
		if(!$(this).hasClass('cur_page'))
			$(this).removeClass("active");
		$(this).find('a span').show();
		$(this).find('small').hide();
	});
	$('#change_country').append('<br/><span id="stateStatus" style="font-size:18px; color: #aa0000"></span>');
	
	$('#change_country #zipcode').change(function(){
		checkState();
	});
	
	$('#change_country').submit(function(){

		return checkState();
	
	});
	
	checkState = function(){
	
		zipDigis = $('#change_country #zipcode').val().substr(0,2);
		
		if($('#region').val()=='38' && zipDigis!='65' && zipDigis!='64' && zipDigis!='63'){
			$('#change_country #stateStatus').html('Your zipcode and state do not match! Please select your state.');
			return false;
		}else{
			$('#change_country #stateStatus').html('');
			return true;
		} 
	}

	$('#menu-top-bar > li').bind('mouseover', jsddm_open);
	$('#menu-top-bar > li').bind('mouseout',  jsddm_timer);


	$('#nav .last-menu-item a, #login_close, .login').click(function(){
		return showLogin();
	});
	
	showLogin = function(){
		$('#login_cart').slideToggle('fast');
		window.scrollTo(0,0);
		return false;
	}
	
	$('#artifacts_left li').hover(function(){
		if(!$(this).hasClass("cur_artifact")) $(this).addClass("hover");
	}, function(){
		$(this).removeClass("hover");
	});
	
	$('#search_right').click(function(){
		$('#searchform').submit();
	});
	
	$('#searchform').submit(function(){
		$(this).attr('action', '/search/');
		return true;
	});
		
	
	$('.emailAddress').each(function(){
		var addy = $(this).html() + '@' + $(this).attr('rel');
		encEmail = encodeEmail(addy);
		$(this).attr('href', 'mailto:'+addy);
		$(this).html(encEmail);
	});
	
	$('.add_to_cart_wrap form').removeAttr('onsubmit').submit(function(){ return ggobAddProd(this)});
	
	$('.register_event').click(function(){
		$(this).hide();
		$(this).parent().next('div').slideDown();
	});
	
	$('select[name="variation[5]"]').change(function(){
		if($('select[name="variation[5]"] option:selected').text()=='10+ People'){
			$('#product__submit_button').hide();
			$('#group_call').show();
		}else{
			$('#product__submit_button').show();
			$('#group_call').hide();
		}
	});
	
	function ggobAddProd(obj){
		$('#login_cart').slideDown('fast');
		window.scrollTo(0,0);

		submitform(obj);
		return false;
	}
	
	
	$('#lang span.cur').click(function(){
		$('#lang').toggleClass('open');
		$('#lang ul').slideToggle();
	});
	
	$('#lang_link').fancybox({'type':'inline', 'padding':2, 'width':455, 'height':294 });
	
	$('#exp_cats li a').each(function(i,el){
		$(this).html('<span>'+$(this).html()+'</span>');
	});
	
	$('#exp_cats small').each(function(i, el){
		smallLen = $(el).html().length;
		if(smallLen<21)
			$(el).addClass('oneLine');
		else if(smallLen>39)
			$(el).addClass('threeLines');
			
		$(this).appendTo($(this).prev('a'));
	});
	
	$('.scrollTo').click(function(){
		if (getInternetExplorerVersion() < 8 && getInternetExplorerVersion() > -1)
			return true;
		$.scrollTo($(this).attr('href'), 500, {offset:-20});
		return false;
	});
	
});
/**
 * jQuery.query - Query String Modification and Creation for jQuery
 * Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
 * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
 * Date: 2009/8/13
 *
 * @author Blair Mitchelmore
 * @version 2.1.7
 *
 **/
new function(settings) { 
  // Various Settings
  var $separator = settings.separator || '&';
  var $spaces = settings.spaces === false ? false : true;
  var $suffix = settings.suffix === false ? '' : '[]';
  var $prefix = settings.prefix === false ? false : true;
  var $hash = $prefix ? settings.hash === true ? "#" : "?" : "";
  var $numbers = settings.numbers === false ? false : true;
  
  jQuery.query = new function() {
    var is = function(o, t) {
      return o != undefined && o !== null && (!!t ? o.constructor == t : true);
    };
    var parse = function(path) {
      var m, rx = /\[([^[]*)\]/g, match = /^([^[]+)(\[.*\])?$/.exec(path), base = match[1], tokens = [];
      while (m = rx.exec(match[2])) tokens.push(m[1]);
      return [base, tokens];
    };
    var set = function(target, tokens, value) {
      var o, token = tokens.shift();
      if (typeof target != 'object') target = null;
      if (token === "") {
        if (!target) target = [];
        if (is(target, Array)) {
          target.push(tokens.length == 0 ? value : set(null, tokens.slice(0), value));
        } else if (is(target, Object)) {
          var i = 0;
          while (target[i++] != null);
          target[--i] = tokens.length == 0 ? value : set(target[i], tokens.slice(0), value);
        } else {
          target = [];
          target.push(tokens.length == 0 ? value : set(null, tokens.slice(0), value));
        }
      } else if (token && token.match(/^\s*[0-9]+\s*$/)) {
        var index = parseInt(token, 10);
        if (!target) target = [];
        target[index] = tokens.length == 0 ? value : set(target[index], tokens.slice(0), value);
      } else if (token) {
        var index = token.replace(/^\s*|\s*$/g, "");
        if (!target) target = {};
        if (is(target, Array)) {
          var temp = {};
          for (var i = 0; i < target.length; ++i) {
            temp[i] = target[i];
          }
          target = temp;
        }
        target[index] = tokens.length == 0 ? value : set(target[index], tokens.slice(0), value);
      } else {
        return value;
      }
      return target;
    };
    
    var queryObject = function(a) {
      var self = this;
      self.keys = {};
      
      if (a.queryObject) {
        jQuery.each(a.get(), function(key, val) {
          self.SET(key, val);
        });
      } else {
        jQuery.each(arguments, function() {
          var q = "" + this;
          q = q.replace(/^[?#]/,''); // remove any leading ? || #
          q = q.replace(/[;&]$/,''); // remove any trailing & || ;
          if ($spaces) q = q.replace(/[+]/g,' '); // replace +'s with spaces
          
          jQuery.each(q.split(/[&;]/), function(){
            var key = decodeURIComponent(this.split('=')[0] || "");
            var val = decodeURIComponent(this.split('=')[1] || "");
            
            if (!key) return;
            
            if ($numbers) {
              if (/^[+-]?[0-9]+\.[0-9]*$/.test(val)) // simple float regex
                val = parseFloat(val);
              else if (/^[+-]?[0-9]+$/.test(val)) // simple int regex
                val = parseInt(val, 10);
            }
            
            val = (!val && val !== 0) ? true : val;
            
            if (val !== false && val !== true && typeof val != 'number')
              val = val;
            
            self.SET(key, val);
          });
        });
      }
      return self;
    };
    
    queryObject.prototype = {
      queryObject: true,
      has: function(key, type) {
        var value = this.get(key);
        return is(value, type);
      },
      GET: function(key) {
        if (!is(key)) return this.keys;
        var parsed = parse(key), base = parsed[0], tokens = parsed[1];
        var target = this.keys[base];
        while (target != null && tokens.length != 0) {
          target = target[tokens.shift()];
        }
        return typeof target == 'number' ? target : target || "";
      },
      get: function(key) {
        var target = this.GET(key);
        if (is(target, Object))
          return jQuery.extend(true, {}, target);
        else if (is(target, Array))
          return target.slice(0);
        return target;
      },
      SET: function(key, val) {
        var value = !is(val) ? null : val;
        var parsed = parse(key), base = parsed[0], tokens = parsed[1];
        var target = this.keys[base];
        this.keys[base] = set(target, tokens.slice(0), value);
        return this;
      },
      set: function(key, val) {
        return this.copy().SET(key, val);
      },
      REMOVE: function(key) {
        return this.SET(key, null).COMPACT();
      },
      remove: function(key) {
        return this.copy().REMOVE(key);
      },
      EMPTY: function() {
        var self = this;
        jQuery.each(self.keys, function(key, value) {
          delete self.keys[key];
        });
        return self;
      },
      load: function(url) {
        var hash = url.replace(/^.*?[#](.+?)(?:\?.+)?$/, "$1");
        var search = url.replace(/^.*?[?](.+?)(?:#.+)?$/, "$1");
        return new queryObject(url.length == search.length ? '' : search, url.length == hash.length ? '' : hash);
      },
      empty: function() {
        return this.copy().EMPTY();
      },
      copy: function() {
        return new queryObject(this);
      },
      COMPACT: function() {
        function build(orig) {
          var obj = typeof orig == "object" ? is(orig, Array) ? [] : {} : orig;
          if (typeof orig == 'object') {
            function add(o, key, value) {
              if (is(o, Array))
                o.push(value);
              else
                o[key] = value;
            }
            jQuery.each(orig, function(key, value) {
              if (!is(value)) return true;
              add(obj, key, build(value));
            });
          }
          return obj;
        }
        this.keys = build(this.keys);
        return this;
      },
      compact: function() {
        return this.copy().COMPACT();
      },
      toString: function() {
        var i = 0, queryString = [], chunks = [], self = this;
        var encode = function(str) {
          str = str + "";
          if ($spaces) str = str.replace(/ /g, "+");
          return encodeURIComponent(str);
        };
        var addFields = function(arr, key, value) {
          if (!is(value) || value === false) return;
          var o = [encode(key)];
          if (value !== true) {
            o.push("=");
            o.push(encode(value));
          }
          arr.push(o.join(""));
        };
        var build = function(obj, base) {
          var newKey = function(key) {
            return !base || base == "" ? [key].join("") : [base, "[", key, "]"].join("");
          };
          jQuery.each(obj, function(key, value) {
            if (typeof value == 'object') 
              build(value, newKey(key));
            else
              addFields(chunks, newKey(key), value);
          });
        };
        
        build(this.keys);
        
        if (chunks.length > 0) queryString.push($hash);
        queryString.push(chunks.join($separator));
        
        return queryString.join("");
      }
    };
    
    return new queryObject(location.search, location.hash);
  };
}(jQuery.query || {}); // Pass in jQuery.query as settings object

// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
function getInternetExplorerVersion()
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}


/**
 * jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright © 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 5/25/2009
 * @author Ariel Flesler
 * @version 1.4.2
 *
 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 */
;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);

/**
* SearchHighlight plugin for jQuery
*
* Thanks to Scott Yang <http://scott.yang.id.au/>
* for the original idea and some code
*
* @author Renato Formato <renatoformato@virgilio.it>
*
* @version 0.33
*
* Options
* - exact (string, default:"exact")
* "exact" : find and highlight the exact words.
* "whole" : find partial matches but highlight whole words
* "partial": find and highlight partial matches
*
* - style_name (string, default:'hilite')
* The class given to the span wrapping the matched words.
*
* - style_name_suffix (boolean, default:true)
* If true a different number is added to style_name for every different matched word.
*
* - debug_referrer (string, default:null)
* Set a referrer for debugging purpose.
*
* - engines (array of regex, default:null)
* Add a new search engine regex to highlight searches coming from new search engines.
* The first element is the regex to match the domain.
* The second element is the regex to match the query string.
* Ex: [/^http:\/\/my\.site\.net/i,/search=([^&]+)/i]
*
* - highlight (string, default:null)
* A jQuery selector or object to set the elements enabled for highlight.
* If null or no elements are found, all the document is enabled for highlight.
*
* - nohighlight (string, default:null)
* A jQuery selector or object to set the elements not enabled for highlight.
* This option has priority on highlight.
*
* - keys (string, default:null)
* Disable the analisys of the referrer and search for the words given as argument
*
*/
(function($){
jQuery.fn.SearchHighlight = function(options) {
var ref = options.debug_referrer || document.referrer;
if(!ref && options.keys==undefined) return this;
SearchHighlight.options = $.extend({exact:"exact",style_name:'hilite',style_name_suffix:true},options);
if(options.engines) SearchHighlight.engines.unshift(options.engines);
var q = options.keys!=undefined?options.keys.toLowerCase().split(/[\s,\+\.]+/):SearchHighlight.decodeURL(ref,SearchHighlight.engines);
if(q && q.join("")) {
SearchHighlight.buildReplaceTools(q);
return this.each(function(){
var el = this;
if(el==document) el = $("body")[0];
SearchHighlight.hiliteElement(el, q);
})
} else return this;
}
var SearchHighlight = {
options: {},
regex: [],
engines: [
[/^http:\/\/(www\.)?google\./i, /q=([^&]+)/i], // Google
[/^http:\/\/(www\.)?search\.yahoo\./i, /p=([^&]+)/i], // Yahoo
[/^http:\/\/(www\.)?search\.msn\./i, /q=([^&]+)/i], // MSN
[/^http:\/\/(www\.)?search\.live\./i, /query=([^&]+)/i], // MSN Live
[/^http:\/\/(www\.)?search\.aol\./i, /userQuery=([^&]+)/i], // AOL
[/^http:\/\/(www\.)?ask\.com/i, /q=([^&]+)/i], // Ask.com
[/^http:\/\/(www\.)?altavista\./i, /q=([^&]+)/i], // AltaVista
[/^http:\/\/(www\.)?feedster\./i, /q=([^&]+)/i], // Feedster
[/^http:\/\/(www\.)?search\.lycos\./i, /q=([^&]+)/i], // Lycos
[/^http:\/\/(www\.)?alltheweb\./i, /q=([^&]+)/i], // AllTheWeb
[/^http:\/\/(www\.)?technorati\.com/i, /([^\?\/]+)(?:\?.*)$/i], // Technorati
],
subs: {},
decodeURL: function(URL,reg) {
URL = decodeURIComponent(URL);
var query = null;
$.each(reg,function(i,n){
if(n[0].test(URL)) {
var match = URL.match(n[1]);
if(match) {
query = match[1].toLowerCase();
return false;
}
}
})
if (query) {
query = query.replace(/(\'|")/, '\$1');
query = query.split(/[\s,\+\.]+/);
}
return query;
},
regexAccent : [
[/[\xC0-\xC5\u0100-\u0105]/ig,'a'],
[/[\xC7\u0106-\u010D]/ig,'c'],
[/[\xC8-\xCB]/ig,'e'],
[/[\xCC-\xCF]/ig,'i'],
[/\xD1/ig,'n'],
[/[\xD2-\xD6\xD8]/ig,'o'],
[/[\u015A-\u0161]/ig,'s'],
[/[\u0162-\u0167]/ig,'t'],
[/[\xD9-\xDC]/ig,'u'],
[/\xFF/ig,'y'],
[/[\x91\x92\u2018\u2019]/ig,'\'']
],
matchAccent : /[\x91\x92\xC0-\xC5\xC7-\xCF\xD1-\xD6\xD8-\xDC\xFF\u0100-\u010D\u015A-\u0167\u2018\u2019]/ig,
replaceAccent: function(q) {
SearchHighlight.matchAccent.lastIndex = 0;
if(SearchHighlight.matchAccent.test(q)) {
for(var i=0,l=SearchHighlight.regexAccent.length;i<l;i++)
q = q.replace(SearchHighlight.regexAccent[i][0],SearchHighlight.regexAccent[i][1]);
}
return q;
},
escapeRegEx : /((?:\\{2})*)([[\]{}*?|])/g, //the special chars . and + are already gone at this point because they are considered split chars
buildReplaceTools : function(query) {
var re = [], regex;
$.each(query,function(i,n){
if(n = SearchHighlight.replaceAccent(n).replace(SearchHighlight.escapeRegEx,"$1\\$2"))
re.push(n);
});
regex = re.join("|");
switch(SearchHighlight.options.exact) {
case "exact":
regex = '\\b(?:'+regex+')\\b';
break;
case "whole":
regex = '\\b\\w*('+regex+')\\w*\\b';
break;
}
SearchHighlight.regex = new RegExp(regex, "gi");
$.each(re,function(i,n){
SearchHighlight.subs[n] = SearchHighlight.options.style_name+
(SearchHighlight.options.style_name_suffix?i+1:'');
});
},
nosearch: /s(?:cript|tyle)|textarea/i,
hiliteElement: function(el, query) {
var opt = SearchHighlight.options, elHighlight, noHighlight;
elHighlight = opt.highlight?$(opt.highlight):$("body");
if(!elHighlight.length) elHighlight = $("body");
noHighlight = opt.nohighlight?$(opt.nohighlight):$([]);
elHighlight.each(function(){
SearchHighlight.hiliteTree(this,query,noHighlight);
});
},
hiliteTree : function(el,query,noHighlight) {
if(noHighlight.index(el)!=-1) return;
var matchIndex = SearchHighlight.options.exact=="whole"?1:0;
for(var startIndex=0,endIndex=el.childNodes.length;startIndex<endIndex;startIndex++) {
var item = el.childNodes[startIndex];
if ( item.nodeType != 8 ) {//comment node
//text node
if(item.nodeType==3) {
var text = item.data, textNoAcc = SearchHighlight.replaceAccent(text);
var newtext="",match,index=0;
SearchHighlight.regex.lastIndex = 0;
while(match = SearchHighlight.regex.exec(textNoAcc)) {
newtext += text.substr(index,match.index-index)+'<span class="'+
SearchHighlight.subs[match[matchIndex].toLowerCase()]+'">'+text.substr(match.index,match[0].length)+"</span>";
index = match.index+match[0].length;
}
if(newtext) {
//add the last part of the text
newtext += text.substring(index);
var repl = $.merge([],$("<span>"+newtext+"</span>")[0].childNodes);
endIndex += repl.length-1;
startIndex += repl.length-1;
$(item).before(repl).remove();
}
} else {
if(item.nodeType==1 && item.nodeName.search(SearchHighlight.nosearch)==-1)
SearchHighlight.hiliteTree(item,query,noHighlight);
}
}
}
}
};
})(jQuery)

