/*-- flash banner --*/
var flashvars = {};
var params = {wmode:"transparent"};
var attributes = {};
if(typeof Ka.Info.MEDIAADMINTAGS == 'undefined') {
	Ka.Info.MEDIAADMINTAGS = '';
}


switch(true) {
	case (Ka.Info.PAGE == 'home.html' || Ka.Info.PAGE == 'pageBuilder/v1/home'):
		swfobject.embedSWF("http://letsplay.dpsg.com/img/lp_homebanner.swf", "top-flash", "955", "200", "9.0.0", "http://clientapps.kickapps.com/letsplay/images/expressInstall.swf", flashvars, params, attributes);
		$j('#ka-home').addClass('current');
		break;
	case (Ka.Info.PAGE == 'pageBuilder/v1/community'):
		swfobject.embedSWF("http://clientapps.kickapps.com/letsplay/images/lp_communitybanner.swf", "top-flash", "955", "286", "9.0.0", "http://clientapps.kickapps.com/letsplay/images/expressInstall.swf", flashvars, params, attributes);
		$j('#ka-community').addClass('current');
		$j('#header, #flash-content').css('height', '286px');
		break;		
	case (Ka.Info.PAGE == 'pageBuilder/v1/articles' || Ka.Util.getLocationParam('adminTags') == 'article' || Ka.Util.getLocationParam('param') == 'article' || Ka.Info.MEDIAADMINTAGS.indexOf('article') != -1):
		swfobject.embedSWF("http://clientapps.kickapps.com/letsplay/images/lp_articlesbanner.swf", "top-flash", "955", "285", "9.0.0", "http://clientapps.kickapps.com/letsplay/images/expressInstall.swf", flashvars, params, attributes);
		$j('#ka-articles').addClass('current');
		$j('#header, #flash-content').css('height', '284px');
		break;
	case (Ka.Info.PAGE == 'pageBuilder/v1/projects' || Ka.Info.PAGE == 'pageBuilder/v1/find-a-project' || Ka.Util.getLocationParam('categories') == 'Project' || Ka.Util.getLocationParam('adminTags') == 'active' || Ka.Util.getLocationParam('param') == 'story' || Ka.Util.getLocationParam('param') == 'project' || Ka.Info.MEDIACATEGORIES == 'Project'):
		swfobject.embedSWF("http://clientapps.kickapps.com/letsplay/images/lp_projectsbanner.swf", "top-flash", "955", "286", "9.0.0", "http://clientapps.kickapps.com/letsplay/images/expressInstall.swf", flashvars, params, attributes);
		$j('#ka-projects').addClass('current');
		$j('#header, #flash-content').css('height', '286px');
		break;
	case (Ka.Info.PAGE == 'pageBuilder/v1/play-ideas' || Ka.Util.getLocationParam('categories') == 'Play%20Idea' || Ka.Info.MEDIACATEGORIES == 'Play Idea' || Ka.Util.getLocationParam('param') == 'playidea'):
		swfobject.embedSWF("http://clientapps.kickapps.com/letsplay/images/lp_playideasbanner.swf", "top-flash", "955", "286", "9.0.0", "http://clientapps.kickapps.com/letsplay/images/expressInstall.swf", flashvars, params, attributes);
		$j('#ka-playideas').addClass('current');
		$j('#header, #flash-content').css('height', '286px');
		break;
	case (Ka.Info.PAGE == 'pageBuilder/v1/about-us' || Ka.Util.getLocationParam('adminTags') == 'news' || Ka.Util.getLocationParam('param') == 'news' || Ka.Info.MEDIAADMINTAGS.indexOf('news') != -1 || Ka.Info.PAGE == 'pageBuilder/v1/q-and-a'):
		//temp till i get new swf banner --- Is this the default/generic page?
		swfobject.embedSWF("http://clientapps.kickapps.com/letsplay/images/lp_genericbanner.swf", "top-flash", "955", "200", "9.0.0", "http://clientapps.kickapps.com/letsplay/images/expressInstall.swf", flashvars, params, attributes);
		$j('#ka-aboutus').addClass('current');
		$j('#header, #flash-content').css('height', '200px');
		break;
	default:
		swfobject.embedSWF("http://clientapps.kickapps.com/letsplay/images/lp_genericbanner.swf", "top-flash", "955", "200", "9.0.0", "http://clientapps.kickapps.com/letsplay/images/expressInstall.swf", flashvars, params, attributes);
		$j('#ka-community').addClass('current');
		$j('#header, #flash-content').css('height', '200px');
		break;
}

if(Ka.Info.PAGE == 'home.html' || Ka.Info.PAGE == 'pageBuilder/v1/home' || Ka.Info.PAGE == 'pageBuilder/v1/community') {
	var flashvars = {};
	var params = {wmode:"transparent"};
	var attributes = {};
	swfobject.embedSWF("http://clientapps.kickapps.com/letsplay/images/lp_pollseesaw_nobtns.swf", "poll-widget", "293", "75", "9.0.0", "http://clientapps.kickapps.com/letsplay/images/expressInstall.swf", flashvars, params, attributes);
	//$j(function() { $j('.pds-vote').insertAfter('.pds-total-votes'); });
}

/*-- flash widgets --*/
//HOME top widget
(function(){
   var flashvars = {affiliateSiteId:"185554", widgetId:"452721", width:"741", height:"348", revision:"28"},
   params = {menu:"false", allowfullscreen:"true", allowscriptaccess:"always", wmode:"transparent"},
   attributes = {id:"kickWidget_185554_452721", name:"kickWidget_185554_452721"},
   expressInstallURL = "http://serve.a-widget.com/kickFlash/scripts/expressInstall2.swf?2",
   swfURL = "http://serve.a-widget.com/service/getWidgetSwf.kickAction",
   callback = function(e){ if (e.success==false && swfobject.ua.wk){ document.getElementById("altContentDiv_452721").innerHTML = '<iframe src="http://serve.a-widget.com/kickFlash/js/compiler/iframe.html?asId=185554&widgetId=452721&revision=28" height="348" width="741" frameborder="0" scrolling="no" style="border:none;overflow:hidden;width:741px;height:348px"></iframe>' } } 
   swfobject.embedSWF(swfURL, "altContentDiv_452721", "741", "348", "10", expressInstallURL, flashvars, params, attributes, callback);
})();

//HOME latest discussions
(function(){
   var flashvars = {affiliateSiteId:"185554", widgetId:"453071", width:"263", height:"700", revision:"24"},
   params = {menu:"false", allowfullscreen:"true", allowscriptaccess:"always", wmode:"transparent"},
   attributes = {id:"kickWidget_185554_453071", name:"kickWidget_185554_453071"},
   expressInstallURL = "http://serve.a-widget.com/kickFlash/scripts/expressInstall2.swf?2",
   swfURL = "http://serve.a-widget.com/service/getWidgetSwf.kickAction",
   callback = function(e){ if (e.success==false && swfobject.ua.wk){ document.getElementById("altContentDiv_453071").innerHTML = '<iframe src="http://serve.a-widget.com/kickFlash/js/compiler/iframe.html?asId=185554&widgetId=453071&revision=6" height="700" width="263" frameborder="0" scrolling="no" style="border:none;overflow:hidden;width:263px;height:700px"></iframe>' } }
   swfobject.embedSWF(swfURL, "altContentDiv_453071", "263", "700", "10", expressInstallURL, flashvars, params, attributes, callback);
})();

//HOME play ideas
(function(){
   var flashvars = {affiliateSiteId:"185554", widgetId:"453173", width:"567", height:"323", revision:"3"},
   params = {menu:"false", allowfullscreen:"true", allowscriptaccess:"always", wmode:"transparent"},
   attributes = {id:"kickWidget_185554_453173", name:"kickWidget_185554_453173"},
   expressInstallURL = "http://serve.a-widget.com/kickFlash/scripts/expressInstall2.swf?2",
   swfURL = "http://serve.a-widget.com/service/getWidgetSwf.kickAction",
   callback = function(e){ if (e.success==false && swfobject.ua.wk){ document.getElementById("altContentDiv_453173").innerHTML = '<iframe src="http://serve.a-widget.com/kickFlash/js/compiler/iframe.html?asId=185554&widgetId=453173&revision=3" height="323" width="567" frameborder="0" scrolling="no" style="border:none;overflow:hidden;width:567px;height:323px"></iframe>' } } 
   swfobject.embedSWF(swfURL, "altContentDiv_453173", "567", "323", "10", expressInstallURL, flashvars, params, attributes, callback);
})();

//HOME get involved
(function(){
   var flashvars = {affiliateSiteId:"185554", widgetId:"460976", width:"270", height:"337", revision:"11"},
   params = {menu:"false", allowfullscreen:"true", allowscriptaccess:"always", wmode:"transparent"},
   attributes = {id:"kickWidget_185554_460976", name:"kickWidget_185554_460976"},
   expressInstallURL = "http://serve.a-widget.com/kickFlash/scripts/expressInstall2.swf?2",
   swfURL = "http://serve.a-widget.com/service/getWidgetSwf.kickAction",
   callback = function(e){ if (e.success==false && swfobject.ua.wk){ document.getElementById("altContentDiv_460976").innerHTML = '<iframe src="http://serve.a-widget.com/kickFlash/js/compiler/iframe.html?asId=185554&widgetId=460976&revision=2" height="337" width="270" frameborder="0" scrolling="no" style="border:none;overflow:hidden;width:270px;height:339px"></iframe>' } }
   swfobject.embedSWF(swfURL, "altContentDiv_460976", "270", "339", "10", expressInstallURL, flashvars, params, attributes, callback);
})();

//PLAY IDEAS main widget
(function(){
   var flashvars = {affiliateSiteId:"185554", widgetId:"454780", width:"870", height:"360", revision:"13"},
   params = {menu:"false", allowfullscreen:"true", allowscriptaccess:"always", wmode:"transparent"},
   attributes = {id:"kickWidget_185554_454780", name:"kickWidget_185554_454780"},
   expressInstallURL = "http://serve.a-widget.com/kickFlash/scripts/expressInstall2.swf?2",
   swfURL = "http://serve.a-widget.com/service/getWidgetSwf.kickAction",
   callback = function(e){ if (e.success==false && swfobject.ua.wk){ document.getElementById("altContentDiv_454780").innerHTML = '<iframe src="http://serve.a-widget.com/kickFlash/js/compiler/iframe.html?asId=185554&widgetId=454780&revision=13" height="360" width="870" frameborder="0" scrolling="no" style="border:none;overflow:hidden;width:870px;height:604px"></iframe>' } } 
   swfobject.embedSWF(swfURL, "altContentDiv_454780", "870", "360", "10", expressInstallURL, flashvars, params, attributes, callback);
})();

//PLAY IDEA spotlight
(function(){
   var flashvars = {affiliateSiteId:"185554", widgetId:"462400", width:"366", height:"160", revision:"19"},
   params = {menu:"false", allowfullscreen:"true", allowscriptaccess:"always", wmode:"transparent"},
   attributes = {id:"kickWidget_185554_462400", name:"kickWidget_185554_462400"},
   expressInstallURL = "http://serve.a-widget.com/kickFlash/scripts/expressInstall2.swf?2",
   swfURL = "http://serve.a-widget.com/service/getWidgetSwf.kickAction",
   callback = function(e){ if (e.success==false && swfobject.ua.wk){ document.getElementById("altContentDiv_462400").innerHTML = '<iframe src="http://serve.a-widget.com/kickFlash/js/compiler/iframe.html?asId=185554&widgetId=462400&revision=19" height="160" width="366" frameborder="0" scrolling="no" style="border:none;overflow:hidden;width:366px;height:160px"></iframe>' } } 
   swfobject.embedSWF(swfURL, "altContentDiv_462400", "366", "160", "10", expressInstallURL, flashvars, params, attributes, callback);
})();

//PROJECT video/photo widget
function getFlashHtml(rssUrl){
 var flashHtml = '';
 flashHtml = flashHtml + '<object width="430" height="416" id="kickWidget_185554_456341" type="application/x-shockwave-flash" data="http://serve.a-widget.com/service/getWidgetSwf.kickAction">';
 flashHtml = flashHtml + '<param name="movie" value="http://serve.a-widget.com/service/getWidgetSwf.kickAction"></param>';
 flashHtml = flashHtml + '<param name="FlashVars" value="affiliateSiteId=185554&amp;widgetId=456341&amp;width=430&amp;height=416&amp;revision=10&amp;mediaURL='+escape(rssUrl)+'"></param>';
 flashHtml = flashHtml + '<param name="wmode" value="transparent" ></param><param name="allowFullScreen" value="true" ></param><param name="allowScriptAccess" value="always" ></param>';
 /*flashHtml = flashHtml + '<video width="430" height="416" controls preload="none">';
 flashHtml = flashHtml + '<source src="http://api.kickapps.com/rest/resource/VIDEO/1241619/167021?returnMP4=true" type="video/mp4" />';
 flashHtml = flashHtml + '</video>';*/
 flashHtml = flashHtml + '</object>';
 return flashHtml;
}

//PROJECT main widget
(function(){
   var flashvars = {affiliateSiteId:"185554", widgetId:"458719", width:"870", height:"360", revision:"6"},
   params = {menu:"false", allowfullscreen:"true", allowscriptaccess:"always", wmode:"transparent"},
   attributes = {id:"kickWidget_185554_458719", name:"kickWidget_185554_458719"},
   expressInstallURL = "http://serve.a-widget.com/kickFlash/scripts/expressInstall2.swf?2",
   swfURL = "http://serve.a-widget.com/service/getWidgetSwf.kickAction",
   callback = function(e){ if (e.success==false && swfobject.ua.wk){ document.getElementById("altContentDiv_458719").innerHTML = '<iframe src="http://serve.a-widget.com/kickFlash/js/compiler/iframe.html?asId=185554&widgetId=458719&revision=6" height="360" width="870" frameborder="0" scrolling="no" style="border:none;overflow:hidden;width:870px;height:604px"></iframe>' } } 
   swfobject.embedSWF(swfURL, "altContentDiv_458719", "870", "360", "10", expressInstallURL, flashvars, params, attributes, callback);
})();

//PROJECT spotlight widget
(function(){
   var flashvars = {affiliateSiteId:"185554", widgetId:"462373", width:"395", height:"160", revision:"14"},
   params = {menu:"false", allowfullscreen:"true", allowscriptaccess:"always", wmode:"transparent"},
   attributes = {id:"kickWidget_185554_462373", name:"kickWidget_185554_462373"},
   expressInstallURL = "http://serve.a-widget.com/kickFlash/scripts/expressInstall2.swf?2",
   swfURL = "http://serve.a-widget.com/service/getWidgetSwf.kickAction",
   callback = function(e){ if (e.success==false && swfobject.ua.wk){ document.getElementById("altContentDiv_462373").innerHTML = '<iframe src="http://serve.a-widget.com/kickFlash/js/compiler/iframe.html?asId=185554&widgetId=462373&revision=14" height="160" width="395" frameborder="0" scrolling="no" style="border:none;overflow:hidden;width:395px;height:160px"></iframe>' } } 
   swfobject.embedSWF(swfURL, "altContentDiv_462373", "395", "160", "10", expressInstallURL, flashvars, params, attributes, callback);
})();


//COMMUNITY main widget
(function(){
   var flashvars = {affiliateSiteId:"185554", widgetId:"457284", width:"870", height:"360", revision:"10"},
   params = {menu:"false", allowfullscreen:"true", allowscriptaccess:"always", wmode:"transparent"},
   attributes = {id:"kickWidget_185554_457284", name:"kickWidget_185554_457284"},
   expressInstallURL = "http://serve.a-widget.com/kickFlash/scripts/expressInstall2.swf?2",
   swfURL = "http://serve.a-widget.com/service/getWidgetSwf.kickAction",
   callback = function(e){ if (e.success==false && swfobject.ua.wk){ document.getElementById("altContentDiv_457284").innerHTML = '<iframe src="http://serve.a-widget.com/kickFlash/js/compiler/iframe.html?asId=185554&widgetId=457284&revision=10" height="360" width="870" frameborder="0" scrolling="no" style="border:none;overflow:hidden;width:870px;height:604px"></iframe>' } } 
   swfobject.embedSWF(swfURL, "altContentDiv_457284", "870", "360", "10", expressInstallURL, flashvars, params, attributes, callback);
})();

//COMMUNITY member of the month
(function(){
   var flashvars = {affiliateSiteId:"185554", widgetId:"461002", width:"315", height:"160", revision:"4"},
   params = {menu:"false", allowfullscreen:"true", allowscriptaccess:"always", wmode:"transparent"},
   attributes = {id:"kickWidget_185554_461002", name:"kickWidget_185554_461002"},
   expressInstallURL = "http://serve.a-widget.com/kickFlash/scripts/expressInstall2.swf?2",
   swfURL = "http://serve.a-widget.com/service/getWidgetSwf.kickAction",
   callback = function(e){ if (e.success==false && swfobject.ua.wk){ document.getElementById("altContentDiv_461002").innerHTML = '<iframe src="http://serve.a-widget.com/kickFlash/js/compiler/iframe.html?asId=185554&widgetId=461002&revision=4" height="160" width="315" frameborder="0" scrolling="no" style="border:none;overflow:hidden;width:315px;height:160px"></iframe>' } } 
   swfobject.embedSWF(swfURL, "altContentDiv_461002", "315", "160", "10", expressInstallURL, flashvars, params, attributes, callback);
})();

//COMMUNITY new member widget
(function(){
   var flashvars = {affiliateSiteId:"185554", widgetId:"457293", width:"570", height:"175", revision:"8"},
   params = {menu:"false", allowfullscreen:"true", allowscriptaccess:"always", wmode:"transparent"},
   attributes = {id:"kickWidget_185554_457293", name:"kickWidget_185554_457293"},
   expressInstallURL = "http://serve.a-widget.com/kickFlash/scripts/expressInstall2.swf?2",
   swfURL = "http://serve.a-widget.com/service/getWidgetSwf.kickAction",
   callback = function(e){ if (e.success==false && swfobject.ua.wk){ document.getElementById("altContentDiv_457293").innerHTML = '<iframe src="http://serve.a-widget.com/kickFlash/js/compiler/iframe.html?asId=185554&widgetId=457293&revision=8" height="175" width="570" frameborder="0" scrolling="no" style="border:none;overflow:hidden;width:570px;height:175px"></iframe>' } } 
   swfobject.embedSWF(swfURL, "altContentDiv_457293", "570", "175", "10", expressInstallURL, flashvars, params, attributes, callback);
})();

//ARTICLES main widget
(function(){
   var flashvars = {affiliateSiteId:"185554", widgetId:"461410", width:"870", height:"360", revision:"43"},
   params = {menu:"false", allowfullscreen:"true", allowscriptaccess:"always", wmode:"transparent"},
   attributes = {id:"kickWidget_185554_461410", name:"kickWidget_185554_461410"},
   expressInstallURL = "http://serve.a-widget.com/kickFlash/scripts/expressInstall2.swf?2",
   swfURL = "http://serve.a-widget.com/service/getWidgetSwf.kickAction",
   callback = function(e){ if (e.success==false && swfobject.ua.wk){ document.getElementById("altContentDiv_461410").innerHTML = '<iframe src="http://serve.a-widget.com/kickFlash/js/compiler/iframe.html?asId=185554&widgetId=461410&revision=43" height="360" width="870" frameborder="0" scrolling="no" style="border:none;overflow:hidden;width:870px;height:360px"></iframe>' } } 
   swfobject.embedSWF(swfURL, "altContentDiv_461410", "870", "360", "10", expressInstallURL, flashvars, params, attributes, callback);
})();

//ARTICLES spotlight
(function(){
   var flashvars = {affiliateSiteId:"185554", widgetId:"462432", width:"366", height:"160", revision:"23"},
   params = {menu:"false", allowfullscreen:"true", allowscriptaccess:"always", wmode:"transparent"},
   attributes = {id:"kickWidget_185554_462432", name:"kickWidget_185554_462432"},
   expressInstallURL = "http://serve.a-widget.com/kickFlash/scripts/expressInstall2.swf?2",
   swfURL = "http://serve.a-widget.com/service/getWidgetSwf.kickAction",
   callback = function(e){ if (e.success==false && swfobject.ua.wk){ document.getElementById("altContentDiv_462432").innerHTML = '<iframe src="http://serve.a-widget.com/kickFlash/js/compiler/iframe.html?asId=185554&widgetId=462432&revision=23" height="160" width="366" frameborder="0" scrolling="no" style="border:none;overflow:hidden;width:366px;height:160px"></iframe>' } } 
   swfobject.embedSWF(swfURL, "altContentDiv_462432", "366", "160", "10", expressInstallURL, flashvars, params, attributes, callback);
})();
