$(document).ready(function() {
$(".but").button();
$("#yhteystiedot").ajaxForm({
target: "#debug",
success: function(data) {
$.each(data.items, function(i,item){
if (typeof item.cont != 'undefined') $("#"+item.id).html(item.cont);
if (typeof item.addclass != 'undefined') $("#"+item.id).addClass(item.addclass);
if (typeof item.removeclass != 'undefined') $("#"+item.id).removeClass(item.removeclass);
})
},
dataType: "json"
});
$(".itial").on("focus", function() {
$(this).val('');
$(this).text('');
$(this).css({'color' : 'inherit'});
});
$(".itialt").on("focus", function() {
$(this).html('');
$(this).css({'color' : 'inherit'});
});
var myup = $("#fileuploader").uploadFile({
url:"/upload/index.php",
autoSubmit:true,
multiple:true,
dragDropStr: " tai raahaa tiedostot tähän",
doneStr: "valmis",
uploadStr: "Valitse",
dynamicFormData: function() {
var mesg = new Object;
mesg.sentto = $("[name='sentto']").val();
mesg.nimi = $("[name='nimi']").val();
mesg.email = $("[name='email']").val();
mesg.puhelin = $("[name='puhelin']").val();
mesg.työnimi = $("[name='työnimi']").val();
mesg.työnumero = $("[name='työnumero']").val();
mesg.lisätiedot = $('#lisätiedot').val();
return mesg;
},
returnType:"json",
onSuccess: function(files,data,xhr,pd) {
// $("#debuge").html($("#debuge").html()+"
Success for: "+JSON.stringify(data));
$("body").css("cursor", "default");
$.each(data.items, function(i,item){
if (typeof item.cont != 'undefined') $("#"+item.id).html(item.cont);
if (typeof item.addclass != 'undefined') $("#"+item.id).addClass(item.addclass);
if (typeof item.removeclass != 'undefined') $("#"+item.id).removeClass(item.removeclass);
});
// $(".ajax-file-upload-container").hide();
$("#debug").hide();
$("#loki").html("