	// Notice: The simple theme does not use all options some of them are limited to the advanced theme
function makepopup(theURL,width,height){
	window.open( theURL, "popup" ,"width="+width+",height="+height+",status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes");
}

function makenonpopup(theURL,width,height){
	window.open( theURL);
}


function bbaddlink(){
	//alert ('bbaddlink');
	//makepopup('selectlink.aspx');
	try
	   {
	   source = link_source;
	   }
	catch (err)
	   {
	   source= "";
	   }
	makepopup("/selectlinkRT.asp?"+source,500,400)
	//surroundHTML('<a href="link.htm"><img src="image.gif">','</a>');
	//insertlink('www.cds-studio.co.uk');
	//surroundHTML('inserted ','text ');

}

function bbaddimage(){
	makepopup("/filemanager.aspx?addimage=true",600,500)
	//alert ('bbaddimage');
	
}

function bbaddlargefile(){
	makepopup("/largefilemanager.aspx",600,600)
	//alert ('bbaddimage');
	
}

function bbadddocfile(){
	makepopup("LIBMOD_documentmanagerpopup.asp",600,700)
	//alert ('bbaddimage');
	
}


function bbadddownload(){
	makepopup("/filemanager.aspx?adddownload=true",600,500)
}

function bbaddfeed(){
	makepopup("/selectFeed.asp",500,400)
}

function bbaddclearhr(){
	insertHTML('<hr class="clearboth">');
	
}
//custom script jk 25-01-06 //

function insertlink(thedestination,thetarget) {
	alert(thedestination);
	alert(thetarget);
  if (thedestination) {
	  tinyMCE.insertLink(thedestination,'_self');
	}
}

function surroundHTML(opentag,closetag) {
	//	alert("b1");

	var html = opentag+'{$selection}'+closetag
	//alert(html)
	//	alert("b2");

tinyMCE.execCommand('mceReplaceContent', false, html);
	//	alert("b3");

}
function insertHTML(html) {
  //var html = prompt("Enter some HTML code here","");
  if (html) {
    tinyMCE.execCommand('mceInsertContent', false, html);
  }
}
function bbpretext(page){
	//alert(page);
	makepopup(page,'500','600');
}

