/*
$(document).ready(function(){
    $('h1').flash({
        src: 'swf/logo.swf',
		width: 230,
		height: 204		
    });
    $('#home .title').flash({
        src: 'swf/main.swf',
		width: 460,
		height: 270		
    });	
    $('#order').flash({
        src: 'swf/submit.swf',
		width: 220,
		height: 272		
    });		
});

*/
this.swf = function(){
	var container;
	var flashvars = {};
	var attributes = {};
	var params = {
	 	wmode: "transparent"
	};	
	var logo = document.getElementsByTagName("h1")[0];	
	if(logo){
		container = document.createElement("span");
		container.id = "logoContainer";
		logo.appendChild(container);
		swfobject.embedSWF("/static/swf/logo.swf", "logoContainer", "230", "204", "9.0.0", "", flashvars, params, attributes);
	};	
	var homeTitle = document.getElementById("homeTitle");
	if(homeTitle){
		container = document.createElement("span");
		container.id = "homeTitleContainer";
		homeTitle.appendChild(container);
		swfobject.embedSWF("/static/swf/main_hr.swf", "homeTitleContainer", "460", "270", "9.0.0", "", flashvars, params, attributes);
	};	
	var order = document.getElementById("order");
	if(order){
		container = document.createElement("span");
		container.id = "orderContainer";
		order.appendChild(container);
		swfobject.embedSWF("/static/swf/submit_hr.swf", "orderContainer", "220", "272", "9.0.0", "", flashvars, params, attributes);
	};	
};

this.addEvent = function(obj,type,fn){
	if(obj.attachEvent){
		obj['e'+type+fn] = fn;
		obj[type+fn] = function(){obj['e'+type+fn](window.event );}
		obj.attachEvent('on'+type, obj[type+fn]);
	} else {
		obj.addEventListener(type,fn,false);
	};
};
addEvent(window,"load",swf);

this.newsletter = function(){	
	
	var nameTxt = $("label[for='name']").text();
	var emailTxt = $("label[for='l399053-399053']").text();
	$("#name").val(nameTxt);
	$("#l399053-399053").val(emailTxt);
	$("#name").focus(function(){	
    	if($(this).val() == nameTxt) $(this).val("");
	});	
	$("#l399053-399053").focus(function(){	
		if($(this).val() == emailTxt) $(this).val("");
	});		

	//$(obj).each(function(){	
    //});	
};

this.init = function(){
	swf();
	newsletter();	
};
$(document).ready(function(){	
	init();	
});
