

var press = {};
press.releases = "on";
press.articles = "on";
press.research = "on";

function togglePressReleases(section,targetDiv,limit)
{
	if(section)
	{
		if(press[section] == "on") 
		{ 
			press[section] = "off";
			$("#filter_"+section).removeClass("fDown");
		}
		else 
		{ 
			press[section] = "on";
			$("#filter_"+section).addClass("fDown");		
		}
	}
	
	if(!limit)
	{
		limit = "";
	}
	
	$.ajax({
		type: "GET",
		url: "/_ajax.php",
		data: "a=get-press&releases=" + press.releases + "&articles=" + press.articles + "&research=" + press.research + "&limit=" + limit,
		success: function(html){
			
			if(targetDiv)
			{
			 $(targetDiv).html(html);
			}
			else
			{
			
			}$("#press_spot").html(html);
		}
	});

	return false;
}

function quickie(href,obj)
{
	$(".mediaKit_nav a").removeClass("mk_on");
	
	if(obj)
	{
		$(obj).addClass("mk_on");
	}

	$.ajax({
		type: "GET",
		url: "/views/en/media-kit.php",
		data: "ajax=quickie&href=" + href,
		success: function(msg){
			$("#reloaderFrame").html(msg);
	   }
	});
}

function quickieSchool(href,obj)
{
	$(".mediaKit_nav a").removeClass("mk_on");
	
	if(obj)
	{
		$(obj).addClass("mk_on");
	}

	$.ajax({
		type: "GET",
		url: "/views/en/school-kit.php",
		data: "ajax=quickie&href=" + href,
		success: function(msg){
			$("#reloaderFrame").html(msg);
	   }
	});
}

function quickieDemo(href,obj)
{
	$(".mediaKit_nav a").removeClass("mk_on");
	$(".campaigns").removeClass("campaign_on");
	
	if(obj)
	{
		$(obj).addClass("mk_on");
	}
	$("#reloaderFrame").empty();
	
	$.ajax({
		type: "GET",
		url: "/views/en/portfolio.php",
		data: "ajax=quickie&href=" + href,
		success: function(msg){
			$("#reloaderFrame").html(msg);
	   }
	});
}

function quickieProposal(href,obj)
{
	$(".mediaKit_nav a").removeClass("mk_on");
	
	if(obj)
	{
		$(obj).addClass("mk_on");
	}

	$.ajax({
		type: "GET",
		url: "/views/en/proposal.php",
		data: "ajax=quickie&href=" + href,
		success: function(msg){
			$("#reloaderFrame").html(msg);
	   }
	});
}

function chooseCampaign(href,obj)
{
	$(".mediaKit_nav a").removeClass("mk_on");
	$(".campaigns").removeClass("campaign_on");
	$(obj+":parent").addClass("campaign_on");

	name = $(obj).attr("name");
	$("#"+name).addClass("campaign_on");
	
	$("#reloaderFrame").empty();

	$.ajax({
		type: "GET",
		url: "/views/en/portfolio.php",
		data: "ajax=quickie&href=" + href,
		success: function(msg){
			$("#reloaderFrame").html(msg);
	   }
	});
}

function showExample(which)
{
	if(!which)
	{
		which = "stigitizing";
	}
	
	$("#videoDesc").hide();
	$("#videoDesc").html("");
	
	$("#locationScreen").hide();
	$("#signage_example_area").show();
	
	$("#example_hrefs a").each(function(){this.className = "";});
	$("#"+which).addClass("exampleOn");
	
	switch(which) {
		
		case "repurposing":
			$("#videoDesc").html("<b>Repurposing</b><br />The process of using a 30 second to 3 minute video, typically designed for television, and converting it to a 10 or 20 sec clip suited for DOOH. This content manipulation process is typically used when clients are limited in changing the raw creative.");
		break;
		case "stigitizing":
			$("#videoDesc").html("<b>Stigitizing</b><br />The process of using static campaigns designed for billboards and posters, and animating certain aspects of the creative in order to introduce some dynamic elements to a 10 sec clip. This is a very light content manipulation process, typically used when clients are limited in changing the raw creative.");
		break;
		case "flyer-to-digital":
			$("#videoDesc").html("<b>Flyer to Digital</b><br />The process of using  static creative designed for a flyer insert  in newspapers and/or on-campus  distribution, and animating it to achieve a 10 or 20 sec dynamic clip. This is very effective when promoting multiple price points or several products and services under one brand.");
		break;
		case "newspaper-to-digital":
			$("#videoDesc").html("<b>Newspaper to Digital</b><br />The process of using  static creative designed for a newspaper,  and animating it to achieve a 10 or 20 sec dynamic clip. This is very effective when promoting multiple price points or several products and services under one brand.");
		break;
		case "poster-to-digital":
			$("#videoDesc").html("<b>Poster to Digital</b><br />The process of using static creative designed for a poster or billboard,   and animating it to achieve a 10 or 20 sec dynamic clip. This is very effective when promoting multiple price points or several products and services under one brand.");
		break;					
	}
	$("#videoDesc").slideDown("slow");
	swfobject.embedSWF("/swf/signage-examples/" + which + ".swf", "exampleVideo", "625", "300", "9.0.0", "expressInstall.swf");				
}


function popSampleLogin()
{
	$(".popVideoSpace").toggle();

	$.ajax({
		type: "GET",
		url: "/views/en/portfolio.php",
		data: "ajax=quickie&href=portfolio/sample-login",
		success: function(msg){
			$("#flashVideo_online").html(msg);
	   }
	});	
}

function popSampleLoop()
{
	$(".popVideoSpace").toggle();

	$.ajax({
		type: "GET",
		url: "/views/en/portfolio.php",
		data: "ajax=quickie&href=portfolio/sample-loop",
		success: function(msg){
			$("#flashVideo_nex").html(msg);
	   }
	});	
}

function showGamblingVideos()
{
	$("#locationScreen").fadeOut("", function () {
		$("#three_screens").fadeIn("", function () {
		
			swfobject.embedSWF("/swf/jw-player.swf?file=/flv/gambling_1.flv&autostart=true&controlbar=none&screencolor=000000&stretching=exactfit&repeat=always", "location_1", "190", "110", "9.0.0", "expressInstall.swf",flashvars,params,attributes);
			swfobject.embedSWF("/swf/jw-player.swf?file=/flv/gambling_2.flv&autostart=true&controlbar=none&screencolor=000000&stretching=exactfit&repeat=always", "location_2", "190", "110", "9.0.0", "expressInstall.swf",flashvars,params,attributes);
			swfobject.embedSWF("/swf/jw-player.swf?file=/flv/gambling_3.flv&autostart=true&controlbar=none&screencolor=000000&stretching=exactfit&repeat=always", "location_3", "190", "110", "9.0.0", "expressInstall.swf",flashvars,params,attributes);
		
		});
	});
}

$(document).ready(function() {

	$("img,div").pngfix();

});