function check1(thing)	{
	document.getElementById('check-grey').className = "";
	document.getElementById('check-cherry').className = "";
	document.getElementById('check-blue').className = "";
	document.getElementById('check-' + thing).className = "checked";
	var src = document.getElementById('peek-colors').src = "img/peek-" + thing + ".jpg";
}
function learn1(thing)	{
	document.getElementById('mini-gray1').className = "";
	document.getElementById('mini-cherry1').className = "";
	document.getElementById('mini-blue1').className = "";
	document.getElementById('mini-' + thing + '1').className = "selected";
	//document.getElementById('page-type1').className = thing;
	var src = document.getElementById('bg-img-learn1').src = "img/bg-learn-" + thing + ".jpg";
}

function hide(thing)	{
	document.getElementById(thing).className = "off";
}

function show(thing)	{
	document.getElementById(thing).className = "on";
}

(function($) {
	
	$.fn.pngfix = function(options) {
		
		// Review the Microsoft IE developer library for AlphaImageLoader reference 
		// http://msdn2.microsoft.com/en-us/library/ms532969(VS.85).aspx
		
		// ECMA scope fix
		var elements 	= this;
		var settings 	= $.extend({
			imageFixSrc: 	false,
			sizingMethod: 	false 
		}, options);
		
		if(!$.browser.msie || ($.browser.msie &&  $.browser.version >= 7)) {
			return(elements);
		}

		function setFilter(el, path, mode) {
			var fs = el.attr("filters");
			var alpha = "DXImageTransform.Microsoft.AlphaImageLoader";
			if (fs[alpha]) {
				fs[alpha].enabled = true;
				fs[alpha].src = path; 
				fs[alpha].sizingMethod = mode;
			} else {
				el.css("filter", 'progid:' + alpha + '(enabled="true", sizingMethod="' + mode + '", src="' + path + '")');			
			}
		}
		
		function setDOMElementWidth(el) {
			if(el.css("width") == "auto" & el.css("height") == "auto") {
				el.css("width", el.attr("offsetWidth") + "px");
			}
		}

		return(
			elements.each(function() {
				
				// Scope
				var el = $(this);
				
				if(el.attr("tagName").toUpperCase() == "IMG" && (/\.png/i).test(el.attr("src"))) {
					if(!settings.imageFixSrc) {
						
						// Wrap the <img> in a <span> then apply style/filters, 
						// removing the <img> tag from the final render 
						el.wrap("<span></span>");
						var par = el.parent();
						par.css({
							height: 	el.height(),
							width: 		el.width(),
							display: 	"inline-block"
						});
						setFilter(par, el.attr("src"), "scale");
						el.remove();
					} else if((/\.gif/i).test(settings.imageFixSrc)) {
						
						// Replace the current image with a transparent GIF
						// and apply the filter to the background of the 
						// <img> tag (not the preferred route)
						setDOMElementWidth(el);
						setFilter(el, el.attr("src"), "image");
						el.attr("src", settings.imageFixSrc);
					}
					
				} else {
					var bg = new String(el.css("backgroundImage"));
					var matches = bg.match(/^url\("(.*)"\)$/);
					if(matches && matches.length) {
						
						// Elements with a PNG as a backgroundImage have the
						// filter applied with a sizing method relevant to the 
						// background repeat type
						setDOMElementWidth(el);
						el.css("backgroundImage", "none");
						
						// Restrict scaling methods to valid MSDN defintions (or one custom)
						var sc = "crop";
						if(settings.sizingMethod) {
							sc = settings.sizingMethod;
						} 
						setFilter(el, matches[1], sc);
						
						// Fix IE peek-a-boo bug for internal links
						// within that DOM element
						el.find("a").each(function() {
							$(this).css("position", "relative");
						});
					}
				}
				
			})
		);
	}

})(jQuery)

$(document).ready(function(){
	
	// Add appropriate helper text to input fields
	$(":text").each(function() {
		var helpTxt = $(this).attr("title");
		
		$(this).val(helpTxt);
		
		$(this).blur(function () {
			if($(this).val() == '') { $(this).val(helpTxt) }
		});
		$(this).focus(function() {
			if($(this).val() == helpTxt) { $(this).val("") }
		});
	});
	$('.btn1').hover(
		function(){
			$(this).addClass('hover');
		},//over
		function(){
			$(this).removeClass('hover');
		}//out
	);
	$('.share1').hover(
		function(){
			$(this).addClass('hover');
		},//over
		function(){
			$(this).removeClass('hover');
		}//out
	);
	$('.box1 input').hover(
		function(){
			$(this).addClass('hover');
		},//over
		function(){
			$(this).removeClass('hover');
		}//out
	);
	$('.submit2').hover(
		function(){
			$(this).addClass('hover');
		},//over
		function(){
			$(this).removeClass('hover');
		}//out
	);
	$('.submit3').hover(
		function(){
			$(this).addClass('hover');
		},//over
		function(){
			$(this).removeClass('hover');
		}//out
	);
	$('.window2').hover(
		function(){
			$(this).addClass('hover');
		},//over
		function(){
			$(this).removeClass('hover');
		}//out
	);
	$('.btn2-green').hover(
		function(){
			$(this).addClass('hover');
		},//over
		function(){
			$(this).removeClass('hover');
		}//out
	);
	$('.btn2-grey').hover(
		function(){
			$(this).addClass('hover');
		},//over
		function(){
			$(this).removeClass('hover');
		}//out
	);
	$('#mini-products1 li').hover(
		function(){
			$(this).addClass('hover');
		},//over
		function(){
			$(this).removeClass('hover');
		}//out
	);
	
	// IE 6 Items
	if(jQuery.browser.msie && jQuery.browser.version < 7) {
		
		$(".next1").pngfix({sizingMethod: "scale"});
		$(".share1 a").pngfix();
	}
	
	
});