// function to open a given url in child window
function getPage(goTo)
{
	if(frames['appFrame']) 
	{ 
		frames['appFrame'].document.location.href=''+config['a_url']+goTo; 
	}
	else
	{
		//alert(''+config['a_url']+goTo);
		document.location.href=''+config['a_url']+goTo; 
	}
}

// expand textarea
function expandTextarea(textareaId, lineHeight)
{
	// get current number of lines
	var content = document.getElementById(textareaId).value;
	var lines   = content.split("\n").length;
	
	if(lines > (lineHeight-1) && lines < 40) 
	{
		document.getElementById(textareaId).style.height = ((lines+1)*16) + "px";
	}
	if(lines < (lineHeight-1)) 
	{
		document.getElementById(textareaId).style.height = ((lineHeight)*16) + "px";
	}
	
	goSetHeight();
	
	document.getElementById(textareaId).focus();
}

// confirm friend request
function friend_added(friend)
{
	var html = 'Din förfrågan har skickats till ' + friend + '.<br/>';
	html += 'Nu får du vänta och hoppas på att din vännerförfrågan blir godkänd.<br/>';
	html += '<br/>';
	html += '<input type="button" class="button" onclick="mcmsDivPopup.popup_hide(mcmsDivPopup.old_unique_id);" value="Ok" />';
	document.getElementById('popupFriendAdd_dynamic').innerHTML = html;
}

// -------------------------------------------------
// to open a child window with no features
// -------------------------------------------------
function wino(strURL, strName, intWidth, intHeight, scrollBars)
{
	scrollBars = (scrollBars != undefined && scrollBars != "undefined" && scrollBars == "scrollbars") ? '1' : '0';
	window.open(strURL, strName, "width="+intWidth+",height="+intHeight+",scrollbars="+scrollBars+",status=0,toolbar=0");
}