tinyMCEPopup.requireLangPack();

var Maple4Dialog = {
	init : function(ed) {
		tinyMCEPopup.resizeToInnerSize();
	},

	insert : function(file, title) {
		var ed = tinyMCEPopup.editor, dom = ed.dom;

		tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', {
			src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file,
			alt : title,
			title : title,
			border : 0
		}));

		tinyMCEPopup.close();
	},


	insertsimple : function(file, title) {
		var ed = tinyMCEPopup.editor, dom = ed.dom;

			now= new  Date();
			zz=("d" + now.getHours() + "d" + now.getMinutes()+"d"+now.getSeconds())+
			("d" + (now.getMonth() + 1) + "d" + now.getDate() + "d" + 
			(1900 + now.getYear()))+Math.random()*1000000;

		tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', {
			src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file,
			alt : title+zz,
			title : 'Maple4 Site Creator Object - Simple HTML Code',
			border : 0
		}));

		tinyMCEPopup.close();
	},

	insertpictures : function(file, title) {
		var ed = tinyMCEPopup.editor, dom = ed.dom;

			now= new  Date();
			zz=("d" + now.getHours() + "d" + now.getMinutes()+"d"+now.getSeconds())+
			("d" + (now.getMonth() + 1) + "d" + now.getDate() + "d" + 
			(1900 + now.getYear()))+Math.random()*1000000;

		tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', {
			src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file,
			alt : title+zz,
			title : 'Maple4 Site Creator Object - Pictures',
			border : 0
		}));

		tinyMCEPopup.close();
	},


	insertpanels : function(file, title) {
		var ed = tinyMCEPopup.editor, dom = ed.dom;

			now= new  Date();
			zz=("d" + now.getHours() + "d" + now.getMinutes()+"d"+now.getSeconds())+
			("d" + (now.getMonth() + 1) + "d" + now.getDate() + "d" + 
			(1900 + now.getYear()))+Math.random()*1000000;

		tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', {
			src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file,
			alt : title+zz,
			title : 'Maple4 Site Creator Object - Panels',
			border : 0
		}));

		tinyMCEPopup.close();
	},


	insertmenus : function(file, title) {
		var ed = tinyMCEPopup.editor, dom = ed.dom;

			now= new  Date();
			zz=("d" + now.getHours() + "d" + now.getMinutes()+"d"+now.getSeconds())+
			("d" + (now.getMonth() + 1) + "d" + now.getDate() + "d" + 
			(1900 + now.getYear()))+Math.random()*1000000;

		tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', {
			src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file,
			alt : title+zz,
			title : 'Maple4 Site Creator Object - Menu',
			border : 0
		}));

		tinyMCEPopup.close();
	},


	insertnews : function(file, title) {
		var ed = tinyMCEPopup.editor, dom = ed.dom;

			now= new  Date();
			zz=("d" + now.getHours() + "d" + now.getMinutes()+"d"+now.getSeconds())+
			("d" + (now.getMonth() + 1) + "d" + now.getDate() + "d" + 
			(1900 + now.getYear()))+Math.random()*1000000;

		tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', {
			src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file,
			alt : title+zz,
			title : 'Maple4 Site Creator Object - News',
			border : 0
		}));

		tinyMCEPopup.close();
	},


	insertmultimedia : function(file, title) {
		var ed = tinyMCEPopup.editor, dom = ed.dom;

			now= new  Date();
			zz=("d" + now.getHours() + "d" + now.getMinutes()+"d"+now.getSeconds())+
			("d" + (now.getMonth() + 1) + "d" + now.getDate() + "d" + 
			(1900 + now.getYear()))+Math.random()*1000000;

		tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', {
			src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file,
			alt : title+zz,
			title : 'Maple4 Site Creator Object - Multimedia',
			border : 0
		}));

		tinyMCEPopup.close();
	},




	insertproducts : function(file, title) {
		var ed = tinyMCEPopup.editor, dom = ed.dom;

			now= new  Date();
			zz=("d" + now.getHours() + "d" + now.getMinutes()+"d"+now.getSeconds())+
			("d" + (now.getMonth() + 1) + "d" + now.getDate() + "d" + 
			(1900 + now.getYear()))+Math.random()*1000000;

		tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', {
			src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file,
			alt : title+zz,
			title : 'Maple4 Site Creator Object - Products',
			border : 0
		}));

		tinyMCEPopup.close();
	}





};

tinyMCEPopup.onInit.add(Maple4Dialog.init, Maple4Dialog);
