function saveComments(commentaction,usetemplate,usesiteview,collectionid,rootid,divid,formid)
{
  var fields = document.getElementById(formid).elements;
  var fieldvalues = new Array();
  
//   fieldvalues["betreff"] = "test";
  for(ele in fields) 
  {
    try
    {
      fieldvalues[fields[ele].name] = fields[ele].value;
    }
    catch (e)
    {
    }
  } 
  xajax_showComments(commentaction,usetemplate,usesiteview,collectionid,rootid,divid,fieldvalues);
}

function CreateBookmarkLink() {
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(document.title, document.URL, "");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite(document.URL, document.title); }
	else if(window.opera && window.print) { // Opera Hotlist
		return true; }
}

function updateIFrame( height ) {
    var iframe = document.getElementById( 'phorumIframe' );
    iframe.setAttribute( 'height', height+30 );
}

function toggleElement(id)
{
    if(document.getElementById(id))
    {
        if(document.getElementById(id).style.display=='block')
            document.getElementById(id).style.display='none';
        else
            document.getElementById(id).style.display='block';
    }
}

function facebook_onlogin()
{
    document.cookie = "fbli=true";
    document.location.reload();
		//document.location.href=link.split('comments=on').join('comments=add');
}

function facebook_onlogout()
{
    document.location.reload();
}

function getTemplateData(link,text)
{
    return {"link":link,"text":text};
}

function setGoogleSearchbox(name)
{
	var f = document.getElementById(name);
	
	if (!f) 
	{
		f = document.getElementById('searchbox_demo');
	}
	
	if (f && f.q) 
	{
		var q = f.q;
		var n = navigator;
		var l = location;
		
		if (n.platform == 'Win32') 
		{
			q.style.cssText = 'padding: 2px';
		}
		
		var b = function() 
		{
			if (q.value == 'Suche' || q.value == '') {
				//q.style.background = '#FFFFFF url(/images/portal/google.gif) 11.3em no-repeat';
				q.value='Suche';
				q.className='searchBoxNoFocus';
			}
		};
		
		var f = function() 
		{
			if (q.value == 'Suche' || q.value == '') {
				q.value='';
			}
			//q.style.background = '#ffffff';
			q.className='searchBoxFocus';
		};
		
		q.onfocus = f;
		q.onblur = b;
		
		if (!/[&?]q=[^&]/.test(l.search)) 
		{
			b();
		}
	}
}

