// JavaScript Document
function newWindow(url)
{
	window.open(url,'mywindow','width=400,height=200,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes');
}
function getStyle(el,styleProp)
{
	var x = document.getElementById(el);
	if (x.currentStyle)
		var y = x.currentStyle[styleProp];
	else if (window.getComputedStyle)
		var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
	return y;
}
function clearText(target, text)
{
	var x = document.getElementById(target).value;
	document.getElementById(target).style.color = '#000';
	if( x == text)
	{
		document.getElementById(target).value = '';
	}
}
function checkValues(id, id2, target)
{
	var str1 = document.getElementById(id).value;
	var str2 = document.getElementById(id2).value;
	if( str1 == str2)
	{
		document.getElementById(target).style.display = 'none';
	} else {
		document.getElementById(target).style.display = 'block';
	}
}
function clearTextarea(target, text)
{
	var x = document.getElementById(target).innerHTML;
	document.getElementById(target).style.color = '#000';
	if( x == text)
	{
		document.getElementById(target).innerHTML = '';
	}
}
function toggleID(id)
{
	status = getStyle(id,'display');
	if( status != 'block')
	{
		document.getElementById(id).style.display = 'block';
	} else
	{
		document.getElementById(id).style.display = 'none';
	}
}
function toggleBar(bar_id, switch_id)
{
	var status = document.getElementById(bar_id).style.display;
	if( status != 'block')
	{
		document.getElementById(switch_id).style.backgroundImage = 'url(/inc/images/interface/menupoint_down.png)';
		document.getElementById(bar_id).style.display = 'block';
	} else
	{
		document.getElementById(switch_id).style.backgroundImage = 'url(/inc/images/interface/menupoint_up.png)';
		document.getElementById(bar_id).style.display = 'none';
	}
}
function toggleDetailsPane(bar_id, switch_id)
{
	var status = document.getElementById(bar_id).style.display;
	if( status != 'block')
	{
		document.getElementById(switch_id).style.backgroundPosition = 'bottom';
		document.getElementById(bar_id).style.display = 'block';
	} else
	{
		document.getElementById(switch_id).style.backgroundPosition = 'top';
		document.getElementById(bar_id).style.display = 'none';
	}
}
function hideID(id)
{
	document.getElementById(id).style.display = 'none';
}
function showID(id)
{
	document.getElementById(id).style.display = 'block';
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function hoverBall(id, img)
{
	document.getElementById(id).src = 'url(/inc/images/'+img+'_hover.png)';
}
function removeHover(id, img)
{
	document.getElementById(id).src = 'url(/inc/images/'+img+'.png)';
}
function drawLine( lineObjectHandle, Ax, Ay, Bx, By, lineImgPath)
{
	var lineObject = document.getElementById(lineObjectHandle);
    /*
     *	lineObjectHandle = an IMG tag with position:absolute
     */
    var
        xMin        = Math.min( Ax, Bx ),
        yMin        = Math.min( Ay, By ),
        xMax        = Math.max( Ax, Bx ),
        yMax        = Math.max( Ay, By ),
        boxWidth    = Math.max( xMax-xMin, 1 ),
        boxHeight   = Math.max( yMax-yMin, 1 ),
        tmp         = Math.min( boxWidth, boxHeight ),
        smallEdge   = 1,
        newSrc;


    while( tmp>>=1 )
        smallEdge<<=1;
	if( boxWidth > 64 || boxHeight > 64){ distance='256';}
	if( boxWidth < 64 || boxHeight < 64){ distance='256';}
	if( boxWidth < 32 || boxHeight < 32){ distance='32';}
	if( boxWidth < 8 || boxHeight < 8){ distance='8';}
	if( boxWidth < 4 || boxHeight < 4){ distance='4';}
	if( Ay > By){ lineObject.src = '/inc/images/'+distance+'_1down.gif';} else{ lineObject.src = '/inc/images/'+distance+'_1up.gif';}
	
    with( lineObject.style )
    {
        width   = boxWidth	+"px";
        height  = boxHeight	+"px";
        left    = xMin		+"px";
        top     = yMin		+"px";
    }
}
function Set_Cookie( name, value, expires, path, domain, secure )
{
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );

/*
if the expires variable is set, make the correct
expires time, the current script below will set
it for x number of days, to make it for hours,
delete * 24, for minutes, delete * 60 * 24
*/
if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}
function Get_Cookie( check_name ) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f

	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );


		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');

		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return null;
	}
}
function Delete_Cookie( name, path, domain ) {
if ( Get_Cookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
var xmlHttp
var xmlHttp2
var xmlHttp3
var xmlHttpSelect
var xmlHttpAddSites
var xmlHttpRemoveSite

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}

function showForumnews(domain)
{
		document.getElementById('forum-links').style.display = 'block';
		var xmlHttpForum=GetXmlHttpObject();
		if (xmlHttpForum==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  } 
		xmlHttpForum.onreadystatechange=function()
		{
		if(xmlHttpForum.readyState==4)
		  {
			xhtml = xmlHttpForum.responseText;
		  	document.getElementById('forum-links').innerHTML = xhtml;
		  }
		}
		
		xmlHttpForum.open("GET","/inc/applets/phpbb3.php",true);
		xmlHttpForum.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		xmlHttpForum.send(null);
}
function showBlognews()
{
		document.getElementById('blog-links').style.display = 'block';
}
function updateSelect(domain)
{
		var xmlHttpSelect=GetXmlHttpObject();
		if (xmlHttpSelect==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  } 
		xmlHttpSelect.onreadystatechange=function()
		{
		if(xmlHttpSelect.readyState==4)
		  {
			xhtml = xmlHttpSelect.responseText;
		  	document.getElementById('keyword-select').innerHTML = xhtml;
		  }
		}

		xmlHttpSelect.open("GET","/inc/applets/flashchart/select.php?action=update&domain="+domain,true);
		xmlHttpSelect.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		xmlHttpSelect.send(null);
}
function updateDomainlist(domain)
{
	if(domain != '')
	{
	  	document.getElementById('domain-selectx').display = 'block';
	  	document.getElementById('domain-selectx').visibility = 'visible';
		var	xmlHttpDomainSelect=GetXmlHttpObject();
		if (xmlHttpDomainSelect==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  } 
		xmlHttpDomainSelect.onreadystatechange=function()
		{
		if(xmlHttpDomainSelect.readyState==4)
		  {
			xhtml = xmlHttpDomainSelect.responseText;
		  	document.getElementById('domain-selectx').innerHTML = xhtml;
		  }
		}

		xmlHttpDomainSelect.open("GET","/inc/applets/flashchart/domain-select.php?action=update&domain="+domain,true);
		xmlHttpDomainSelect.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		xmlHttpDomainSelect.send(null);
	} else{ document.getElementById('domain-selectx').display = 'none';}
}
function updateKeywordlist(domain)
{
	if(domain != '')
	{
	  	document.getElementById('keyword-selectx').display = 'block';
		var xmlHttpSelect=GetXmlHttpObject();
		if (xmlHttpSelect==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  } 
		xmlHttpSelect.onreadystatechange=function()
		{
		if(xmlHttpSelect.readyState==4)
		  {
			xhtml = xmlHttpSelect.responseText;
		  	document.getElementById('keyword-selectx').innerHTML = xhtml;
		  }
		}

		xmlHttpSelect.open("GET","/inc/applets/flashchart/keyword-select.php?action=update&domain="+domain,true);
		xmlHttpSelect.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		xmlHttpSelect.send(null);
	} else{ document.getElementById('keyword-selectx').display = 'none';}
}

function addExperiment()
{
		var jotnote = document.getElementById('expnote').value;
		var jotdate = document.getElementById('expdate').value;
		var jotname = document.getElementById('expname').value;
		var jotdomain = document.getElementById('expdomain').value;
		var joturl = document.getElementById('joturl').value;
		var jotkeyword = document.getElementById('jotkeyword').value;

		if(jotdate==''){alert('Du har ikke angivet en dato');} else
		if(jotname==''){alert('Du har ikke angivet et navn');} else
		if(jotdomain==''){alert('Du har ikke angivet et domæne');} else
		{
			var xmlHttp=GetXmlHttpObject();
	
			if (xmlHttp==null)
			  {
			  alert ("Your browser does not support AJAX!");
			  return;
			  } 
			xmlHttp.onreadystatechange=function()
			{
			if(xmlHttp.readyState==4)
			  {
				xhtml = xmlHttp.responseText;
				document.getElementById('my_experiments').innerHTML = xhtml;
			  }
			}
			
			xmlHttp.open("GET","/inc/applets/googlerank/experiments.php?action=update&type=Eksperiment&note="+encodeURIComponent(jotnote)+"&domain="+jotdomain+"&date="+jotdate+"&keyword="+encodeURIComponent(jotkeyword)+"&url="+encodeURIComponent(joturl)+"&name="+encodeURIComponent(jotname),true);
			xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			xmlHttp.send(null);
			document.getElementById('expname').value = '';
			document.getElementById('expdate').value = '';
			document.getElementById('expdomain').selectedIndex = '0';
			document.getElementById('joturl').selectedIndex = '0';
			document.getElementById('jotkeyword').selectedIndex = '0';
			document.getElementById('expnote').value = '';
		}
}
function showExperiments()
{
		var xmlHttp2=GetXmlHttpObject();
		if (xmlHttp2==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  } 
		xmlHttp2.onreadystatechange=function()
		{
		if(xmlHttp2.readyState==4)
		  {
			xhtml = xmlHttp2.responseText;
		  	document.getElementById('my_experiments').innerHTML = xhtml;
		  }
		}
		
		xmlHttp2.open("GET","/inc/applets/googlerank/experiments.php?action=show&domain="+encodeURIComponent('Alle Domæner')+"&type=Eksperiment",true);
		xmlHttp2.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		xmlHttp2.send(null);
}
function addGoal()
{
		var jotnote = document.getElementById('goalnote').value;
		var jotdate = document.getElementById('goaldate').value;
		var jotname = document.getElementById('goalname').value;
		var jotrank = document.getElementById('goalrank').value;
		var jotdomain = document.getElementById('goaldomain').value;
		var joturl = document.getElementById('joturl').value;
		var jotkeyword = document.getElementById('jotkeyword').value;

		if(jotdate==''){alert('Du har ikke angivet en dato');} else
		if(jotname==''){alert('Du har ikke angivet et navn');} else
		if(jotrank==''){alert('Du har ikke angivet et mål');} else
		if(jotdomain==''){alert('Du har ikke angivet et domæne');} else
		{
			var xmlHttp=GetXmlHttpObject();
	
			if (xmlHttp==null)
			  {
			  alert ("Your browser does not support AJAX!");
			  return;
			  } 
			xmlHttp.onreadystatechange=function()
			{
			if(xmlHttp.readyState==4)
			  {
				xhtml = xmlHttp.responseText;
				document.getElementById('my_goals').innerHTML = xhtml;
			  }
			}
			
			xmlHttp.open("GET","/inc/applets/googlerank/goals.php?action=update&type="+encodeURIComponent('Mål')+"&note="+encodeURIComponent(jotnote)+"&domain="+jotdomain+"&date="+jotdate+"&keyword="+encodeURIComponent(jotkeyword)+"&url="+encodeURIComponent(joturl)+"&name="+encodeURIComponent(jotname)+"&rank="+jotrank,true);
			xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			xmlHttp.send(null);
			document.getElementById('goalname').value = '';
			document.getElementById('goaldate').value = '';
			document.getElementById('goalrank').value = '';
			document.getElementById('goaldomain').selectedIndex = '0';
			document.getElementById('joturl').selectedIndex = '0';
			document.getElementById('jotkeyword').selectedIndex = '0';
			document.getElementById('goalnote').value = '';
		}
}
function showGoals()
{
		var xmlHttp2=GetXmlHttpObject();
		if (xmlHttp2==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  } 
		xmlHttp2.onreadystatechange=function()
		{
		if(xmlHttp2.readyState==4)
		  {
			xhtml = xmlHttp2.responseText;
		  	document.getElementById('my_goals').innerHTML = xhtml;
		  }
		}
		
		xmlHttp2.open("GET","/inc/applets/googlerank/goals.php?action=show&domain="+encodeURIComponent('Alle Domæner')+"",true);
		xmlHttp2.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		xmlHttp2.send(null);
}
function addMonitor()
{
		var jottype = document.getElementById('monitortype').value;
		var jotnote = document.getElementById('monitornote').value;
		var jotdate = document.getElementById('monitordate').value;
		var jotname = document.getElementById('monitorname').value;
		var jotrank = document.getElementById('monitorrank').value;
		var jotdomain = document.getElementById('monitordomain').value;
		var joturl = document.getElementById('joturl').value;
		var jotkeyword = document.getElementById('jotkeyword').value;

		if(jottype==''){alert('Du har ikke angivet Højere/Lavere værdi');} else
		if(jotdate==''){alert('Du har ikke angivet en dato');} else
		if(jotrank==''){alert('Du har ikke angivet et mål');} else
		if(jotname==''){alert('Du har ikke angivet et navn');} else
		if(jotdomain==''){alert('Du har ikke angivet et domæne');} else
		{
			var xmlHttp=GetXmlHttpObject();
			if (xmlHttp==null)
			  {
			  alert ("Your browser does not support AJAX!");
			  return;
			  } 
			xmlHttp.onreadystatechange=function()
			{
			if(xmlHttp.readyState==4)
			  {
				xhtml = xmlHttp.responseText;
				document.getElementById('my_monitors').innerHTML = xhtml;
			  }
			}
			
			xmlHttp.open("GET","/inc/applets/googlerank/jotter.php?action=update&type="+encodeURIComponent(jottype)+"&note="+encodeURIComponent(jotnote)+"&domain="+jotdomain+"&date="+jotdate+"&keyword="+encodeURIComponent(jotkeyword)+"&url="+encodeURIComponent(joturl)+"&name="+encodeURIComponent(jotname)+"&rank="+jotrank,true);
			xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			xmlHttp.send(null);
			document.getElementById('monitorname').value = '';
			document.getElementById('monitordate').value = '';
			document.getElementById('monitorrank').value = '';
			document.getElementById('monitordomain').selectedIndex = '0';
			document.getElementById('monitortype').selectedIndex = '1';
			document.getElementById('joturl').selectedIndex = '0';
			document.getElementById('jotkeyword').selectedIndex = '0';
			document.getElementById('monitornote').value = '';
		}
}
function showMonitors()
{
		var xmlHttp2=GetXmlHttpObject();
		if (xmlHttp2==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  } 
		xmlHttp2.onreadystatechange=function()
		{
		if(xmlHttp2.readyState==4)
		  {
			xhtml = xmlHttp2.responseText;
		  	document.getElementById('my_monitors').innerHTML = xhtml;
		  }
		}
		
		xmlHttp2.open("GET","/inc/applets/googlerank/jotter.php?action=show&domain="+encodeURIComponent('Alle Domæner')+"&type="+encodeURIComponent('Monitor'),true);
		xmlHttp2.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		xmlHttp2.send(null);
}
function showAlerts()
{
		var xmlHttp2=GetXmlHttpObject();
		if (xmlHttp2==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  } 
		xmlHttp2.onreadystatechange=function()
		{
		if(xmlHttp2.readyState==4)
		  {
			xhtml = xmlHttp2.responseText;
		  	document.getElementById('my_alerts').innerHTML = xhtml;
		  }
		}
		
		xmlHttp2.open("GET","/inc/applets/googlerank/jotter.php?action=show&domain="+encodeURIComponent('Alle Domæner')+"&type="+encodeURIComponent('Alarm'),true);
		xmlHttp2.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		xmlHttp2.send(null);
}

function sendJot()
{
		var jotnote = document.getElementById('jotnote').value;
		var jotdate = document.getElementById('jotdate').value;
		var jotname = document.getElementById('jotname').value;
		var jotdomain = document.getElementById('jotdomain').value;

		if(jotdomain==''){alert('Du har ikke angivet et domæne');} else
		if(jotname==''){alert('Du har ikke angivet en overskrift');} else
		if(jotdate==''){alert('Du har ikke angivet en dato');} else
		{
			var xmlHttp=GetXmlHttpObject();
			if (xmlHttp==null)
			  {
			  alert ("Your browser does not support AJAX!");
			  return;
			  } 
			xmlHttp.onreadystatechange=function()
			{
			if(xmlHttp.readyState==4)
			  {
				xhtml = xmlHttp.responseText;
				document.getElementById('my_jots').innerHTML = xhtml;
			  }
			}
			
			xmlHttp.open("GET","/inc/applets/googlerank/jotter.php?action=update&type=Note&note="+encodeURIComponent(jotnote)+"&domain="+jotdomain+"&date="+jotdate+"&name="+encodeURIComponent(jotname),true);
			xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			xmlHttp.send(null);
			document.getElementById('jotdate').value = '';
			document.getElementById('jotname').value = '';
			document.getElementById('jotnote').value = '';
			document.getElementById('jotdomain').selectedIndex = '0';
		}
}
function showJot(domain)
{
		var xmlHttp2=GetXmlHttpObject();
		if (xmlHttp2==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  } 
		xmlHttp2.onreadystatechange=function()
		{
		if(xmlHttp2.readyState==4)
		  {
			xhtml = xmlHttp2.responseText;
		  	document.getElementById('my_jots').innerHTML = xhtml;
		  }
		}
		
		xmlHttp2.open("GET","/inc/applets/googlerank/jotter.php?action=show&type=Note&domain="+encodeURIComponent(domain),true);
		xmlHttp2.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		xmlHttp2.send(null);
}
function deleteJot(uid, id)
{
		var answer = confirm("Er du sikker på at du vil slette denne note?");
		if( answer)
		{
			var xmlHttp3=GetXmlHttpObject();
			if (xmlHttp3==null)
			  {
			  alert ("Your browser does not support AJAX!");
			  return;
			  } 
			xmlHttp3.onreadystatechange=function()
			{
			if(xmlHttp3.readyState==4)
			  {
				document.getElementById(id).style.display = 'none';
			  }
			}
			
			xmlHttp3.open("GET","/inc/applets/googlerank/jotter.php?action=delete&uid="+uid,true);
			xmlHttp3.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			xmlHttp3.send(null);
		}
}
function showFlashChart()
{
		var f = document.getElementById('iframe1');
		f.src = "/inc/applets/flashchart/flashchart.php";
}
function showFlashChartSite(domain)
{
	if( domain == 'Alle Domæner')
	{
		document.getElementById('popularity').innerHTML = '<p>Vælg et domæne</p>';
		document.getElementById('chart-header').innerHTML = 'Keyword Tracker: Gns. for alle sider';
		document.getElementById('keyword-select').innerHTML = '';
		showFlashChart();
		showJot(domain);
	}
	else
	{
		showPopularity(domain);
		updateSelect(domain);
		document.getElementById('chart-header').innerHTML = 'Keyword Tracker: '+domain;
		var f = document.getElementById('iframe1');
		f.src = "/inc/applets/flashchart/sitechart.php?domain="+encodeURIComponent(domain);
		showJot(domain);
	}
}
function showFlashChartKey(domain, keyword)
{
		var f = document.getElementById('iframe1');
		f.src = "/inc/applets/flashchart/keychart.php?domain="+encodeURIComponent(domain)+"&keyword="+encodeURIComponent(keyword);
}
function updateChart()
{
	sendJot();
	showFlashChart();
}
function freshFlashChart()
{
	showJot('Alle Domæner');
	showFlashChart();
}
function showSites(uid, fresh)
{
		var xmlHttpShowSites=GetXmlHttpObject();
		if (xmlHttpShowSites==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  } 
		xmlHttpShowSites.onreadystatechange=function()
		{
		if(xmlHttpShowSites.readyState==4)
		  {
			xhtml = xmlHttpShowSites.responseText;
		  	document.getElementById('site-list').innerHTML = xhtml;
		  }
		}
		
		xmlHttpShowSites.open("GET","/sitelist.php?uid="+uid,true);
		xmlHttpShowSites.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		xmlHttpShowSites.send(null);
}
function showKeywords(uid)
{
		document.getElementById('site-list').innerHTML ='';
		var xmlHttpKeywordshow=GetXmlHttpObject();
		if (xmlHttpKeywordshow==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  } 
		xmlHttpKeywordshow.onreadystatechange=function()
		{
		if(xmlHttpKeywordshow.readyState==4)
		  {
			xhtml = xmlHttpKeywordshow.responseText;
		  	document.getElementById('site-list').innerHTML = xhtml;
		  }
		}
		
		xmlHttpKeywordshow.open("GET","/editkeyword.php?uid="+uid,true);
		xmlHttpKeywordshow.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		xmlHttpKeywordshow.send(null);
}
function removeKeyword(uid, keyword)
{
		var xmlHttpKeyword=GetXmlHttpObject();
		if (xmlHttpKeyword==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  } 
		xmlHttpKeyword.onreadystatechange=function()
		{
		if(xmlHttpKeyword.readyState==4)
		  {
			xhtml = xmlHttpKeyword.responseText;
		  	document.getElementById('site-list').innerHTML = xhtml;
		  }
		}
		var enc_keyword = encodeURI(keyword);
		xmlHttpKeyword.open("GET","/editkeyword.php?action=remove&uid="+uid+"&keyword="+enc_keyword,true);
		xmlHttpKeyword.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		xmlHttpKeyword.send(null);
}
function addKeyword(uid)
{
		var keyword = document.getElementById('keywords').value;
		document.getElementById('keywords').value = '';
		
		var xmlHttpKeywordadd=GetXmlHttpObject();
		if (xmlHttpKeywordadd==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  } 
		xmlHttpKeywordadd.onreadystatechange=function()
		{
		if(xmlHttpKeywordadd.readyState==4)
		  {
			xhtml = xmlHttpKeywordadd.responseText;
		  	document.getElementById('site-list').innerHTML = xhtml;
		  }
		}
		var enc_keyword = encodeURI(keyword);
		xmlHttpKeywordadd.open("POST","/editkeyword.php?action=add&uid="+uid+"&keyword="+enc_keyword,true);
		xmlHttpKeywordadd.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		xmlHttpKeywordadd.send(null);
}
function removeSite(uid)
{
		var xmlHttpRemoveSite=GetXmlHttpObject();
		if (xmlHttpRemoveSite==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  } 
		xmlHttpRemoveSite.onreadystatechange=function()
		{
		if(xmlHttpRemoveSite.readyState==4)
		  {
			xhtml = xmlHttpRemoveSite.responseText;
		  	document.getElementById('site-list').innerHTML = xhtml;
		  }
		}
		
		xmlHttpRemoveSite.open("GET","/sitelist.php?action=remove&uid="+uid,true);
		xmlHttpRemoveSite.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		xmlHttpRemoveSite.send(null);
		document.getElementById('site-list').innerHTML = '';
}
function showPopularity(domain)
{
	var xmlHttpPopularity=GetXmlHttpObject();
	if (xmlHttpPopularity==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	xmlHttpPopularity.onreadystatechange=function()
	{
	if(xmlHttpPopularity.readyState==4)
	  {
		xhtml = xmlHttpPopularity.responseText;
		document.getElementById('popularity').innerHTML = xhtml;
	  }
	}
	
	xmlHttpPopularity.open("GET","/inc/applets/flashchart/popularity.php?domain="+domain,true);
	xmlHttpPopularity.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
	xmlHttpPopularity.send(null);
}
function checkPagerank(url)
{
	var xmlHttpPagerank=GetXmlHttpObject();
	if (xmlHttpPagerank==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	xmlHttpPagerank.onreadystatechange=function()
	{
	if(xmlHttpPagerank.readyState==4)
	  {
		xhtml = xmlHttpPagerank.responseText;
		document.getElementById('pagerank-checker-results').innerHTML = xhtml;
	  }
	}
	
	xmlHttpPagerank.open("GET","/inc/applets/pagerank-checker/pagerank-checker.php?url="+url,true);
	xmlHttpPagerank.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
	xmlHttpPagerank.send(null);
}
function setChartLegends()
{
	var chartoption = Get_Cookie('seotimeline_chartoptions');
	if( chartoption != 'hidechartlegend')
	{
		Set_Cookie( 'seotimeline_chartoptions', 'hidechartlegend', 365, '/', '', '' );
	} else
	{
		Delete_Cookie('seotimeline_chartoptions','/','');
	}
	freshFlashChart();
}
function initChartOption()
{
	var chartoption = Get_Cookie('seotimeline_chartoptions');
	if( chartoption != 'hidechartlegend')
	{
		document.getElementById('chart-option').checked = false;
	} else
	{
		document.getElementById('chart-option').checked = true;
	}
}

