jQuery(document).ready(function() {
var $ = jQuery.noConflict();
//all those containers we need to overflow, lets do it here
jQuery("#container, #everything, .my_overflow, #left, #my_content_here, .events_list_item").css("overflow", "auto");
//$("#container").css("overflow-x", "hidden");
jQuery('#slideshow, #news_ticker, #my_slideshow').show();
jQuery('#my_slideshow, #slideshow').cycle();

//our print code, let print the page when print is clicked
jQuery('#print').click(function() {
	window.print();
	return false;
});

//lets load our facebook page
jQuery.get("ajax.php", { source: "facebook" },
   function(data){
	$("#my_social_home").html(data);
   });
jQuery.get("ajax.php", { source: "facebook2" },
   function(data){
	$("#my_social").html(data);
   });
   
jQuery.get("ajax.php", { source: "facebook3" },
   function(data){
	$("#my_social_tv").html(data);
   });
      

//our second level navigation menu items code to activate ajax calls for content
//this content is dicoverable via search bots bcoz of existance of full url which actually return the required content
//facebook style
	jQuery(".za_menuitem").click(function(){

		jQuery("#aboutus_content").prepend("<div id='loading'></div>");
		var my_id = jQuery(this).attr("id");
		
		jQuery(".za_menuitem").removeClass("left_menu_item_selected");
		jQuery("#" + my_id).addClass("left_menu_item_selected");
		jQuery("#corp_right_header").html(jQuery(this).html());
		
	jQuery.get("ajax.php", { source: "page", id:my_id , page_id:page_id},
	   function(data){
		jQuery("#aboutus_content").html(data);
	   });
	return false;
	});

//our news retrieval
jQuery(".headline_menu").click(function(){
		var our_id = jQuery(this).attr("id");
		jQuery(".headline_menu").removeClass("headline_menu_select");
		jQuery("#" + our_id).addClass("headline_menu_select");
		
	jQuery.get("ajax.php", { source: "news", id:our_id},
	   function(data){
		jQuery("#other_website_div").html(data);
	   });		
		return false;
	});

//podcast, lets make them playable
$('.media').media( { width: 255, height: 20 } );


});			



jQuery(document).ready(function()
{
    jQuery(".defaultText").focus(function(srcc)
    {
        if (jQuery(this).val() == jQuery(this)[0].title)
        {
            jQuery(this).removeClass("defaultTextActive");
            jQuery(this).val("");
        }
    });
    
    jQuery(".defaultText").blur(function()
    {
        if (jQuery(this).val() == "")
        {
            jQuery(this).addClass("defaultTextActive");
            jQuery(this).val(jQuery(this)[0].title);
        }
    });
    
    jQuery(".defaultText").blur();        
});

//lavalamp
(function($){$.fn.lavaLamp=function(o){o=$.extend({fx:"linear",speed:500,click:function(){}},o||{});return this.each(function(){var b=$(this),noop=function(){},$back=$('<li class="back"><div class="left"></div></li>').appendTo(b),$li=$("li",this),curr=$("li.current",this)[0]||$($li[0]).addClass("current")[0];$li.not(".back").hover(function(){move(this)},noop);$(this).hover(noop,function(){move(curr)});$li.click(function(e){setCurr(this);return  o.click.apply(this,[e,this])});setCurr(curr);function setCurr(a){$back.css({"left":a.offsetLeft+"px","width":a.offsetWidth+"px"});curr=a};function move(a){$back.each(function(){$(this).dequeue()}).animate({width:a.offsetWidth,left:a.offsetLeft},o.speed,o.fx)}})}})(jQuery);

jQuery.easing={easein:function(x,t,b,c,d){return c*(t/=d)*t+b},easeinout:function(x,t,b,c,d){if(t<d/2)return 2*c*t*t/(d*d)+b;var a=t-d/2;return-2*c*a*a/(d*d)+2*c*a/d+c/2+b},easeout:function(x,t,b,c,d){return-c*t*t/(d*d)+2*c*t/d+b},expoin:function(x,t,b,c,d){var a=1;if(c<0){a*=-1;c*=-1}return a*(Math.exp(Math.log(c)/d*t))+b},expoout:function(x,t,b,c,d){var a=1;if(c<0){a*=-1;c*=-1}return a*(-Math.exp(-Math.log(c)/d*(t-d))+c+1)+b},expoinout:function(x,t,b,c,d){var a=1;if(c<0){a*=-1;c*=-1}if(t<d/2)return a*(Math.exp(Math.log(c/2)/(d/2)*t))+b;return a*(-Math.exp(-2*Math.log(c/2)/d*(t-d))+c+1)+b},bouncein:function(x,t,b,c,d){return c-jQuery.easing['bounceout'](x,d-t,0,c,d)+b},bounceout: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}},bounceinout:function(x,t,b,c,d){if(t<d/2)return jQuery.easing['bouncein'](x,t*2,0,c,d)*.5+b;return jQuery.easing['bounceout'](x,t*2-d,0,c,d)*.5+c*.5+b},elasin: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},elasout: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},elasinout: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},backin:function(x,t,b,c,d){var s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b},backout:function(x,t,b,c,d){var s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},backinout:function(x,t,b,c,d){var 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},linear:function(x,t,b,c,d){return c*t/d+b}};

//jquery news ticker
(function(b){b.fn.ticker=function(p){var e=b.extend({},b.fn.ticker.defaults,p),i="#"+b(this).attr("id"),j=b(this).attr("tagName");return this.each(function(){function f(c){var d=0,k;for(k in c)c.hasOwnProperty(k)&&d++;return d}function g(c){if(e.debugMode)window.console&&window.console.log?window.console.log(c):alert(c)}function l(){if(a.contentLoaded==false){if(e.ajaxFeed)g("Code Me!");else if(e.htmlFeed)if(b(i+" LI").length>0)b(i+" LI").each(function(c){a.newsArr["item-"+c]={type:e.titleText,content:b(this).html()}});
else{g("Couldn't find any content for the ticker to use!");return false}else{g("Couldn't find any content for the ticker to use!");return false}a.contentLoaded=true}b(a.dom.titleElem).html(a.newsArr["item-"+a.position].type);b(a.dom.contentID).html(a.newsArr["item-"+a.position].content);if(a.position==f(a.newsArr)-1)a.position=0;else a.position++;distance=b(a.dom.contentID).width();time=distance/e.speed;b(a.dom.wrapperID).find(a.dom.titleID).fadeIn().end().find(a.dom.titleElem).fadeIn("slow",q)}function q(){if(a.play){var c=
b(a.dom.titleElem).width()+20;b(a.dom.revealID).css("left",c+"px");b(a.dom.revealElem).show(0,function(){b(a.dom.contentID).css("left",c+"px").show();b(a.dom.revealID).css("margin-left","0px").delay(20).animate({marginLeft:distance+"px"},time,"linear",m)})}else return false}function m(){if(a.play){b(a.dom.contentID).delay(e.pauseOnItems).fadeOut("slow");b(a.dom.revealID).hide(0,function(){b(a.dom.tickerID).delay(e.pauseOnItems).fadeOut(e.fadeOutSpeed,function(){b(a.dom.wrapperID).find(a.dom.titleElem+
","+a.dom.revealElem+","+a.dom.contentID).hide().end().find(a.dom.tickerID+","+a.dom.revealID+","+a.dom.titleID).show().end().find(a.dom.tickerID+","+a.dom.revealID+","+a.dom.titleID).removeAttr("style");l()})})}else b(a.dom.revealElem).hide()}function h(){a.play=false;b(a.dom.tickerID+","+a.dom.revealID+","+a.dom.titleID+","+a.dom.titleElem+","+a.dom.revealElem+","+a.dom.contentID).stop(true,true);b(a.dom.revealID+","+a.dom.revealElem).hide();b(a.dom.wrapperID).find(a.dom.titleID+","+a.dom.titleElem).show().end().find(a.dom.contentID).show()}
function n(){a.play=true;a.paused=false;m()}function o(c){h();switch(c){case "prev":if(a.position==0)a.position=f(a.newsArr)-2;else if(a.position==1)a.position=f(a.newsArr)-1;else a.position-=2;b(a.dom.titleElem).html(a.newsArr["item-"+a.position].type);b(a.dom.contentID).html(a.newsArr["item-"+a.position].content);break;case "next":b(a.dom.titleElem).html(a.newsArr["item-"+a.position].type);b(a.dom.contentID).html(a.newsArr["item-"+a.position].content);break}if(a.position==f(a.newsArr)-1)a.position=
0;else a.position++}var a={position:0,time:0,distance:0,newsArr:{},play:true,paused:false,contentLoaded:false,dom:{contentID:"#ticker-content",titleID:"#ticker-title",titleElem:"#ticker-title SPAN",tickerID:"#ticker",wrapperID:"#ticker-wrapper",revealID:"#ticker-swipe",revealElem:"#ticker-swipe SPAN",controlsID:"#ticker-controls",prevID:"#prev",nextID:"#next",playPauseID:"#play-pause"}};if(j!="UL"&&e.htmlFeed===true){g("Cannot use <"+j.toLowerCase()+"> type of element for this plugin - must of type <ul>");
return false}(function(){b(a.dom.wrapperID).append('<div id="'+a.dom.tickerID.replace("#","")+'"><div id="'+a.dom.titleID.replace("#","")+'"><span style="display: none;"><!-- --\></span></div><p id="'+a.dom.contentID.replace("#","")+'"></p><div id="'+a.dom.revealID.replace("#","")+'"><span style="display: none;"><!-- --\></span></div></div>');b(a.dom.wrapperID).removeClass("no-js").addClass("has-js");b(a.dom.tickerElem+","+a.dom.titleElem+","+a.dom.contentID).hide();if(e.controls){b(a.dom.controlsID).live("click mouseover mousedown mouseout mouseup",
function(c){var d=c.target.id;if(c.type=="click")switch(d){case a.dom.prevID.replace("#",""):a.paused=true;b(a.dom.playPauseID).addClass("paused");o(d);break;case a.dom.nextID.replace("#",""):a.paused=true;b(a.dom.playPauseID).addClass("paused");o(d);break;case a.dom.playPauseID.replace("#",""):if(a.play==true){a.paused=true;b(a.dom.playPauseID).addClass("paused");h()}else{a.paused=false;b(a.dom.playPauseID).removeClass("paused");n()}break}else if(c.type=="mouseover"&&b("#"+d).hasClass("controls"))b("#"+
d).addClass("over");else if(c.type=="mousedown"&&b("#"+d).hasClass("controls"))b("#"+d).addClass("down");else if(c.type=="mouseup"&&b("#"+d).hasClass("controls"))b("#"+d).removeClass("down");else c.type=="mouseout"&&b("#"+d).hasClass("controls")&&b("#"+d).removeClass("over")});b(a.dom.wrapperID).append('<ul id="'+a.dom.controlsID.replace("#","")+'"><li id="'+a.dom.playPauseID.replace("#","")+'" class="controls"></li><li id="'+a.dom.prevID.replace("#","")+'" class="controls"></li><li id="'+a.dom.nextID.replace("#",
"")+'" class="controls"></li></ul>')}b(a.dom.contentID).mouseover(function(){a.paused==false&&h()}).mouseout(function(){a.paused==false&&n()});l()})()})};b.fn.ticker.defaults={speed:0.1,ajaxFeed:false,htmlFeed:true,debugMode:true,controls:true,titleText:"Latest",pauseOnItems:2E3,fadeInSpeed:300,fadeOutSpeed:300}})(jQuery);
