//quote iframes
$(document).ready(function(){
	$(".iframe").colorbox({speed:100, width:"805px", height:"700px", iframe:true, opacity:"0.2", overlayClose:false});
});

//tab init
$(function() {
	$("#tabs").tabs({
		event: 'mouseover'
	});
});


//feeds
google.load("feeds", "1");

function initialize() {
  var feedControl = new google.feeds.FeedControl();
  feedControl.addFeed("http://www.rssmix.com/u/449942/rss.xml");
  feedControl.setNumEntries(20);
  feedControl.setLinkTarget("_blank")
  feedControl.draw(document.getElementById("feedControl"));
}
google.setOnLoadCallback(initialize);



//menu
$(document).ready(function() {
	

	function megaHoverOver(){
		$(this).find(".sub").stop().fadeTo('fast', 1).show();
			
		//Calculate width of all ul's
		(function($) { 
			jQuery.fn.calcSubWidth = function() {
				rowWidth = 0;
				//Calculate row
				$(this).find("ul").each(function() {					
					rowWidth += $(this).width(); 
				});	
			};
		})(jQuery); 
		
		if ( $(this).find(".row").length > 0 ) { //If row exists...
			var biggestRow = 0;	
			//Calculate each row
			$(this).find(".row").each(function() {							   
				$(this).calcSubWidth();
				//Find biggest row
				if(rowWidth > biggestRow) {
					biggestRow = rowWidth;
				}
			});
			//Set width
			$(this).find(".sub").css({'width' :biggestRow});
			$(this).find(".row:last").css({'margin':'0'});
			
		} else { //If row does not exist...
			
			$(this).calcSubWidth();
			//Set Width
			$(this).find(".sub").css({'width' : rowWidth});
			
		}
	}
	
	function megaHoverOut(){ 
	  $(this).find(".sub").stop().fadeTo('fast', 0, function() {
		  $(this).hide(); 
	  });
	}


	var config = {    
		 sensitivity: 100, // number = sensitivity threshold (must be 1 or higher)    
		 interval: 10, // number = milliseconds for onMouseOver polling interval    
		 over: megaHoverOver, // function = onMouseOver callback (REQUIRED)    
		 timeout: 000, // number = milliseconds delay before onMouseOut    
		 out: megaHoverOut // function = onMouseOut callback (REQUIRED)    
	};

	$("ul#topnav li .sub").css({'opacity':'0'});
	$("ul#topnav li").hoverIntent(config);



});

//containers
$(function(){ $('.containers').equalHeights(); });

//expand collapse
$(document).ready(function()
{
  //hide the all of the element with class msg_body
  $(".listentag").hide();
  //toggle the componenet with class msg_body
  $(".listenclick").click(function()
  {
    $(this).next(".listentag").slideToggle(100);
  });
  $(".closetag").click(function()
  {
    $(".listentag").hide();
  });
});

//corners
/*
addEvent(window, 'load', initCorners);

  function initCorners() {
    var settings = {
      tl: { radius: 5 },
      tr: { radius: 5 },
      bl: { radius: 5 },
      br: { radius: 5 },
      antiAlias: true
	} 
    var toponlysettings = {
      tl: { radius: 5 },
      tr: { radius: 5 },
      bl: { radius: 0 },
      br: { radius: 0 },
      antiAlias: true
    }*/

    /*
    Usage:

    curvyCorners(settingsObj, selectorStr);
    curvyCorners(settingsObj, Obj1[, Obj2[, Obj3[, . . . [, ObjN]]]]);

    selectorStr ::= complexSelector [, complexSelector]...
    complexSelector ::= singleSelector[ singleSelector]
    singleSelector ::= idType | classType
    idType ::= #id
    classType ::= [tagName].className
    tagName ::= div|p|form|blockquote|frameset // others may work
    className : .name
    selector examples:
      #mydiv p.rounded
      #mypara
      .rounded
    */
	/*
    curvyCorners(settings, ".categories, .listenclick, .onpage, .framework");
    curvyCorners(toponlysettings, "h4");
  }
	
	var curvyCornersVerbose = false; */
	
	
//scroll
   		$( document ).ready( function ()
			{
				$( 'div.right ul#nav' ).scrollFollow();
			}
		);


