function d(){ 
window.open("upload_picture.asp","Expertsforge","location=no,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=no,width=500,height=200");
}
function clr()
{
	document.getElementById('tpass').value="";
}
function uclr()
{
	document.getElementById('tuid').value="";
}
function addTag(tagtype) {
	theSelection = document.selection.createRange().text;
	if(theSelection!="")
	{
	if (!theSelection)
		return false;
	if (document.selection.createRange().parentElement().tagName != 'TEXTAREA')
		return false;
	document.selection.createRange().text = "["+tagtype+"]" + theSelection + "[/"+tagtype+"]";
	}
	else
	{
		return false;	
	}
}
function keypress_handler()
{
	switch (event.keyCode)
	{
		case 66 : // 'B'
			if (event.ctrlKey) // Ctrl-B
			{
				event.keyCode = 0;
				addTag('bold');
				event.returnValue = false;
			}
			break;
		case 73 : // 'I'
			if (event.ctrlKey) // Ctrl-I
			{
				event.keyCode = 0;
				addTag('italic');
				event.returnValue = false;
			}
			break;
		case 79 : // 'O'
			if (event.ctrlKey) // Ctrl-O
			{
				event.keyCode = 0;
				addTag('code');
				event.returnValue = false;  //BRJ: Cancel default browser action: open window dialog
			}
			break;
	}
}
function addHyperlink()
{
	theSelection = document.selection.createRange().text;
	if(theSelection!="")
	{
		if (!theSelection)
			return false;
		if (document.selection.createRange().parentElement().tagName != 'TEXTAREA')
			return false;
		var tlink=prompt("Enter the Link Here","");
		if(tlink!="" && tlink!=null)
		{
			document.selection.createRange().text = "[hyperlink " + tlink + " hyperlink]" + theSelection + "[/hyperlink]";
		}
	}
	else
	{
		return false;	
	}
}
function convertTags() {
	theSelection = document.selection.createRange().text;
	if(theSelection!="")
	{
	if (!theSelection)
		return false;
	if (document.selection.createRange().parentElement().tagName != 'TEXTAREA')
		return false;
	theSelection=theSelection.replace("<b>","[bold]");
	theSelection=theSelection.replace("</b>","[/bold]");
	theSelection=theSelection.replace("<i>","[italic]");
	theSelection=theSelection.replace("</i>","[/italic]");
	document.selection.createRange().text=theSelection;
	
	}
	else
	{
		return false;	
	}
}
function addTagMozilla() {  //To be tested and not used currently
   theSelection = document.getSelection();
   if (!theSelection)
     return false;
   alert(theSelection);
   alert(theSelection.anchorNode);
}