function template_sendValue()
{
	if(mainContainer!=null)
	{
		var elem=document.getElementById("template_template");
		if(elem!=null)
		{
			var html=elem.innerHTML; //get the template
			
			var bln=true;
			var i=1;
			var ct="";
			
			//get the contents
			while(bln)
			{
				if(document.getElementById("template_content_"+i)!=null)
				{
					ct=getValue("template_content_"+i);
					ct=ct.replace(/\n/gi,"<br />"); //replacing newlines by <br />
					
					reg=new RegExp("#"+i+"#","gi"); //replacing flags by contents
					html=html.replace(reg,ct);
					i++;
				}
				else bln=false;
			}
			
			mainContainer.insertAdjacentHTML("afterEnd",html); //inserting
			
			//update txthtml value
			window.opener.getCleanHTML();
		}
	}
}
//send the template+content to the editor, after the current container
send the template+content to the editor, after the current container
send the template + content to the editor after the current container
function template_sendValue()
{
	if(mainContainer!=null)
	{
		var elem=document.getElementById("template_template");
		if(elem!=null)
		{
			var html=elem.innerHTML; 
			var bln=true;
			var i=1;
			var ct="";
			while(bln)
			{
				if(document.getElementById("template_content_"+i)!=null)
				{
					ct=getValue("template_content_"+i);
					ct=ct.replace(/\n/gi,"<br />"); 
					reg=new RegExp("#"+i+"#","gi"); 
					html=html.replace(reg,ct);
					i++;
				}
				else bln=false;
			}
			mainContainer.insertAdjacentHTML("afterEnd",html); 
			window.opener.getCleanHTML();
		}
	}
}
function template_sendValue ( ) { if ( mainContainer != null ) { var elem = document . getElementById ( "template_template" ) ; if ( elem != null ) { var html = elem . innerHTML ; var bln = true ; var i = 1 ; var ct = "" ; while ( bln ) { if ( document . getElementById ( "template_content_" + i ) != null ) { ct = getValue ( "template_content_" + i ) ; ct = ct . replace ( / \n / gi , "<br />" ) ; reg = new RegExp ( "#" + i + "#" , "gi" ) ; html = html . replace ( reg , ct ) ; i ++ ; } else bln = false ; } mainContainer . insertAdjacentHTML ( "afterEnd" , html ) ; window . opener . getCleanHTML ( ) ; } } }
send the template+content to the editor, after the current container
send the template + content to the editor after the current container
//get the template //get the contents //replacing newlines by <br /> //replacing flags by contents //inserting //update txthtml value