Total cost of revenues increased to $21.9 million for the six months ended June 30, 2012 from $5.5 million for the same period in 2011. The increase of total cost of revenues for the six months ended June 30, 2012 was primarily due to the significant increase in costs associated with the TV advertising business segment.
Gross profit for the six months ended June 30, 2012 was $6.2 million compared to $10.6 million in the same period a year ago. Gross margin decreased to 22.0% from 66.1% for the same period in 2011 as a result of the significant increase of the low margin TV advertising revenue, which accounted for approximately 59% of total revenues in the first half of 2012 compared to 17% for the same period of 2011.
Operating expenses for the six months ended June 30, 2012 were approximately $5.2 million, an increase of 24% from $4.2 million in the comparable period in 2011. General and administrative expenses increased by $1.2 million to $3.1 million due to the increase in the allowance for doubtful accounts and amortization expenses related to the intangible assets identified in the acquisition transactions consummated in 2011 and the inclusion of expenses incurred by operating entities that we acquired or incorporated in the second half of 2011. Selling expenses decreased 13% year-over-year to $1.4 million, as the Company reduced brand building investments in response to the slowdown in small business activity in China.
The Company generated $0.9 million of operating income in the six months ended June 30, 2012 compared to $6.4 million in the same period a year ago.GAAP net income attributable to common stockholders for the first half of 2012 was $0.5 million and earnings per share was $0.02 compared to $5.5 million and $0.28 for the first half of 2011, respectively. Non-GAAP adjusted net income attributable to common stockholders and earnings per share for the first half of 2012 were $5.3 million and $0.27, respectively. The weighted average shares outstanding for the first six months of 2012 and 2011 was 22.2 million shares and 20.4 million shares, respectively.