// fxhScript.
//
// Site Design and Implementation by Evadne Wu, ev@monoceroi.com
// http://portfolio.monoceroi.com
//

$.getScript("ui/jquery.scrollTo-min.js",function(){
$(document).ready(function(){
fxhBehaviours.init();});});

var fxhBehaviours = {

	init: function() {

		$("div.fxhComparison").each(function() {	
		
			var prefix = $(this).attr("alt");
			var serial = $(this).attr("rel");
			var gut = "";
		
			$.each(fxhBehaviours.comparisonArray, function(parent, context) {
		
				gut += "<div><img src='ui/fixSample" + prefix + serial + parent + ".png' /><p>" + context + "</p></div>";
		
			});
			
			$(this).html(gut);

		});
		
		$("div.fxhComparison[rel=01]").before("<hr class='spacer' />");

		$("div#fxhContext > h1.numbered").each(function(i) {
			
			$(this).prepend("<span>" + (i+1) + "</span>").before("<hr />");
			
			
		});

		$("a#fxhTriggerCause").click(function() {
		
			$("body").scrollTo($("h2#fxhCause"), 400, {offset: {top:-18}});
			
		});

		$("a#fxhTriggerReact").click(function() {

			$("body").scrollTo($("h2#fxhReact"), 400, {offset: {top:-18}});

		});

	},

	comparisonArray: {
	
		'HeitiTCLight': 'Heiti TC — Light',	
		'HeitiTCMedium': 'Heiti TC — Medium',
		'LiHeiPro': 'LiHei Pro'
	
	}

};
