/***************************************************** SLIDER FLASH */
var params = {};


// banner principal

swfobject.embedSWF(
	'swf/piecemaker.swf',
	'flashSlider', '1000', '350', '10', null,
	{
		cssSource	: "swf/piecemaker.css",
		xmlSource	: "swf/piecemaker.xml",
		
	}, {
		
		play	: "true",
		menu : "false",
		scale: "showall",
		wmode: "transparent",
		allowfullscreen	: "true",
		allowscriptaccess: "always",
		allownetworking	: "all"

	}, null
);


// Logo magico

swfobject.embedSWF(
	"swf/soluno.swf",
	"isoSwf", "390", "130", "10",
	null, null,
	{
		menu:"false",
		wmode:"transparent",
		scale:"showall"
	},{
		id:"isoSwf",
		name:"isoSwf"
	}
);

/***************************************************** JQUERY VARIAS */
$(document).ready(function() {
	
	/* SERVICIOS HOME - WORK HOME - SEC WORK */
	$('div.servHome ul:nth-child(3n+2), div.workHome li:nth-child(3n+2), div.secWork li:nth-child(3n+2)').addClass('fixIE');

	/* SCROLL PAGE */
	$('.pageScroll, .separadora a').click(function() {
		var elementClicked = $(this).attr("href");
		var destination = $(elementClicked).offset().top;
		$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination-20}, 500 );
		return false;
	});

	/* PORQUE ELEGIRNOS */
	$('div#porQueElegirnos li').mouseover(
		function () {
			$('div#porQueElegirnos li.ico-1').removeClass('selected');
		});

});

/***************************************************** RunOnLoad.js */
function runOnLoad(f) {
    if (runOnLoad.loaded) f();
	else runOnLoad.funcs.push(f); // Otherwise, store it for later
}

runOnLoad.funcs = [];
runOnLoad.loaded = false;

runOnLoad.run = function() {
    if (runOnLoad.loaded) return;

    for(var i = 0; i < runOnLoad.funcs.length; i++) {
        try { runOnLoad.funcs[i](); }
        catch(e) { /* An exception in one function shouldn't stop the rest */ }
    }
    
    runOnLoad.loaded = true;
	delete runOnLoad.funcs;
	delete runOnLoad.run;
};

// Register runOnLoad.run() as the onload event handler for the window
if (window.addEventListener)
    window.addEventListener("load", runOnLoad.run, false);
else if (window.attachEvent) window.attachEvent("onload", runOnLoad.run);
else window.onload = runOnLoad.run;
