(function () {
    var type = 'side';
    var customData = '%7B%22username%22%3A%22cineplex%22%2C%22id%22%3A%22151731377%22%2C%22time%22%3A1283563153%2C%22autoplay%22%3A0%2C%22loop%22%3A0%7D';
    var width = 480;
    var height = 400;
    var id = 'PixnetPlayercineplex1276145115.flv' + Math.random() * 1000000;
    var qs;
    var scripts = document.getElementsByTagName('script');
    var index = scripts.length - 1;
    if (index >= 0) {
        var myScript = scripts[index];
        qs = myScript.src.replace(/^[^\?]+\??/,'');
        var params = qs.split(/[;&]/);
	for (var i=0; i < params.length; i++) {
	    var keyval = params[i].split('=');
	    if ('w' == keyval[0]) {
		width = parseInt(keyval[1]);
	    }
	    if ('h' == keyval[0]) {
		height = parseInt(keyval[1]);
	    }
	}
    }
    if (width <= 0 || height <= 0) {
	width = 480;
	height = 400;
    }
    var pixplayer_url = '//flash.pixfs.net/pixplayer/PixnetPlayer.swf?type=' + type + 
    '&customData=' + customData; 
    document.write(
'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" class="PixnetPlayer" id="' + id + '" width="' + width + '" height="' + height + '" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab#version=9,0,124,0"><param name="movie" value="' + pixplayer_url + '" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /><embed src="' + pixplayer_url + '" quality="high" width="' + width + '" height="' + height + '" name="PixnetPlayer" align="middle" play="true" loop="false" bgcolor="#000000" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"></embed></object>'
	);
})();