/*
 * Superfish v1.4.8 - jQuery menu widget
 * Copyright (c) 2008 Joel Birch
 *
 * Dual licensed under the MIT and GPL licenses:
 * 	http://www.opensource.org/licenses/mit-license.php
 * 	http://www.gnu.org/licenses/gpl.html
 *
 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
 */
  $.noConflict();




function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toUTCString());
}


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 forgotp(){

if(window.location.href.toString().indexOf("?L=2") != -1)
window.location = "http://iceers.org/index.php?id=330&tx_felogin_pi1[forgot]=1&L=2";
else
window.location = "http://iceers.org/index.php?id=330&tx_felogin_pi1[forgot]=1";
}


function loginfun(){
if((window.location.href.toString()!='http://iceers.org/home.html') && (window.location.href.toString()!='http://iceers.org/')     && (window.location.href.toString()!='http://iceers.org/?L=2')&&     (window.location.href.toString()!='http://iceers.org/pagina-principal.html?L=2')  &&     (window.location.href.toString()!='http://iceers.org/home.html?L=2')      &&(window.location.href.toString()!='http://iceers.org/home.html?sl=')){
if(window.location.href.toString().indexOf("?L=2") != -1){
window.location = "http://iceers.org/home.html?sl&L=2";
		setCookie('flag', 1, 10);
		}

else{
	window.location = "http://iceers.org/home.html?sl";
		setCookie('flag', 1, 10);
		}
		}
}









var $q = jQuery.noConflict();
$q(function(){

$q('.rgmediaimages-caption').appendTo('.tx-rgmediaimages-pi1');
$q('.tx-rgmediaimages-pi1').append('<div style=" -moz-border-radius: 4px 4px 0 0;background: none repeat scroll 0 0 #2F4900;    color: #FFFFFF;    left: 767px;    padding-bottom: 2px;    padding-left: 8px;    padding-top: 2px;    position: relative;    top: -605px;    width: 90px;"id="videoInfo">Video Info</div>');
$q('.tx-rgmediaimages-pi1').append('<div style=" background: none repeat scroll 0 0 #2F4900;    color: #FFFFFF;    height: 22px;    left: 767px;    padding-bottom: 2px;    padding-left: 5px;    padding-top: 5px;    position: relative;    top: -330px;    width: 188px;" id="youtubelink"><a style="text-decoration:none;color:#ffffff;" href="http://www.youtube.com/user/ICEERS">Visit ICEERS youtTube channel</a></div>');
$q('#header').append('<iframe scrolling="no" frameborder="0" allowtransparency="true" style="border: medium none; overflow: hidden; width: 132px; height: 21px;" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FInternational-Center-for-Ethnobotanical-Education-Research-and-Service%2F237809716870&amp;layout=button_count&amp;show_faces=false&amp;width=250&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=21" id="facebookid"></iframe>');
$q('#header').append('<a href="http://twitter.com/NGO_ICEERS" class="twitter-follow-button" data-show-count="false" data-show-screen-name="false"></a><script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>');
$q('#header').append('<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:send href="http://iceers.org/about/our-mission.html" font="lucida grande"></fb:send>');



$q('#contentwrapper').prepend('<div class="tx-haltsoftaddtoany-pi1"><a href="http://www.addtoany.com/share_save#url=iceers.org%2Fabout%2Four-mission.html&amp;title=ICEERS%20-%20International%20Center%20for%20Ethnobotanical%20Education%2C%20Research%20%26%20Service&amp;description=" class="a2a_dd"><img border="0" alt="Share/Bookmark/Subscribe" src="typo3conf/ext/haltsoft_addtoany//buttons/favicon.png"></a><script charset="utf-8" src="http://static.addtoany.com/menu/locale/en-US.js" type="text/javascript"></script><!-- AddToAny BEGIN --><script type="text/javascript">a2a_config = {linkurl: "iceers.org/about/our-mission.html", linkname: "ICEERS - International Center for Ethnobotanical Education, Research &amp; Service"}; </script><script src="http://static.addtoany.com/menu/page.js" type="text/javascript"></script><!-- AddToAny END --></div>');



$q('#contentwrapper').prepend('<div id="socialbookmarks"><a  style="margin-right:-4px" href="http://www.addtoany.com/add_to/facebook?linkurl=iceers.org%2Fabout%2Four-mission.html&linkname=ICEERS%20-%20International%20Center%20for%20Ethnobotanical%20Education%2C%20Research%20%26%20Service&linknote="><img width=22 src="http://iceers.org/fileadmin/ICEERS/templates/css/img/facebook_icon.png"></a> <a href="http://www.addtoany.com/add_to/twitter?linkurl=iceers.org%2Fabout%2Four-mission.html&linkname=ICEERS%20-%20International%20Center%20for%20Ethnobotanical%20Education%2C%20Research%20%26%20Service&linknote="><img width=22 src="http://iceers.org/fileadmin/ICEERS/templates/css/img/twitter_icon.png"></a><a href=""> <img width=22 src="http://iceers.org/fileadmin/ICEERS/templates/css/img/myspace_icon.png"border="0" alt="Share on Myspace" /></a><a href="http://www.addtoany.com/add_to/blogger_post?linkurl=iceers.org%2Fabout%2Four-mission.html&linkname=ICEERS%20-%20International%20Center%20for%20Ethnobotanical%20Education%2C%20Research%20%26%20Service&linknote="><img width=22 src="http://iceers.org/fileadmin/ICEERS/templates/css/img/blogspot_icon.png"></a><a href="http://www.linkedin.com/company/iceers--international-center-for-ethnobotanical-education-research-&-service?trk=fc_badge"><img width=22 src="http://iceers.org/fileadmin/ICEERS/templates/css/img/linkedin_icon.png" locale="en" alt="ICEERS -International Center for Ethnobotanical Education, Research & Service on LinkedIn"></a><a href="http://iceers.org/?type=100"><img width=22 src="http://iceers.org/fileadmin/ICEERS/templates/css/img/rss_icon.png"/></a></div>');





if($q("label:contains('Representative')").length > 0){
		$q("#networkvolunform").css("display","none");
		

}


if ($("#loginfunctions")[0].style.display == "none"){ 
		$q(".tx-haltsoftaddtoany-pi1").css("top","-23px");
		}


if($q("h3:contains('Login failure')").length > 0){
		$q("#homelogin-left").css("display","block");
		$q("#facebookid").css("display","none");
		

}



var decoded = $("<div/>").html($q('div.news-single-content').html()).text();

		
$q('.news-single-content').replaceWith(decoded);


var decoded2 = $("<div/>").html($q('div.subheader-news').html()).text();

		
$q('.subheader-news').replaceWith(decoded2);




	if($q("h3:contains('Current status')").length > 0){
		document.getElementById("getinvolved").style.display = "none";
		document.getElementById("loginfunctions").style.display = "none";
		$q("h3:contains('Current status')").css("display", "none");
		$q("label:contains('Username:')").css("display", "none");
		$q(".tx-srfeuserregister-pi1").css("display","none");
		$q("#homelogin-left").css("display","block");

		

	}
	$q(".getinvolvedlink").each(
		function( intIndex ){


$q(this).attr('id',   'getinvolvedlink' + intIndex);
			}
			);
	
	$q(".sectionLink:eq(0)").attr("href", "http://iceers.org/shop/products/detail.html?tx_commerce_pi1%5BcatUid%5D=10&cHash=a5c11f3d42");
	$q(".sectionLink:eq(1)").attr("href", "http://iceers.org/shop/products/detail.html?tx_commerce_pi1%5BcatUid%5D=7&cHash=49de8c7ab1");
	$q(".sectionLink:eq(2)").attr("href", "http://iceers.org/shop/products/detail.html?tx_commerce_pi1%5BcatUid%5D=6&cHash=b57a2a71d4");
	$q(".sectionLink:eq(3)").attr("href", "http://iceers.org/shop/products/detail.html?tx_commerce_pi1%5BcatUid%5D=4&cHash=734bda920e");
	$q(".sectionLink:eq(4)").attr("href", "http://iceers.org/shop/products/detail.html?tx_commerce_pi1%5BcatUid%5D=3&cHash=b1c62f7e89");
	$q(".sectionLink:eq(5)").attr("href", "http://iceers.org/shop/products/detail.html?tx_commerce_pi1%5BcatUid%5D=2&tx_commerce_pi1%5BshowUid%5D=4&cHash=bb39e76635");
	
})





;(function($){
	$.fn.superfish = function(op){

		var sf = $.fn.superfish,
			c = sf.c,
		$arrow = $(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),
			over = function(){
				var $$ = $(this), menu = getMenu($$);
				clearTimeout(menu.sfTimer);
				$$.showSuperfishUl().siblings().hideSuperfishUl();
			},
			out = function(){
				var $$ = $(this), menu = getMenu($$), o = sf.op;
				clearTimeout(menu.sfTimer);
				menu.sfTimer=setTimeout(function(){
					o.retainPath=($.inArray($$[0],o.$path)>-1);
					$$.hideSuperfishUl();
					if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}
				},o.delay);	
			},
			getMenu = function($menu){
				var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
				sf.op = sf.o[menu.serial];
				return menu;
			},
			addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };
			
		return this.each(function() {
			var s = this.serial = sf.o.length;
			var o = $.extend({},sf.defaults,op);
			o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){
				$(this).addClass([o.hoverClass,c.bcClass].join(' '))
					.filter('li:has(ul)').removeClass(o.pathClass);
			});
			sf.o[s] = sf.op = o;
			
			$('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
				if (o.autoArrows) addArrow( $('>a:first-child',this) );
			})
			.not('.'+c.bcClass)
				.hideSuperfishUl();
			
			var $a = $('a',this);
			$a.each(function(i){
				var $li = $a.eq(i).parents('li');
				$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
			});
			o.onInit.call(this);
			
		}).each(function() {
			var menuClasses = [c.menuClass];
			if (sf.op.dropShadows  && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
			$(this).addClass(menuClasses.join(' '));
		});
	};

	var sf = $.fn.superfish;
	sf.o = [];
	sf.op = {};
	sf.IE7fix = function(){
		var o = sf.op;
		if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined)
			this.toggleClass(sf.c.shadowClass+'-off');
		};
	sf.c = {
		bcClass     : 'sf-breadcrumb',
		menuClass   : 'sf-js-enabled',
		anchorClass : 'sf-with-ul',
		arrowClass  : 'sf-sub-indicator',
		shadowClass : 'sf-shadow'
	};
	sf.defaults = {
		hoverClass	: 'sfHover',
		pathClass	: 'overideThisToUse',
		pathLevels	: 1,
		delay		: 400,
		animation	: {opacity:'show'},
		speed		: 'fast',
		autoArrows	: false,
		dropShadows : false,
		disableHI	: true,		// true disables hoverIntent detection
		onInit		: function(){}, // callback functions
		onBeforeShow: function(){},
		onShow		: function(){},
		onHide		: function(){}
	};
	$.fn.extend({
		hideSuperfishUl : function(){
			var o = sf.op,
				not = (o.retainPath===true) ? o.$path : '';
			o.retainPath = false;
			var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
					.find('>ul').hide().css('visibility','hidden');
			o.onHide.call($ul);
			return this;
		},
		showSuperfishUl : function(){
			var o = sf.op,
				sh = sf.c.shadowClass+'-off',
				$ul = this.addClass(o.hoverClass)
					.find('>ul:hidden').css('visibility','visible');
			sf.IE7fix.call($ul);
			o.onBeforeShow.call($ul);
			$ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); });
			return this;
		}
	});

})(jQuery);

