It's an escaping issue. In the one branch of the code some javascript vs. PHP escaping takes place, it's just easier to use ' instead of many \" attributes.
According to HTML, this is perfectly alright.
The 2 spaces are not worth searching for, IMHO. They come because of certain if-constructs where either an attribute is appended, or an empty string...
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/