//product into the bag
function bagw(id)
{
	$('#product_id').val(id);
	$('#quantity').val($('#quantity'+id).val());
	$('#form-bag').submit();
}


//load editor
function loadEditor(element)
{
		$("#"+element).htmlarea({
                toolbar: [
                    ["bold", "italic", "underline", "|", "link", "unlink","|","unorderedlist"]
                ],
                toolbarText: $.extend({}, jHtmlArea.defaultOptions.toolbarText, {
                        "bold": "Félkövér",
                        "italic": "Dőlt",
                        "underline": "Aláhúzott",
						"link": "Hivatkozás",
						"unlink": "Hivatkozás törlése",
						"unorderedlist" : "Felsorolás"
                    }),

				 css: "/tpl/szepzold/styles/editorsmall.css",
                // Do something once the editor has finished loading
                loaded: function() {
                    //// 'this' is equal to the jHtmlArea object
                    //alert("jHtmlArea has loaded!");
                    //this.showHTMLView(); // show the HTML view once the editor has finished loading
                }
            });
}

//img alt to title
function imgAltToTitle() {
	$("img:not([title])").each(function() {
		if($(this).attr("alt") != '') {
			$(this).attr("title", $(this).attr("alt"))
		} else {
			//$(this).attr("title", $(this).attr("src"))
		}
	})
}




//run
$(document).ready(function() {
	imgAltToTitle();
});
