$jq( document ).ready( function( $ ) {
	$( ".removeLastBorder" ).each( function( index ) {
		$( this ).children().last().css( "border", "none" );
	} );
	
	$( ".removeLastMargin" ).each( function( index ) {
		$( this ).children().last().css( "margin", 0 );
	} );
	
	function createVerticalCenterTable() {
		var table = $( document.createElement( "div" ) );
		table.css( "display", "table" );
		table.css( "width", "100%" );
		table.css( "height", "100%" );
		return table;
	}
	
	function createVerticalCenterCell() {
		var cell = $( document.createElement( "div" ) );
		cell.css( "display", "table-cell" );
		cell.css( "width", "100%" );
		cell.css( "height", "100%" );
		cell.css( "vertical-align", "middle" );
		return cell;
	}
	
	$( ".vcenter" ).each( function() {
		var self = $( this );
		
		var table = createVerticalCenterTable();		
		var cell = createVerticalCenterCell();
		table.append( cell );
		
		cell.html( self.html() );
		
		self.html( "" );
		self.append( table );
	} );
	
	$( "a.greenButton, a.yellowButton" ).each( function() {
		var self = $( this );
		
		var left = $( document.createElement( "span" ) );
		left.attr( "class", "left" );
		self.prepend( left );
		
		var right = $( document.createElement( "span" ) );
		right.attr( "class", "right" );
		self.append( right );
	} );
	
	$( ".blogPostPreview" ).first().addClass( "blogPostHighlight" );
} );


/*
Wrote by jose.nobile@gmail.com
Free to use for any purpose
Tested at IE 7, IE 8, FF 3.5.5, Chrome 3, Safari 4, Opera 10
Tested with Object[classid and codebase] < embed >, object[classid and codebase], embed, object < embed > -> Vimeo/Youtube Videos
Please, reporte me any error / issue
*/
$jq( document ).ready( function( jQuery ) {
	// For embed
	jQuery("embed").each(function(i) {
		var elClone = this.cloneNode(true);
		elClone.setAttribute("WMode", "Transparent");
		jQuery(this).before(elClone);
		jQuery(this).remove();
	});	
	// For object and/or embed into objects
	jQuery("object").each(function (i, v) {
		var elEmbed = jQuery(this).children("embed");
		if(typeof (elEmbed.get(0)) != "undefined") {
			if(typeof (elEmbed.get(0).outerHTML) != "undefined") {
				elEmbed.attr("wmode", "transparent");
				jQuery(this.outerHTML).insertAfter(this);
				jQuery(this).remove();
			}
			return true;
		}
		var algo = this.attributes;
		var str_tag = '<OBJECT ';
		for (var i=0; i < algo.length; i++)
			str_tag += algo[i].name + '="' + algo[i].value + '" ';	
		str_tag += '>';
		var flag = false;
		jQuery(this).children().each(function (elem) {
		if(this.nodeName == "PARAM") {
			if (this.name == "wmode") {
				flag=true;
				str_tag += '<PARAM NAME="' + this.name + '" VALUE="transparent">';		
			} else
				str_tag += '<PARAM NAME="' + this.name + '" VALUE="' + this.value + '">';
		}
	});
	
	if(!flag)
		str_tag += '<PARAM NAME="wmode" VALUE="transparent">';		
		str_tag += '</OBJECT>';
		jQuery(str_tag).insertAfter(this);
		jQuery(this).remove();	
	});
} );
