 jQuery().ready(function() {
  
 /////////// jQuery Start /////////////// 
  
// ------------ Fixed Sorted Forum Tables -------------
	     
 	// Creating Hover Action
	  $("#forumTable tr").hover(
	   function()
	   {
	    $(this).addClass("highlight");
	   },
	   function()
	   {
	    $(this).removeClass("highlight");
	   }
	  );	  
 
 // ------------  Fixed Sorted Stock Tables ---------------
	     
 
 	// Creating Hover Action for Odd Rows
	  $("#sortedStockTable tr").hover(
	   function()
	   {
	    $(this).addClass("highlight");
	   },
	   function()
	   {
	    $(this).removeClass("highlight");
	   }
	  );
	 
 
 // ------------  Stock Tables ---------------
	  
    $("#stockTable").tablesorter();     
  
 	// Creating Hover Action for Odd Rows
	  $("#stockTable tr").hover(
	   function()
	   {
	    $(this).addClass("highlight");
	   },
	   function()
	   {
	    $(this).removeClass("highlight");
	   }
	  );
	
 
   // ------------  Floating Dialog Windows ---------------
    
   // For Long Articles
   $(function() {
		$('a[rel*=longArticleFloatWin]').click(function(e) 
		{
			e.preventDefault();
			var $this = $(this);
			var horizontalPadding = 10;
			var verticalPadding = 10;
			$('<iframe id="externalSite" class="externalSite" frameborder=0 marginheight=0 marginwidth=0 src="' + this.href + '" />').dialog(
			{
				title: ($this.attr('title')) ? $this.attr('title') : 'External Site',
				autoOpen: true,
				width: 650,
				height: 500,
				modal: true,
				resizable: true,
				autoResize: true,
				overlay: {
				opacity: 0.5,
				background: "black"
			}
			}).width(650 - horizontalPadding).height(500 - verticalPadding);           
		});
	});
   
   // For Short Articles or Messages
   $(function() {
		$('a[rel*=shortArticleFloatWin]').click(function(e) 
		{
			e.preventDefault();
			var $this = $(this);
			var horizontalPadding = 10;
			var verticalPadding = 10;
			$('<iframe id="externalSite" class="externalSite" frameborder=0 marginheight=0 marginwidth=0 src="' + this.href + '" />').dialog(
			{
				title: ($this.attr('title')) ? $this.attr('title') : 'External Site',
				autoOpen: true,
				width: 400,
				height: 300,
				modal: true,
				resizable: true,
				autoResize: false,
				overlay: {
				opacity: 0.5,
				background: "black"
			}
			}).width(400 - horizontalPadding).height(300 - verticalPadding);           
		});
	});
   
 // For very short snippet messages
   $(function() {
		$('a[rel*=snippetFloatWin]').click(function(e) 
		{
			e.preventDefault();
			var $this = $(this);
			var horizontalPadding = 10;
			var verticalPadding = 10;
			$('<iframe id="externalSite" class="externalSite" frameborder=0 marginheight=0 marginwidth=0 src="' + this.href + '" />').dialog(
			{
				title: ($this.attr('title')) ? $this.attr('title') : 'External Site',
				autoOpen: true,
				width: 300,
				height: 150,
				modal: true,
				resizable: true,
				autoResize: false,
				overlay: {
				opacity: 0.5,
				background: "black"
			}
			}).width(300 - horizontalPadding).height(150 - verticalPadding);           
		});
	});


// For very short snippet messages
   $(function() {
		$('a[rel*=dialogWin]').click(function(e) 
		{
			e.preventDefault();
			var $this = $(this);
			var horizontalPadding = 10;
			var verticalPadding = 10;
			$('<iframe id="externalSite" class="externalSite" frameborder=0 marginheight=0 marginwidth=0 src="' + this.href + '" />').dialog(
			{
				title: ($this.attr('title')) ? $this.attr('title') : 'External Site',
				autoOpen: true,
				width: 300,
				height: 150,
				modal: true,
				resizable: true,
				autoResize: false,
				buttons: {
				'Delete all items': function() {
					$(this).dialog('close');
				},
				Cancel: function() {
					$(this).dialog('close');
				}
			},
				
				overlay: {
				opacity: 0.5,
				background: "black"
			}
			}).width(300 - horizontalPadding).height(150 - verticalPadding);           
		});
	});


 });
 