function showComments(pId)
{
	var win;
	// open window
	win = window.open('http://www.snefit.com/products/weblog/comments.asp?id=' + pId,'comments','height=500px,width=500px,scrollbars');
	//win = window.open('/products/weblog/comments.asp?id=' + pId,'comments','height=500px,width=500px,scrollbars');
	// focus
	win.focus();
}

function closeWindow() 
{
	if(window.opener)
	{
		// refresh openener
		window.opener.location.reload();
			
		// focus opener
		window.opener.focus();
	}
			
	// close this window
	window.close()
}

function submitComment() {
	//check text
	if (document.frm_new.inpText.value.length==0) {
		alert('Een leeg bericht sturen heeft niet zoveel zin...');
		return false;
	}
	//check name
	if (document.frm_new.inpName.value.length==0) {
		if (!confirm('U heeft geen naam ingevoerd en dit bericht zal als \'anonieme gebruiker\' weergegeven worden.\n\nIs dit wat u wilt?')) {
			return false;
		}
	}
	//check email
	// not needed for now
			
	return true;
}

function returnResult(sResult)
{
    // return result
    window.returnValue=sResult;
    // close this window
    window.close();
}


function insertSmile(pControl, pString)
{
	
	pControl.focus();
	
	
	if(pControl.selectionStart || pControl.selectionEnd)
	{
		var sSt;
		var sRp;
		var sEn;
		var sTemp;
		
		sSt = pControl.value.substring(0, pControl.selectionStart);
		sEn = pControl.value.substring(pControl.selectionEnd);
		sRp = pControl.value.substring(pControl.selectionStart, pControl.selectionEnd);
		
		sRp = pString;
		
		pControl.value = sSt + pString + sEn;
	}
	else if (document.selection && document.selection.createRange)
	{
		sSel = document.selection.createRange().text;
		if (sSel == '') 
		{
			document.selection.createRange().text = sSel + pString;	
		}
		else
		{
			document.selection.createRange().text = pString;	
		}			
	}
	else if (pControl.value.length == 0)
	{
		pControl.value = pString;
	}
	else
	{
		alert('Helaas ondersteunt uw browser deze functionaliteit niet.');
	}
}


function ShowPhoto(img, control, height, width)
{
	control.src = img;
	if (height.length != 0)
	{
		control.height = height;
	}
	if (width.length != 0)
	{
		control.width = width;
	}
}