﻿var IE6 = (window.VBArray && document.implementation);

if (IE6) try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {}  

function FlashObject(swf, width, height, bgcolor, flashvars)
{
	var strFlashTag = new String();

	if (navigator.appName.indexOf("Microsoft") != -1)
	{
		strFlashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
		strFlashTag += 'codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=version=8,0,0,0" ';
		strFlashTag += 'width="' + width + '" height="' + height + '">';
		strFlashTag += '<param name="movie" value="' + swf + '"/>';
		if(flashvars != null) {strFlashTag += '<param name="flashvars" value="' + flashvars + '"/>'};
		strFlashTag += '<param name="quality" value="best"/>';
		strFlashTag += '<param name="bgcolor" value="' + bgcolor + '"/>';
		strFlashTag += '<param name="menu" value="false"/>';
		strFlashTag += '<param name="salign" value="LT"/>';
		strFlashTag += '<param name="scale" value="noscale"/>';
		strFlashTag += '<param name="wmode" value="transparent"/>';
		strFlashTag += '<param name="allowScriptAccess" value="sameDomain"/>';
		strFlashTag += '</object>';
	}
	else
	{
		strFlashTag += '<embed src="' + swf + '" ';
		strFlashTag += 'quality="best" ';
		strFlashTag += 'bgcolor="' + bgcolor + '" ';
		strFlashTag += 'width="' + width + '" ';
		strFlashTag += 'height="' + height + '" ';
		strFlashTag += 'menu="false" ';
		strFlashTag += 'scale="noscale" ';
		strFlashTag += 'salign="LT" ';
		strFlashTag += 'wmode="transparent" ';
		strFlashTag += 'allowScriptAccess="sameDomain" ';
		if(flashvars != null) {strFlashTag += 'flashvars="' + flashvars + '" '};
		strFlashTag += 'type="application/x-shockwave-flash" ';
		strFlashTag += 'pluginspage="https://www.macromedia.com/go/getflashplayer">';
		strFlashTag += '</embed>';
	}

	document.write(strFlashTag);
}

var win_open_handler = null;

function win_open(url, name, width, height, dwidth, dheight,options){
	if (!dwidth) dwidth = 0;
	if (!dheight) dheight = 0;	
	if (!options) options = '';
	posLeft = (screen.width) ? (screen.width-width)/2 : 0;
	posTop = (screen.height) ? (screen.height-height)/2 : 0;
	var str = 'width='+(width+dwidth)+',height='+(height+dheight)+',left='+0+',top='+0+','+options;
	win_open_handler = window.open(url,name,str);
}


$(document).ready(function() 
{

  $(".poll input[type=button]").click(function() {
		id = $(".poll input[name=answer]:checked").val();
		if (id)
		{
			$(".poll ul").css("min-height", $(".poll ul").height()).html("<li><p style=\"margin: 30px 0; text-align: center;\"><img src=\"" + appPath + "/images/loader.gif\" alt=\"\" /></p></li>");
			$.post("vote.aspx", {id:id}, function(data){
				$(".poll ul").hide().html(data).fadeIn("slow") 
			}, "html");
		}
  });
});