/***** JQUERY SWFOBJECT *****/

(function(F,B,A){var C=function(H){var G,I=[];for(G in H){I.push(G+'="'+H[G]+'"')}return I.join("")},E=function(I){var G,K,J=[],H;for(G in I){if(typeof I[G]=="object"){H=[];for(K in I[G]){H.push([K,"=",encodeURIComponent(I[G][K])].join(""))}I[G]=H.join("&amp;")}J.push(['<param name="',G,'" value="',I[G],'" />'].join(""))}return J.join("")},D=false;F[B]=(function(){var G="0,0,0",H=navigator.plugins["Shockwave Flash"]||window.ActiveXObject;G=H.description||(function(){try{return(new H("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version")}catch(I){}}());G=G.match(/^[A-Za-z\s]*?(\d+)[\.|,](\d+)(?:\s+r|,)(\d+)/);return{available:G[1]>0,activeX:!H.name,version:{major:G[1]*1,minor:G[2]*1,release:G[3]*1},hasVersion:function(J){var M=this.version,K="major",L="minor",I="release";J=(/string|number/.test(typeof J))?J.toString().split("."):J||[0,0,0];J=[J[K]||J[0]||M[K],J[L]||J[1]||M[L],J[I]||J[2]||M[I],];return(J[0]<M[K])||(J[0]==M[K]&&J[1]<M[L])||(J[0]==M[K]&&J[1]==M[L]&&J[2]<=M[I])},expressInstaller:A,create:function(I){if(!F[B].available||D||!typeof I=="object"||!I.swf){return false}I=F.extend(true,{attrs:{height:I.height||180,width:I.width||320},params:{wmode:I.wmode||"opaque",flashvars:I.flashvars}},I);if(I.hasVersion&&!F[B].hasVersion(I.hasVersion)&&F[B].hasVersion("6.0.65")){D=true;I={swf:I.expressInstaller||F[B].expressInstaller,attrs:{id:"SWFObjectExprInst",height:Math.max(I.height||137),width:Math.max(I.width||310)},params:{flashvars:{MMredirectURL:location.href,MMplayerType:(F[B].activeX)?"ActiveX":"PlugIn",MMdoctitle:document.title.slice(0,47)+" - Flash Player Installation"}}}}return"<object "+(C(I.attrs))+(this.activeX?' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param name="movie" value="'+I.swf+'" />':' type="application/x-shockwave-flash" data="'+I.swf+'">')+(E(I.params))+"</object>"}}}());F.fn[B]=function(G){if(typeof G=="object"){this.each(function(){var H=document.createElement(B);H.innerHTML=F[B].create(G);if(H.childNodes[0]){this.appendChild(H.childNodes[0])}})}else{if(typeof G=="function"){this.find("object").andSelf().filter("object").each(function(){var J={},I=this,H="jsInteractionTimeoutMs";I[H]=I[H]||0;if(I[H]<660){if(I.clientWidth||I.clientHeight){G.call(this)}else{setTimeout(function(){F(I)[B](G)},I[H]+66)}}})}}return this}}(jQuery,"flash","expressInstaller.swf"));


/***** jQuery CooQuery plugin - (c) 2009 Lenon Marcel - Read more: http://cooquery.lenonmarcel.com.br/ (Dual licensed under the MIT and GPL licenses) *****/

;(function($){function is_defined(value){return!(typeof value==='undefined'||value===null);}$.set_cookie=function(name,value,expire,path,domain,secure){if(!is_defined(name))return false;var str=name+'=';if(is_defined(value))str+=encodeURIComponent(value);str+=';';if(typeof expire=='number'){var date=new Date();date.setDate(date.getDate()+expire);str+='expires='+date.toGMTString()+';';}if(is_defined(path))str+='path='+(path)+';';if(is_defined(domain))str+='domain='+(domain)+';';if(is_defined(secure))str+='secure;';return document.cookie=str;};$.delete_cookie=function(name){if(!is_defined(name))return false;$.set_cookie(name,"",-1);};$.read_cookie=function(name){if(!is_defined(name))return false;var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){return decodeURIComponent(cookie.substring(name.length+1));break;}}return null;};})(jQuery);


/***** WICKEDWEB LIGHTBOX || COPYRIGHT WICKEDWEB 2010 ALL RIGHTS RESERVED *****/

function openLightBox(boxID){
	if($('#lightBoxContent:visible').size() > 0){
		$('#lightBoxTitle').fadeOut(500);
		$('#lightBoxInner').stop().fadeTo(500, 0, function(){
			showLightBox(boxID);
		});
	}
	else{
		$('#lightBoxTitle').hide();
		$('#lightBoxInner').fadeTo(0, 0, function(){
			showLightBox(boxID);
		});
	}
}

function closeLightBox(){
	$('#lightBoxContent').stop().fadeTo(500, 0, function(){
		$('#lightBox').stop().fadeTo(500, 0, function(){
			$('#lightBoxContent').hide().width('auto').height('auto');
			$('#lightBox, #lightBoxTitle, #closeLightBoxBtn').hide();
			$('#lightBoxInner').empty();
		});
	});
}

function animateLightBox(){
	$('#lightBoxContent').stop().animate({ 
		width: $('#lightBoxInner').outerWidth(),
		height: $('#lightBoxInner').outerHeight() + $('#lightBoxTop').outerHeight() + $('#lightBoxBtm').outerHeight(),
		marginTop: (-(($('#lightBoxInner').outerHeight() + $('#lightBoxTop').outerHeight() + $('#lightBoxBtm').outerHeight() + ($('#lightBoxContent').outerHeight() - $('#lightBoxContent').height())) / 2)),
		marginLeft: (-(($('#lightBoxInner').outerWidth() + ($('#lightBoxContent').outerWidth() - $('#lightBoxContent').width())) / 2)),
		opacity: 1
	}, 500, function(){
		$('#lightBoxContent').css('filter', '');
		$('#lightBoxInner').css('visibility', 'visible');
		$('#lightBoxTitle, #closeLightBoxBtn').fadeIn(500);
		$('#lightBoxInner').stop().fadeTo(500, 1, function(){
			$('#lightBoxContent, #lightBoxTitle, #closeLightBoxBtn').css('filter', '')
			$('#lightBoxInner').attr('style', '').css('filter', '');
		});
	});
}

function showLightBox(boxID){
	$('#lightBoxInner').css('visibility', 'hidden');
	if($('#lightBoxContent:visible').size() > 0){
		detectContent(boxID);
	}
	else{
		$('#lightBox').stop().show().fadeTo(0, 0).fadeTo(500, 0.75, function(){
			$('#lightBoxContent').stop().show().fadeTo(0, 0, function(){
				detectContent(boxID);
			});
		});
	}
}

function querySt(value, string){
	valueArray = string.split('?').join('&').split('&');
	for(i=0; i<valueArray.length; i++) {
		result = valueArray[i].split('=');
		if(result[0] == value) {
			return result[1];
		}
	}
}

function detectContent(boxID){
	$('#lightBoxInner').width('auto').height('auto');
	$('#lightBoxContent').css('overflow', 'hidden').width($('#lightBoxContent').width()).height($('#lightBoxContent').height()).css('margin', (-($('#lightBoxContent').outerHeight() / 2)) + 'px 0 0 ' + (-($('#lightBoxContent').outerWidth() / 2)) + 'px');
	myTitle = querySt('title', boxID);
	myWidth = querySt('width', boxID);
	myHeight = querySt('height', boxID);
	$('#lightBoxTitle').html(myTitle);
	if(myWidth != undefined){
		$('#lightBoxInner').width(parseInt(myWidth));
	}
	if(myHeight != undefined){
		$('#lightBoxInner').height(parseInt(myHeight));
	}
	if(boxID.indexOf('#') > -1){
		if(boxID.indexOf('?') > -1){
			boxID = boxID.slice(boxID.indexOf('#'), boxID.indexOf('?'));
		}
		else{
			boxID = boxID.slice(boxID.indexOf('#'));
		}
		$('#lightBoxInner').html($(boxID).html());
		animateLightBox();
	}
	else if(boxID.indexOf('.mp3') > -1){
		$('#lightBoxInner').append('<div id="lightBoxMp3"></div>')
		var playerVolume = $.read_cookie('musicVolume')
		if(playerVolume == NaN || playerVolume == undefined || playerVolume == null){
			playerVolume = 50;
		}
		$('#lightBoxMp3').html(mp3Flash);
		$('#lightBoxMp3').flash(function(){
			this.SetVariable('playerVolume', playerVolume);
			this.SetVariable('title', songTitle.toString());
			this.SetVariable('file', boxID.toString());
		});
		animateLightBox();
	}
	else if(boxID.indexOf('.html') > -1 || boxID.indexOf('.htm') > -1 || boxID.indexOf('.php') > -1 || boxID.indexOf('.aspx') > -1){
		animateLightBox();
		$('#lightBoxInner').load(boxID, '', function(){
			animateLightBox();
		});	
	}
	else if(boxID.indexOf('.jpg') > -1 || boxID.indexOf('.gif') > -1 || boxID.indexOf('.png') > -1|| boxID.indexOf('.bmp') > -1){
		$('#lightBoxInner').empty();
		animateLightBox();
		var img = new Image;
		img.onload = function(evt){
			$('#lightBoxInner').fadeTo(0, 0, function(){
				$('#lightBoxInner').html(img);
				$('#lightBoxInner img').width(500).height(281);
				animateLightBox();
			});
    	}
		img.src = boxID;
	}
}

function initLightBox(){
	$('body').append('<div id="lightBox" class="closeLightBox"></div><div id="lightBoxContent"><div id="lightBoxTop"><table><tr><td id="topLeft"><span id="lightBoxTitle"></span></td><td id="topRight"><a id="closeLightBoxBtn" class="closeLightBox" href="Close">Close</a></td></tr></table></div><div id="lightBoxMid1"><div id="lightBoxMid2"><div id="lightBoxInner"></div></div></div><div id="lightBoxBtm"><table><tr><td id="btmLeft"><a id="prevLightBoxBtn" class="prevLightBox" href="Previous">Previous</a></td><td id="btmRight"><a id="nextLightBoxBtn" class="nextLightBox" href="Next">Next</a></td></tr></table></div></div><div id="lightBoxTemp"></div>');
}

$('.lightBox').live('click', function(e){
	openLightBox($(this).attr('href'));
	return false;
});

$('.mp3Link').live('click', function(e){
	window.songTitle = $(this).find('.mp3Title').html();
	var artist = $(this).find('.mp3Artist').html();
	var writer = $(this).find('.mp3Writer').html();
	var info = $(this).find('.mp3Info').html();
	$('#lightBoxInner').append('<div id="mp3Content"></div>');
	if($(this).find('.mp3Image').size() > -1){
		$(this).find('.mp3Image').clone().prependTo('#mp3Content');
	}
	if(songTitle != null){
		$('#mp3Content').append('<h4>' + songTitle + '</h4>');
	}
	if(artist != null){
		$('#mp3Content').append(artist + '<br/>');
	}
	if(writer != null){
		$('#mp3Content').append(writer + '<br/>');
	}
	if(info != null){
		$('#mp3Content').append(info);
	}
	openLightBox($(this).attr('href') + '?title=LISTEN...');
	return false;
})

$('.mp3Linkq').live('click', function(e){
	var mp3href = $(this).attr('href');
	window.songTitle = querySt('mp3title', mp3href);
	var artist = querySt('mp3artist', mp3href);
	var info = querySt('mp3info', mp3href);
	var image = querySt('mp3image', mp3href);
	$('#lightBoxInner').append('<div id="mp3Content"></div>');
	$('#mp3Content').append('<img src="' + image + '" />');
	$('#mp3Content').append('<h4>' + songTitle + '</h4>');
	$('#mp3Content').append(artist + '<br/>');
	$('#mp3Content').append(info);
	openLightBox($(this).attr('href'));
	return false;
})

$('.closeLightBox').live('click', function(){
	closeLightBox()
	return false;
});


/***** MP3 PLAYER  *****/

mp3Flash = $.flash.create({swf:'/static/flash/audioPlayer.swf', params:{wmode:'transparent', AllowScriptAccess:'always'}, height: 130, width: 400});

function setVolume(playerVolume){
	$.set_cookie('musicVolume',[parseInt(playerVolume)]);
}


<!--


function wheatgerm()
{
	if( document.getElementById("wheatgermrecipe").style.display == "block") {
		document.getElementById("wheatgermrecipe").style.display="none";
	} else {
		document.getElementById("wheatgermrecipe").style.display="block";
		document.getElementById("granaryrecipe").style.display="none";
		document.getElementById("whiterecipe").style.display="none";
		document.getElementById("multiseedrecipe").style.display="none";
	}
}

function granary()
{
	if( document.getElementById("granaryrecipe").style.display == "block") {
		document.getElementById("granaryrecipe").style.display="none";
	} else {
		document.getElementById("granaryrecipe").style.display="block";
		document.getElementById("wheatgermrecipe").style.display="none";
		document.getElementById("whiterecipe").style.display="none";
		document.getElementById("multiseedrecipe").style.display="none";
	}
}

function whitegranary()
{
	if( document.getElementById("whiterecipe").style.display == "block") {
		document.getElementById("whiterecipe").style.display="none";
	} else {
		document.getElementById("whiterecipe").style.display="block";
		document.getElementById("granaryrecipe").style.display="none";
		document.getElementById("wheatgermrecipe").style.display="none";
		document.getElementById("multiseedrecipe").style.display="none";
	}
}

function multiseed()
{
	if( document.getElementById("multiseedrecipe").style.display == "block") {
		document.getElementById("multiseedrecipe").style.display="none";
	} else {
		document.getElementById("multiseedrecipe").style.display="block";
		document.getElementById("granaryrecipe").style.display="none";
		document.getElementById("whiterecipe").style.display="none";
		document.getElementById("wheatgermrecipe").style.display="none";
	}
}

function homeVideo(){
	$('.homevideobox').each(function(e){
		$(this).click(function(){
			$('.homevideobox').removeClass('homevideoboxon');
			$(this).addClass('homevideoboxon');
			$('#video0, #video1, #video2, #video3').not('#video' + e).hide();
			$('#video' + e).show();
		});
	});
}

function removeLast(){
	footerStr = $('.footerlink').html();
	footerStr = footerStr.slice(0,-2);
	$('.footerlink').html(footerStr);
}

$(document).ready(function(){
	initLightBox();
	homeVideo();
	removeLast();
});

-->

