/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
*/

// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	},
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	},
	easeInOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});

/*
	jQuery Coda-Slider v2.0 - http://www.ndoherty.biz/coda-slider
	Copyright (c) 2009 Niall Doherty
	This plugin available for use in all personal or commercial projects under both MIT and GPL licenses.
*/

$(function(){
	// Remove the coda-slider-no-js class from the body
	$("body").removeClass("coda-slider-no-js");
	// Preloader
	$(".coda-slider").children('.panel').hide().end().prepend('<p class="loading">Loading...<br /><img src="/lib/yhst-66763527056125/ajax-loader.gif" alt="loading..." /></p>');
});

var sliderCount = 1;

$.fn.codaSlider = function(settings) {

	settings = $.extend({
		autoHeight: true,
		autoHeightEaseDuration: 1000,
		autoHeightEaseFunction: "easeInOutExpo",
		autoSlide: false,
		autoSlideInterval: 7000,
		autoSlideStopWhenClicked: true,
		crossLinking: true,
		dynamicArrows: true,
		dynamicArrowLeftText: "&#171; left",
		dynamicArrowRightText: "right &#187;",
		dynamicTabs: true,
		dynamicTabsAlign: "center",
		dynamicTabsPosition: "top",
		externalTriggerSelector: "a.xtrig",
		firstPanelToLoad: 1,
		panelTitleSelector: "span.title",
		slideEaseDuration: 1000,
		slideEaseFunction: "easeInOutExpo"
	}, settings);
	
	return this.each(function(){
		
		// Uncomment the line below to test your preloader
		// alert("Testing preloader");
		
		var slider = $(this);
		
		// If we need arrows
		/*
		if (settings.dynamicArrows) {
			slider.parent().addClass("arrows");
			slider.before('<div class="coda-nav-left" id="coda-nav-left-' + sliderCount + '"><a href="#">' + settings.dynamicArrowLeftText + '</a></div>');
			slider.after('<div class="coda-nav-right" id="coda-nav-right-' + sliderCount + '"><a href="#">' + settings.dynamicArrowRightText + '</a></div>');
		};
		*/
		var panelWidth = slider.find(".panel").width();
		var panelCount = slider.find(".panel").size();
		var panelContainerWidth = panelWidth*panelCount;
		var navClicks = 0; // Used if autoSlideStopWhenClicked = true
		
		// Surround the collection of panel divs with a container div (wide enough for all panels to be lined up end-to-end)
		$('.panel', slider).wrapAll('<div class="panel-container"></div>');
		// Specify the width of the container div (wide enough for all panels to be lined up end-to-end)
		$(".panel-container", slider).css({ width: panelContainerWidth });
		
		// Specify the current panel.
		// If the loaded URL has a hash (cross-linking), we're going to use that hash to give the slider a specific starting position...
		if (settings.crossLinking && location.hash && parseInt(location.hash.slice(1)) <= panelCount) {
			var currentPanel = parseInt(location.hash.slice(1));
			var offset = - (panelWidth*(currentPanel - 1));
			$('.panel-container', slider).css({ marginLeft: offset });
		// If that's not the case, check to see if we're supposed to load a panel other than Panel 1 initially...
		} else if (settings.firstPanelToLoad != 1 && settings.firstPanelToLoad <= panelCount) { 
			var currentPanel = settings.firstPanelToLoad;
			var offset = - (panelWidth*(currentPanel - 1));
			$('.panel-container', slider).css({ marginLeft: offset });
		// Otherwise, we'll just set the current panel to 1...
		} else { 
			var currentPanel = 1;
		};
		/*
		// Left arrow click
		$("#coda-nav-left-" + sliderCount + " a").click(function(){
			navClicks++;
			if (currentPanel == 1) {
				offset = - (panelWidth*(panelCount - 1));
				alterPanelHeight(panelCount - 1);
				currentPanel = panelCount;
				slider.siblings('.coda-nav').find('a.current').removeClass('current').parents('ul').find('li:last a').addClass('current');
			} else {
				currentPanel -= 1;
				alterPanelHeight(currentPanel - 1);
				offset = - (panelWidth*(currentPanel - 1));
				slider.siblings('.coda-nav').find('a.current').removeClass('current').parent().prev().find('a').addClass('current');
			};
			$('.panel-container', slider).animate({ marginLeft: offset }, settings.slideEaseDuration, settings.slideEaseFunction);
			if (settings.crossLinking) { location.hash = currentPanel }; // Change the URL hash (cross-linking)
			return false;
		});
			
		// Right arrow click
		$('#coda-nav-right-' + sliderCount + ' a').click(function(){
			navClicks++;
			if (currentPanel == panelCount) {
				offset = 0;
				currentPanel = 1;
				alterPanelHeight(0);
				slider.siblings('.coda-nav').find('a.current').removeClass('current').parents('ul').find('a:eq(0)').addClass('current');
			} else {
				offset = - (panelWidth*currentPanel);
				alterPanelHeight(currentPanel);
				currentPanel += 1;
				slider.siblings('.coda-nav').find('a.current').removeClass('current').parent().next().find('a').addClass('current');
			};
			$('.panel-container', slider).animate({ marginLeft: offset }, settings.slideEaseDuration, settings.slideEaseFunction);
			if (settings.crossLinking) { location.hash = currentPanel }; // Change the URL hash (cross-linking)
			return false;
		});
		*/	
		// If we need a dynamic menu
		if (settings.dynamicTabs) {
			var dynamicTabs = '<div class="coda-nav" id="coda-nav-' + sliderCount + '"><ul></ul></div>';
			switch (settings.dynamicTabsPosition) {
				case "bottom":
					slider.parent().append(dynamicTabs);
					break;
				default:
					slider.parent().prepend(dynamicTabs);
					break;
			};
			ul = $('#coda-nav-' + sliderCount + ' ul');
			// Create the nav items
			$('.panel', slider).each(function(n) {
				ul.append('<li class="tab' + (n+1) + '"><a href="#' + (n+1) + '">' + $(this).find(settings.panelTitleSelector).text() + '</a></li>');												
			});
			//navContainerWidth = slider.width() + slider.siblings('.coda-nav-left').width() + slider.siblings('.coda-nav-right').width();
			navContainerWidth = slider.width(); 
			ul.parent().css({ width: navContainerWidth });
			switch (settings.dynamicTabsAlign) {
				case "center":
					ul.css({ width: ($("li", ul).width() + 2) * panelCount });
					break;
				case "right":
					ul.css({ float: 'right' });
					break;
			};
		};
		
		// If we need a tabbed nav
		$('#coda-nav-' + sliderCount + ' a').each(function(z) {
			// What happens when a nav link is clicked
			$(this).bind("click", function() {
				navClicks++;
				$(this).addClass('current').parents('ul').find('a').not($(this)).removeClass('current');
				offset = - (panelWidth*z);
				alterPanelHeight(z);
				currentPanel = z + 1;
				$('.panel-container', slider).animate({ marginLeft: offset }, settings.slideEaseDuration, settings.slideEaseFunction);
				if (!settings.crossLinking) { return false }; // Don't change the URL hash unless cross-linking is specified
			});
		});
		
		// External triggers (anywhere on the page)
		$(settings.externalTriggerSelector).each(function() {
			// Make sure this only affects the targeted slider
			if (sliderCount == parseInt($(this).attr("rel").slice(12))) {
				$(this).bind("click", function() {
					navClicks++;
					targetPanel = parseInt($(this).attr("href").slice(1));
					offset = - (panelWidth*(targetPanel - 1));
					alterPanelHeight(targetPanel - 1);
					currentPanel = targetPanel;
					// Switch the current tab:
					slider.siblings('.coda-nav').find('a').removeClass('current').parents('ul').find('li:eq(' + (targetPanel - 1) + ') a').addClass('current');
					// Slide
					$('.panel-container', slider).animate({ marginLeft: offset }, settings.slideEaseDuration, settings.slideEaseFunction);
					if (!settings.crossLinking) { return false }; // Don't change the URL hash unless cross-linking is specified
				});
			};
		});
			
		// Specify which tab is initially set to "current". Depends on if the loaded URL had a hash or not (cross-linking).
		if (settings.crossLinking && location.hash && parseInt(location.hash.slice(1)) <= panelCount) {
			$("#coda-nav-" + sliderCount + " a:eq(" + (location.hash.slice(1) - 1) + ")").addClass("current");
		// If there's no cross-linking, check to see if we're supposed to load a panel other than Panel 1 initially...
		} else if (settings.firstPanelToLoad != 1 && settings.firstPanelToLoad <= panelCount) {
			$("#coda-nav-" + sliderCount + " a:eq(" + (settings.firstPanelToLoad - 1) + ")").addClass("current");
		// Otherwise we must be loading Panel 1, so make the first tab the current one.
		} else {
			$("#coda-nav-" + sliderCount + " a:eq(0)").addClass("current");
		};
		
		// Set the height of the first panel
		if (settings.autoHeight) {
			panelHeight = $('.panel:eq(' + (currentPanel - 1) + ')', slider).height();
			slider.css({ height: panelHeight });
		};
		
		// Trigger autoSlide
		if (settings.autoSlide) {
			slider.ready(function() {
				setTimeout(autoSlide,settings.autoSlideInterval);
			});
		};
		
		function alterPanelHeight(x) {
			if (settings.autoHeight) {
				panelHeight = $('.panel:eq(' + x + ')', slider).height()
				slider.animate({ height: panelHeight }, settings.autoHeightEaseDuration, settings.autoHeightEaseFunction);
			};
		};
		
		function autoSlide() {
			if (navClicks == 0 || !settings.autoSlideStopWhenClicked) {
				if (currentPanel == panelCount) {
					var offset = 0;
					currentPanel = 1;
				} else {
					var offset = - (panelWidth*currentPanel);
					currentPanel += 1;
				};
				alterPanelHeight(currentPanel - 1);
				// Switch the current tab:
				slider.siblings('.coda-nav').find('a').removeClass('current').parents('ul').find('li:eq(' + (currentPanel - 1) + ') a').addClass('current');
				// Slide:
				$('.panel-container', slider).animate({ marginLeft: offset }, settings.slideEaseDuration, settings.slideEaseFunction);
				setTimeout(autoSlide,settings.autoSlideInterval);
			};
		};
		
		// Kill the preloader
		$('.panel', slider).show().end().find("p.loading").remove();
		slider.removeClass("preload");
		
		sliderCount++;
		
	});
};

jQuery(function ($) {
	$.fn.quicksearch = function (opt) {
		
		function is_empty(i) 
		{
			return (i === null || i === undefined || i === false) ? true: false;
		}
		
		function strip_html(input)
		{
			var regexp = new RegExp(/\<[^\<]+\>/g);
			var output = input.replace(regexp, "");
			output = $.trim(output.toLowerCase().replace(/\n/, '').replace(/\s{2,}/, ' '));
			return output;
		}
		
		function get_key()
		{
			var input = strip_html($('input[rel="' + options.randomElement + '"]').val());
			
			if (input.indexOf(' ') === -1)
			{
				return input;
			}
			else
			{
				return input.split(" ");
			}
		}
		
		function test_key(k, value, type)
		{
			if (type === "string")
			{
				return test_key_string(k, value);
			}
			else
			{
				return test_key_arr(k, value);
			}
		}
		
		function test_key_string(k, value)
		{
			return (value.indexOf(k) > -1);
		}
		
		function test_key_arr(k, value)
		{
			for (var i = 0; i < k.length; i++) {
				var test = value.indexOf(k[i]);	
				if (test === -1) {	
					return false;
				}
			}			
			return true;
		}
		
		function select_element(el) 
		{
			if (options.hideElement === "grandparent") 
			{
				return $(el).parent().parent();
			} 
			else if (options.hideElement === "parent") 
			{
				return $(el).parent();
			} 
			else
			{
				return $(el);
			}
		}
		
		function stripe(el)
		{
			if (doStripe)
			{
				var i = 0;
				select_element(el).filter(':visible').each(function () {
					
					for (var j = 0; j < stripeRowLength; j++)
					{
						if (i === j)
						{
							$(this).addClass(options.stripeRowClass[i]);
							
						}
						else
						{
							$(this).removeClass(options.stripeRowClass[j]);
						}
					}
					i = (i + 1) % stripeRowLength;
				});
			}
		}
		
		function fix_widths(el)
		{
			$(el).find('td').each(function () {
				$(this).attr('width', parseInt($(this).css('width')));
			});
		}
		
		function loader(o) {
			if (options.loaderId) 
			{
				var l = $('input[rel="' + options.randomElement + '"]').parent().find('.loader');
				if (o === 'hide') 
				{
					l.hide();
				} 
				else 
				{
					l.show();
				}
			}			
		}
		
		function place_form() {
			var formPosition = options.position;
			var formAttached = options.attached;

			if (formPosition === 'before') {
				$(formAttached).before(make_form());
			} else if (formPosition === 'prepend') {
				$(formAttached).prepend(make_form());
			} else if (formPosition === 'append') {
				$(formAttached).append(make_form());
			} else {
				$(formAttached).after(make_form());
			}
		}
				
		function make_form_label()
		{
			if (!is_empty(options.labelText)) {
				return '<label for="' + options.randomElement + '" '+
							'class="' + options.labelClass + '">'
							+ options.labelText
							+ '</label> ';	
			}
			return '';
		}
		
		function make_form_input()
		{
			var val = (!is_empty(options.inputText)) ? options.inputText : ""
			return '<input type="text" value="' + val + '" rel="' + options.randomElement  + '" class="' + options.inputClass + '" id="' + options.randomElement + '" /> ';
		}
		
		function make_form_loader()
		{
			if (!is_empty(options.loaderImg)) {
				return '<img src="' + options.loaderImg + '" alt="Loading" id="' + options.loaderId + '" class="' + options.loaderClass + '" />';
			} else {
				return '<span id="' + options.loaderId + '" class="' + options.loaderClass + '">' + options.loaderText + '</span>';
			}
		}
		
		function make_form()
		{
			var f = (!options.isFieldset) ? 'form' : 'fieldset';
			return '<' + f + ' action="#" ' + 'id="'+ options.formId + '" ' + 'class="quicksearch">' +
						make_form_label() +	make_form_input() + make_form_loader() +
					'</' + f + '>';
		}
			
		function focus_on_load()
		{
			$('input[rel="' + options.randomElement + '"]').get(0).focus();
		}
		
		function toggle_text() {
			$('input[rel="' + options.randomElement + '"]').focus(function () {
				if ($(this).val() === options.inputText) {
					$(this).val('');
				}
			});
			$('input[rel="' + options.randomElement + '"]').blur(function () {
				if ($(this).val() === "") {
					$(this).val(options.inputText);
				}
			});
		}
		
		function get_cache(el) 
		{
			return $(el).map(function(){
				return strip_html(this.innerHTML);
			});
		}
		
		function init()
		{
			place_form();
			if (options.fixWidths) fix_widths(el);
			if (options.focusOnLoad) focus_on_load();
			if (options.inputText != "" && options.inputText != null) toggle_text();
			
			cache = get_cache(el);
			
			stripe(el);
			loader('hide');
		}
		
		function qs() 
		{
			clearTimeout(timeout);
			timeout = setTimeout(function () {
				
				loader('show');
				
				setTimeout(function () {
					options.onBefore();
					
					var k = get_key();
					var k_type = (typeof k);
					var i = 0;
					
					k = options.filter(k);
					
					if (k != "")
					{
						if (typeof score[k] === "undefined")
						{
							score[k] = new Array();
							cache.each(function (i) {
								if (test_key(k, cache[i], k_type))
								{
									score[k][i] = true;
								}
							});
						}
						
						if (score[k].length === 0)
						{
							select_element(el).hide();
						}
						else
						{
							$(el).each(function (i) {
								if (score[k][i])
								{
									select_element(this).show();
								}
								else
								{
									select_element(this).hide();
								}
							});
							
						}
					}
					else
					{
						select_element(el).show();
					}
				
					stripe(el);
				}, options.delay/2);
				
				setTimeout( function () { 
					loader('hide');
				}, options.delay/2);
				
				options.onAfter();
				
			}, options.delay/2);
		}
		
		var options = $.extend({
			position: 'prepend',
			attached: 'body',
			formId: 'quicksearch',
			labelText: 'Quick Search',
			labelClass: 'qs_label',
			inputText: null,
			inputClass: 'qs_input',
			loaderId: 'loader',
			loaderClass: 'loader',
			loaderImg: null,
			loaderText: 'Loading...',
			stripeRowClass: null,
			hideElement: null,
			delay: 500,
			focusOnLoad: false,
			onBefore: function () { },
			onAfter: function () { },
			filter: function (i) { 
				return i;
			},
			randomElement: 'qs' + Math.floor(Math.random() * 1000000),
			isFieldset: false,
			fixWidths: false
		}, opt);
		
		var timeout;
		var score = {};
		var stripeRowLength = (!is_empty(options.stripeRowClass)) ? options.stripeRowClass.length : 0;
		var doStripe = (stripeRowLength > 0) ? true : false;
		var el = this;
		var cache;
		var selector = $(this).selector;
		
		$.fn.extend({
			reset_cache: function () {
				el = $(selector);
				cache = get_cache(el);
			}
		});
		
		init();
		
		$('input[rel="' + options.randomElement + '"]').keydown(function (e) {
			var keycode = e.keyCode;
			if (!(keycode === 9 || keycode === 13 || keycode === 16 || keycode === 17 || keycode === 18 || keycode === 38 || keycode === 40 || keycode === 224))
			{
				qs();
			}
		});
		
		$('form.quicksearch, fieldset.quicksearch').submit( function () { return false; });
		
		return this;
	};
});

/*
 * imgPreview jQuery plugin
 * Copyright (c) 2009 James Padolsey
 * j@qd9.co.uk | http://james.padolsey.com
 * Dual licensed under MIT and GPL.
 * Updated: 09/02/09
 * @author James Padolsey
 * @version 0.22
 */
this.screenshotPreview = function(){	
	/* CONFIG */
		
		xOffset = 10;
		yOffset = 30;
		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */
	$("a.screenshot").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<p id='screenshot'><img src='"+ this.rel +"' alt='' />"+ c +"</p>");								 
		$("#screenshot")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$("#screenshot").remove();
    });	
	$("a.screenshot").mousemove(function(e){
		$("#screenshot")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};

// starting the script on page load
$(document).ready(function(){
	screenshotPreview();
	start();
});
//set cookie and check cookie

	function checkPreviousPage()
		{
			setCookie("checkpreviouspage","",1);
			 var bd = document.getElementById("brandmodel");
			 if(bd == null)
			 {
				//alert("fail");
			}
			else
			{
			//var bdv = bd.nodeValue;
			//alert(bd.innerHTML)
			setCookie("checkpreviouspage",bd.innerHTML,1);
						//alert(bd.innerHTML)										
			}
	}
	function getCookie(c_name)
	 {
			if (document.cookie.length>0)
			{			
				c_start=document.cookie.indexOf(c_name + "=")			
				if (c_start!=-1)			
			   { 		
				   c_start=c_start + c_name.length+1 		
				   c_end=document.cookie.indexOf(";",c_start)		
				   if (c_end==-1) c_end=document.cookie.length		
				   return unescape(document.cookie.substring(c_start,c_end))		
			   } 			
			}
			return ""
	 }
	 function setCookie(c_name,value,expiredays)
	 {		
	 		
		var today = new Date();

		today.setTime( today.getTime() );

		if ( expiredays ) {

		expiredays = expiredays * 1000 * 60 * 3; //cookie will expire in 3 min
	
		}

		var expires_date = new Date( today.getTime() + (expiredays) );
		document.cookie = c_name+'='+escape( value ) + ( ( expiredays ) ? ';expires='+expires_date.toGMTString() : '' );  	 
	 		//var expires_date=new Date();
			//expires_date.setDate(exdate.getDate()+expiredays);
			//document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
			
	 
	 }
	 
    start = function() {
        // get the reference for the body
	
    var bd = getCookie("checkpreviouspage");
	if (bd != "")
	{
	var name = document.getElementById("pname");
 	var model = document.createElement("span");
		
	var cellText = document.createTextNode(" (works with " + bd + ")");
    model.appendChild(cellText);
	name.appendChild(model);
	//highlightSearchTerms(bd,1);
	}
	setCookie("checkpreviouspage","",1);
	
		
/*URL Model Funciton*/
	var alink = new String(window.location);
	var parameterOfLink = alink.split("?");

	if(parameterOfLink.length>1){
		//var divItem = window.document.getElementById("urlmodel");
		
		var name = document.getElementById("pname");
		var model2 = document.createElement("span");
		//model2.style.color = "red";
		//model2.style.margin="0 5px 0 0";
		var model = new String(parameterOfLink[1]);
		var value = model.split("model=");

		var repStr = new String(value[1]);
	
		if(repStr.indexOf("+") != -1){
   		
			while(repStr.indexOf("+") != -1){
   	 			repStr = repStr.replace("+", " ");
   			}
			
  		}else if(repStr.indexOf("%20") != -1){
		   while(repStr.indexOf("%20") != -1){
    			repStr = repStr.replace("%20", " ");
   			}
		  }
		
		if(repStr !="" && repStr !="undefined"){
		
		var cellText = document.createTextNode(" (works with " +  repStr + ")");
		model2.appendChild(cellText);
		name.appendChild(model2);
		highlightSearchTerms(repStr,1);
		
		 //var cellTextx = document.createTextNode(repStr+" ");
	     //model2.appendChild(cellTextx);
 		 //var parentDiv = name.parentNode;
		 //parentDiv.insertBefore(model2, name);
	
		}
	}

/*	end of url model function*/
	
    }

//highlight function
function doHighlight(bodyText, searchTerm, highlightStartTag, highlightEndTag) 
{
  // the highlightStartTag and highlightEndTag parameters are optional
  if ((!highlightStartTag) || (!highlightEndTag)) {
    highlightStartTag = "<font style='color:blue; background-color:yellow;'>";
    highlightEndTag = "</font>";
  }
  
  // find all occurences of the search term in the given text,
  // and add some "highlight" tags to them (we're not using a
  // regular expression search, because we want to filter out
  // matches that occur within HTML tags and script blocks, so
  // we have to do a little extra validation)
  var newText = "";
  var i = -1;
  var lcSearchTerm = searchTerm.toLowerCase();
  var lcBodyText = bodyText.toLowerCase();
    
  while (bodyText.length > 0) {
    i = lcBodyText.indexOf(lcSearchTerm, i+1);
    if (i < 0) {
      newText += bodyText;
      bodyText = "";
    } else {
      // skip anything inside an HTML tag
      if (bodyText.lastIndexOf(">", i) >= bodyText.lastIndexOf("<", i)) {
        // skip anything inside a <script> block
        if (lcBodyText.lastIndexOf("/script>", i) >= lcBodyText.lastIndexOf("<script", i)) {
          newText += bodyText.substring(0, i) + highlightStartTag + bodyText.substr(i, searchTerm.length) + highlightEndTag;
          bodyText = bodyText.substr(i + searchTerm.length);
          lcBodyText = bodyText.toLowerCase();
          i = -1;
        }
      }
    }
  }
  
  return newText;
}

/*
 * This is sort of a wrapper function to the doHighlight function.
 * It takes the searchText that you pass, optionally splits it into
 * separate words, and transforms the text on the current web page.
 * Only the "searchText" parameter is required; all other parameters
 * are optional and can be omitted.
 */
function highlightSearchTerms(searchText,treatAsPhrase, warnOnFailure, highlightStartTag, highlightEndTag)
{
  // if the treatAsPhrase parameter is true, then we should search for 
  // the entire phrase that was entered; otherwise, we will split the
  // search string so that each word is searched for and highlighted
  // individually
 	//var alinkx = new String(window.location);
	//var parameterOfLinkx = alinkx.split("?");
	//if(parameterOfLinkx.length>1){
//	var model3 = new String(parameterOfLinkx[1]);
//	var value = model3.split("model=");

//	var repStrx = new String(value[1]);
	
//	if(repStrx.indexOf("+") != -1){
   		
//		while(repStrx.indexOf("+") != -1){
 //  	 		repStrx = repStrx.replace("+", " ");
 //  		}
			
//  	}else if(repStrx.indexOf("%20") != -1){
//		while(repStrx.indexOf("%20") != -1){
 //   		repStrx = repStrx.replace("%20", " ");
 //  		}
//	 }
		  
  if (treatAsPhrase) {
    searchArray = [searchText];
  } else {
    searchArray = searchText.split(" ");
  }
  
  var bodyText = document.body.innerHTML;
  for (var i = 0; i < searchArray.length; i++) {
    bodyText = doHighlight(bodyText, searchArray[i], highlightStartTag, highlightEndTag);
  }
  
  document.body.innerHTML = bodyText;
  return true;
	}
//}	

/*start magicZoom*/
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('7 g=\'F\';7 W=4B.4A.1T();6(W.2n("1x")!=-1){g=\'1x\'}B 6(W.2n("F")!=-1){g=\'F\'}B 6(W.2n("1y")!=-1){g=\'1y\'}B 6(W.2n("4m")!=-1){g=\'28\'}7 1v=1l 4l();k 1o$(D){m 8.4J(D)};k v(2j,2O){6(2j.3q){7 y=2j.3q[2O];y=a(y)?y:\'H\'}B 6(1a.3N){7 2N=8.4M.3N(2j,1R);7 y=2N?2N[2O]:1R}m y};k 2u(e){6(e.3e){7 r=e.3e();7 2h=0;7 2f=0;6(8.11&&(8.11.1u||8.11.1p)){2f=8.11.1p;2h=8.11.1u}B 6(8.17&&(8.17.1u||8.17.1p)){2f=8.17.1p;2h=8.17.1u}m{\'q\':r.q+2h,\'G\':r.G+2f,\'2l\':r.2l+2h,\'1I\':r.1I+2f}}}k 2J(e){7 x=0;7 y=0;6(g==\'F\'){y=e.2r;x=e.2q;6(8.11&&(8.11.1u||8.11.1p)){y=e.2r+8.11.1p;x=e.2q+8.11.1u}B 6(8.17&&(8.17.1u||8.17.1p)){y=e.2r+8.17.1p;x=e.2q+8.17.1u}}B{y=e.2r;x=e.2q;y+=1a.43;x+=1a.44}m{\'x\':x,\'y\':y}}k 2Q(){m J};7 32=k(){7 1c=1Q;6(!1c[1])1c=[4,1c[0]];1n(7 2P 45 1c[1])1c[0][2P]=1c[1][2P];m 1c[0]};k 1d(1G,Z,1Y){6(g==\'28\'||g==\'1x\'||g==\'1y\'){3k{1G.46(Z,1Y,J)}3C(e){42("M 41: "+e+", Z="+Z)}}B 6(g==\'F\'){1G.3X("2G"+Z,1Y)}};k 2X(1G,Z,1Y){6(g==\'28\'||g==\'1x\'||g==\'1y\'){1G.3Y(Z,1Y,J)}B 6(g==\'F\'){1G.3Z("2G"+Z,1Y)}};k 3d(){7 21=[];1n(7 i=0;i<1Q.1j;i++)1n(7 j=0;j<1Q[i].1j;j++)21.2Z(1Q[i][j]);m 21};k 3h(2R,3K){21=[];1n(7 i=3K;i<2R.1j;i++)21.2Z(2R[i]);m 21};k 1h(2T,3f){7 1c=3h(1Q,2);m k(){2T[3f].47(2T,3d(1c,1Q))}};k 1K(e){6(g==\'28\'||g==\'1y\'||g==\'1x\'){e.3s=L;e.4g();e.4h()}B 6(g==\'F\'){1a.Z.3s=L}};k M(3p,3l,3m,3o,h){4.4e=\'2.2\';4.2z=J;4.E=1o$(3p);4.c=1o$(3l);4.b=1o$(3m);4.l=1o$(3o);4.o=0;4.h=h;6(!4.h["1A"]){4.h["1A"]=""}4.1e=0;4.16=0;4.K=0;4.Q=0;4.R=20;4.4d=20;4.1k=0;4.1s=0;4.1t=\'\';4.N=1R;6(4.h["1L"]!=\'\'){4.N=8.1b(\'2c\');4.N.5.n=\'1P\';4.N.5.1m=\'1z\';4.N.1Z=\'3w\';4.N.5.2B=\'2A\';4.N.5.49=\'4a\';4.N.36=4.h["1M"]+\'<4b/><U 4c="0" 33="\'+4.h["1M"]+\'" 1f="\'+4.h["1L"]+\'"/>\';4.E.18(4.N)}4.4i=\'\';4.2k=J;1v.2Z(4);4.39=1h(4,"2x");4.37=1h(4,"1U")};M.12.3M=k(){2X(1a.8,"1U",4.39);2X(4.E,"1U",4.37);6(4.h["n"]=="1H"){1o$(4.E.D+"-3P").22(4.b)}B{4.E.22(4.b)}4.E.22(4.o)};M.12.2x=k(e){7 r=2J(e);7 x=r[\'x\'];7 y=r[\'y\'];7 V=0;7 T=0;7 P=4.c;23(P&&P.1N!="3Q"&&P.1N!="3L"){V+=P.3G;T+=P.3H;P=P.3F}6(g==\'F\'){7 r=2u(4.c);T=r[\'q\'];V=r[\'G\']}T+=a(v(4.c,\'24\'));V+=a(v(4.c,\'2W\'));6(g!=\'F\'||!(8.1g&&\'25\'==8.1g.1T())){T+=a(v(4.c,\'27\'));V+=a(v(4.c,\'2m\'))}6(x>a(T+4.K)){4.2g();m J}6(x<a(T)){4.2g();m J}6(y>a(V+4.Q)){4.2g();m J}6(y<a(V)){4.2g();m J}6(g==\'F\'){4.E.5.1W=1}m L};M.12.38=k(e){1K(e);4.E.5.2H=\'3j\'};M.12.30=k(e){1K(e);4.E.5.2H=\'3U\'};M.12.1U=k(e){1K(e);1n(i=0;i<1v.1j;i++){6(1v[i]!=4){1v[i].2x(e)}}6(4.h&&4.h["1B"]==L){6(4.E.5.2H!=\'3j\'){m}}6(4.2z){m}6(!4.2x(e)){m}4.2z=L;7 2F=4.c;7 T=0;7 V=0;6(g==\'28\'||g==\'1x\'||g==\'1y\'){7 P=2F;23(P.1N!="3Q"&&P.1N!="3L"){V+=P.3G;T+=P.3H;P=P.3F}}B{7 r=2u(4.c);T=r[\'q\'];V=r[\'G\']}T+=a(v(4.c,\'24\'));V+=a(v(4.c,\'2W\'));6(g!=\'F\'||!(8.1g&&\'25\'==8.1g.1T())){T+=a(v(4.c,\'27\'));V+=a(v(4.c,\'2m\'))}7 r=2J(e);7 x=r[\'x\'];7 y=r[\'y\'];4.1k=x-T;4.1s=y-V;6((4.1k+4.R/2)>=4.K){4.1k=4.K-4.R/2}6((4.1s+4.Y/2)>=4.Q){4.1s=4.Q-4.Y/2}6((4.1k-4.R/2)<=0){4.1k=4.R/2}6((4.1s-4.Y/2)<=0){4.1s=4.Y/2}2S(1h(4,"35"),10)};M.12.35=k(){7 2b=4.1k-4.R/2;7 2a=4.1s-4.Y/2;7 29=2b*(4.1e/4.K);7 2E=2a*(4.16/4.Q);6(8.17.4S==\'4T\'){29=(4.1k+4.R/2-4.K)*(4.1e/4.K)}2b+=a(v(4.c,\'24\'));2a+=a(v(4.c,\'2W\'));6(g!=\'F\'||!(8.1g&&\'25\'==8.1g.1T())){2b+=a(v(4.c,\'27\'));2a+=a(v(4.c,\'2m\'))}4.o.5.q=2b+\'u\';4.o.5.G=2a+\'u\';4.o.5.1m="2D";6((4.1e-29)<a(4.b.5.C)){29=4.1e-a(4.b.5.C)}6(4.16>a(4.b.5.t)){6((4.16-2E)<a(4.b.5.t)){2E=4.16-a(4.b.5.t)}}4.l.5.q=(-29)+\'u\';4.l.5.G=(-2E)+\'u\';4.b.5.G=4.1t;4.b.5.2B=\'2A\';4.b.5.1m=\'2D\';4.l.5.2B=\'2A\';4.l.5.1m=\'2D\';4.2z=J};k 4L(2I){7 2K="";1n(i=0;i<2I.1j;i++){2K+=4j.4K(14^2I.4N(i))}m 2K};M.12.2g=k(){6(4.h&&4.h["1F"]==L)m;6(4.o){4.o.5.1m="1z"}4.b.5.G=\'-1V\';6(g==\'F\'){4.E.5.1W=0}};M.12.2Y=k(){4.R=a(4.b.5.C)/(4.1e/4.K);6(4.h&&4.h["1A"]!=""){4.Y=(a(4.b.5.t)-19)/(4.16/4.Q)}B{4.Y=a(4.b.5.t)/(4.16/4.Q)}6(4.R>4.K){4.R=4.K}6(4.Y>4.Q){4.Y=4.Q}4.R=2C.3a(4.R);4.Y=2C.3a(4.Y);6(!(8.1g&&\'25\'==8.1g.1T())){7 2L=a(v(4.o,\'24\'));4.o.5.C=(4.R-2*2L)+\'u\';4.o.5.t=(4.Y-2*2L)+\'u\'}B{4.o.5.C=4.R+\'u\';4.o.5.t=4.Y+\'u\'}};M.12.3y=k(){4.o=8.1b("2c");4.o.1Z=\'57\';4.o.5.1W=10;4.o.5.1m=\'1z\';4.o.5.n=\'1P\';4.o.5["X"]=2M(4.h[\'X\']/1X.0);4.o.5["-56-X"]=2M(4.h[\'X\']/1X.0);4.o.5["-58-X"]=2M(4.h[\'X\']/1X.0);4.o.5["3r"]="4Y(4X="+4.h[\'X\']+")";4.E.18(4.o);4.2Y();4.E.4Z="2G";4.E.5.51="3i";4.E.52=2Q;4.E.4V=2Q};M.12.3D=k(){7 3g=4.l.1f;6(4.16<a(4.b.5.t)){4.b.5.t=4.16+\'u\';6(4.h&&4.h["1A"]!=""){4.b.5.t=(19+4.16)+\'u\'}}6(4.1e<a(4.b.5.C)){4.b.5.C=4.1e+\'u\'}23(4.b.1w){4.b.22(4.b.1w)}6(g==\'F\'){7 f=8.1b("4r");f.5.q=\'H\';f.5.G=\'H\';f.5.n=\'1P\';f.5.3r=\'4s:4t.4u.4q(5=0,X=0)\';f.5.C=4.b.5.C;f.5.t=4.b.5.t;f.4p=0;4.b.18(f)}6(4.h&&4.h["1A"]!=""){7 f=8.1b("2c");f.1Z=\'2i\';f.D=\'2i\'+4.b.D;f.5.n=\'2d\';f.5.1W=10;f.5.q=\'H\';f.5.G=\'H\';f.5.2U=\'4k\';f.36=4.h["1A"];4.b.18(f)}7 2y=8.1b("2c");2y.5.3A="1z";4.b.18(2y);4.l=8.1b("1q");4.l.1f=3g;4.l.5.n=\'2d\';4.l.5.3J=\'H\';4.l.5.2U=\'H\';4.l.5.q=\'H\';4.l.5.G=\'H\';2y.18(4.l)};M.12.1J=k(){6(4.N!=1R&&!4.l.2V&&4.c.C!=0&&4.c.t!=0){4.N.5.q=(a(4.c.C)/2-a(4.N.4n)/2)+\'u\';4.N.5.G=(a(4.c.t)/2-a(4.N.4o)/2)+\'u\';4.N.5.1m=\'2D\'}6(g==\'1y\'){6(!4.2k){1d(4.l,"3z",1h(4,"1J"));4.2k=L;m}}B{6(!4.l.2V||!4.c.2V){2S(1h(4,"1J"),1X);m}}4.l.5.3J=\'H\';4.l.5.2U=\'H\';4.1e=4.l.C;4.16=4.l.t;4.K=4.c.C;4.Q=4.c.t;6(4.1e==0||4.16==0||4.K==0||4.Q==0){2S(1h(4,"1J"),1X);m}6(g==\'1x\'||(g==\'F\'&&!(8.1g&&\'25\'==8.1g.1T()))){4.K-=a(v(4.c,\'27\'));4.K-=a(v(4.c,\'3B\'));4.Q-=a(v(4.c,\'2m\'));4.Q-=a(v(4.c,\'4C\'))}6(4.N!=1R)4.N.5.1m=\'1z\';4.E.5.C=4.c.C+\'u\';4.b.5.G=\'-1V\';4.1t=\'H\';7 r=2u(4.c);6(!r){4.b.5.q=4.K+a(v(4.c,\'24\'))+a(v(4.c,\'4x\'))+a(v(4.c,\'27\'))+a(v(4.c,\'3B\'))+15+\'u\'}B{4.b.5.q=(r[\'2l\']-r[\'q\']+15)+\'u\'}3u(4.h[\'n\']){1i\'q\':4.b.5.q=\'-\'+(15+a(4.b.5.C))+\'u\';13;1i\'1I\':6(r){4.1t=r[\'1I\']-r[\'G\']+15+\'u\'}B{4.1t=4.c.t+15+\'u\'}4.b.5.q=\'H\';13;1i\'G\':4.1t=\'-\'+(15+a(4.b.5.t))+\'u\';4.b.5.q=\'H\';13;1i\'1H\':4.b.5.q=\'H\';4.1t=\'H\';13;1i\'2s\':4.b.5.q=\'H\';4.1t=\'H\';4.b.5.C=4.K+\'u\';4.b.5.t=4.Q+\'u\';13}6(4.o){4.2Y();m}4.3D();4.3y();1d(1a.8,"1U",4.39);1d(4.E,"1U",4.37);6(4.h&&4.h["1B"]==L){1d(4.E,"38",1h(4,"38"));1d(4.E,"30",1h(4,"30"))}6(4.h&&(4.h["1B"]==L||4.h["1F"]==L)){4.1k=4.K/2;4.1s=4.Q/2;4.35()}};M.12.31=k(1S,e){6(1S.2o==4.l.1f)m;7 26=8.1b("1q");26.D=4.l.D;26.1f=1S.2o;7 p=4.l.4z;p.4y(26,4.l);4.l=26;4.l.5.n=\'2d\';4.c.1f=1S.3O;6(1S.2p!=\'\'&&1o$(\'2i\'+4.b.D)){1o$(\'2i\'+4.b.D).36=1S.2p}4.2k=J;4.1J()};k 3t(D,I){7 9=1a.8.34("A");1n(7 i=0;i<9.1j;i++){6(9[i].1r==D){1d(9[i],"2t",k(Z){6(g!=\'F\'){4.3I()}B{1a.4D()}1K(Z);m J});1d(9[i],I.h[\'2e\'],1h(I,"31",9[i]));9[i].5.3v=\'0\';9[i].2w=32;9[i].2w({I:I,4H:k(){4.I.31(1R,4)}});7 U=8.1b("1q");U.1f=9[i].2o;U.5.n=\'1P\';U.5.q=\'-1V\';U.5.G=\'-1V\';8.11.18(U);U=8.1b("1q");U.1f=9[i].3O;U.5.n=\'1P\';U.5.q=\'-1V\';U.5.G=\'-1V\';8.11.18(U)}}};k 4G(){23(1v.1j>0){7 I=1v.4F();I.3M();4E I}};k 3E(){7 1M=\'4w 4v\';7 1L=\'\';7 1O=1a.8.34("1q");1n(7 i=0;i<1O.1j;i++){6(/3w/.3n(1O[i].1Z)){6(1O[i].33!=\'\')1M=1O[i].33;1L=1O[i].1f;13}}7 9=1a.8.34("A");1n(7 i=0;i<9.1j;i++){6(/M/.3n(9[i].1Z)){23(9[i].1w){6(9[i].1w.1N!=\'1q\'){9[i].22(9[i].1w)}B{13}}6(9[i].1w.1N!=\'1q\')54"55 M 53!";7 1E=2C.3a(2C.4W()*4O);9[i].5.n="2d";9[i].5.2B=\'2A\';9[i].5.3v=\'0\';9[i].5.4P=\'3i\';1d(9[i],"2t",k(Z){6(g!=\'F\'){4.3I()}1K(Z);m J});6(9[i].D==\'\'){9[i].D="4Q"+1E}6(g==\'F\'){9[i].5.1W=0}7 2F=9[i].1w;2F.D="3x"+1E;7 O=8.1b("2c");O.D="4U"+1E;S=1l 1C(/X(\\s+)?:(\\s+)?(\\d+)/i);z=S.1D(9[i].1r);7 X=50;6(z){X=a(z[3])}S=1l 1C(/4R\\-4f(\\s+)?:(\\s+)?(2t|3T)/i);z=S.1D(9[i].1r);7 2e=\'2t\';6(z){2e=z[3]}S=1l 1C(/I\\-C(\\s+)?:(\\s+)?(\\w+)/i);z=S.1D(9[i].1r);O.5.C=\'3b\';6(z){O.5.C=z[3]}S=1l 1C(/I\\-t(\\s+)?:(\\s+)?(\\w+)/i);z=S.1D(9[i].1r);O.5.t=\'3b\';6(z){O.5.t=z[3]}S=1l 1C(/I\\-n(\\s+)?:(\\s+)?(\\w+)/i);z=S.1D(9[i].1r);7 n=\'2l\';6(z){3u(z[3]){1i\'q\':n=\'q\';13;1i\'1I\':n=\'1I\';13;1i\'G\':n=\'G\';13;1i\'1H\':n=\'1H\';13;1i\'2s\':n=\'2s\';13}}S=1l 1C(/3S\\-3R(\\s+)?:(\\s+)?(L|J)/i);z=S.1D(9[i].1r);7 1B=J;6(z){6(z[3]==\'L\')1B=L}S=1l 1C(/3W\\-48\\-I(\\s+)?:(\\s+)?(L|J)/i);z=S.1D(9[i].1r);7 1F=J;6(z){6(z[3]==\'L\')1F=L}O.5.3A=\'1z\';O.1Z="40";O.5.1W=1X;O.5.1m=\'1z\';6(n!=\'1H\'){O.5.n=\'1P\'}B{O.5.n=\'2d\'}7 2v=8.1b("1q");2v.D="3c"+1E;2v.1f=9[i].2o;O.18(2v);6(n!=\'1H\'){9[i].18(O)}B{1o$(9[i].D+\'-3P\').18(O)}7 h={1F:1F,1B:1B,1A:9[i].2p,X:X,2e:2e,n:n,1M:1M,1L:1L};6(n==\'2s\'){9[i].2p=\'\'}7 I=1l M(9[i].D,\'3x\'+1E,O.D,\'3c\'+1E,h);9[i].2w=32;9[i].2w({I:I});I.1J();3t(9[i].D,I)}}};6(g==\'F\')3k{8.3V("4I",J,L)}3C(e){};1d(1a,"3z",3E);',62,319,'||||this|style|if|var|document|aels|parseInt|bigImageCont|smallImage||||MagicZoom_ua|settings|||function|bigImage|return|position|pup||left|||height|px|MagicZoom_getStyle||||matches||else|width|id|smallImageCont|msie|top|0px|zoom|false|smallImageSizeX|true|MagicZoom|loadingCont|bigCont|tag|smallImageSizeY|popupSizeX|re|smallX|img|smallY||opacity|popupSizeY|event||body|prototype|break|||bigImageSizeY|documentElement|appendChild||window|createElement|args|MagicZoom_addEventListener|bigImageSizeX|src|compatMode|MagicZoom_createMethodReference|case|length|positionX|new|visibility|for|MagicZoom_|scrollTop|IMG|rel|positionY|bigImageContStyleTop|scrollLeft|MagicZoom_zooms|firstChild|opera|safari|hidden|header|drag_mode|RegExp|exec|rand|bigImage_always_visible|obj|custom|bottom|initZoom|MagicZoom_stopEventPropagation|loadingImg|loadingText|tagName|iels|absolute|arguments|null|ael|toLowerCase|mousemove|10000px|zIndex|100|listener|className||result|removeChild|while|borderLeftWidth|backcompat|newBigImage|paddingLeft|gecko|perX|ptop|pleft|DIV|relative|thumb_change|wy|hiderect|wx|MagicZoomHeader|el|safariOnLoadStarted|right|paddingTop|indexOf|href|title|clientX|clientY|inner|click|MagicZoom_getBounds|bigImg|mzextend|checkcoords|ar1|recalculating|block|display|Math|visible|perY|smallImg|on|cursor|vc67|MagicZoom_getEventBounds|vc68|bw|parseFloat|css|styleProp|property|MagicView_ia|sequence|setTimeout|object|padding|complete|borderTopWidth|MagicZoom_removeEventListener|recalculatePopupDimensions|push|mouseup|replaceZoom|MagicZoom_extendElement|alt|getElementsByTagName|showrect|innerHTML|mousemove_ref|mousedown|checkcoords_ref|round|350px|bim|MagicZoom_concat|getBoundingClientRect|methodName|bigimgsrc|MagicZoom_withoutFirst|none|move|try|smallImageId|bigImageContId|test|bigImageId|smallImageContId|currentStyle|filter|cancelBubble|MagicZoom_findSelectors|switch|outline|MagicZoomLoading|sim|initPopup|load|overflow|paddingRight|catch|initBigContainer|MagicZoom_findZooms|offsetParent|offsetTop|offsetLeft|blur|borderWidth|skip|HTML|stopZoom|getComputedStyle|rev|big|BODY|mode|drag|mouseover|default|execCommand|always|attachEvent|removeEventListener|detachEvent|MagicZoomBigImageCont|error|alert|pageYOffset|pageXOffset|in|addEventListener|apply|show|textAlign|center|br|border|popupSizey|version|change|preventDefault|stopPropagation|baseuri|String|3px|Array|mozilla|offsetWidth|offsetHeight|frameBorder|Alpha|IFRAME|progid|DXImageTransform|Microsoft|Zoom|Loading|borderRightWidth|replaceChild|parentNode|userAgent|navigator|paddingBottom|focus|delete|pop|MagicZoom_stopZooms|selectThisZoom|BackgroundImageCache|getElementById|fromCharCode|xgdf7fsgd56|defaultView|charCodeAt|1000000|textDecoration|sc|thumb|dir|rtl|bc|oncontextmenu|random|Opacity|alpha|unselectable||MozUserSelect|onselectstart|invocation|throw|Invalid|moz|MagicZoomPup|html'.split('|'),0,{}))

/*start tool tips*/
var offsetfromcursorX=12 //Customize x offset of tooltip
var offsetfromcursorY=10 //Customize y offset of tooltip

var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).

document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
document.write('<img id="dhtmlpointer" src="/lib/yhst-66763527056125/arrow2.gif">') //write out pointer image

var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thewidth, thecolor){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var nondefaultpos=false
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth){
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=curX-tipobj.offsetWidth+"px"
nondefaultpos=true
}
else if (curX<leftedge)
tipobj.style.left="5px"
else{
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"
}

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"
}
tipobj.style.visibility="visible"
if (!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip
	

