function catLink_onmouseout(linkid,linkno)
{
	if (link_clicked[linkno] == 1)
	{
		linkid.style.backgroundColor = "#5483CF";
		linkid.style.color = "White";
	}
	else
	{
		linkid.style.backgroundColor = "white";
		linkid.style.color = "#666666";
	
	}
}

function catLink_onclick(linkid)
{
	linkid.style.backgroundColor = "lightBlue"
}

function myLink_onmouseout(linkid,linkno)
{
	if (link_clicked[linkno] == 1)
	{
		linkid.style.backgroundColor = "#5483CF";
		linkid.style.color = "White";
	}
	else
	{
		linkid.style.backgroundColor = "white";
		linkid.style.color = "#666666";
	
	}
}
function set_cols(thisdiv)
{
	var elementidentifier = "mynewLink" + thisdiv;
	var elementid = document.getElementById(elementidentifier);
	var elementidentifier2 = "myLink" + thisdiv;
	var elementid2 = document.getElementById(elementidentifier2);
	if (link_clicked[thisdiv] == 1)
	{
		elementid.style.backgroundColor = "#5483CF";
		elementid.style.color = "White";
		elementid2.style.backgroundColor = "#5483CF";
		elementid2.style.color = "White";
	}
	else
	{
		elementid.style.backgroundColor = "White";
		elementid.style.color = "#666666";
		elementid2.style.backgroundColor = "White";
		elementid2.style.color = "#666666";
	
	}
}
function myLink_onmouseover(linkid)
{
	linkid.style.backgroundColor = "lightgreen";
	linkid.style.color = "#5483CF"
}


function myLink_onclick(linkid)
{
	myLink.innerText = "wELL DONE";
	linkid.style.backgroundColor = "lightBlue"
}
function swap_kw(kw,linkno)
{
	var loopcount;
	var linkidstr;
	var fullkwstr = kw + " ";
	var objRegExp = new RegExp(fullkwstr);
	//var actOnTag = level_1_cats;
	var kwpresent = objRegExp.test(document.form1.sitekeywords.value);
	if (kwpresent)
	{
		document.form1.sitekeywords.value = document.form1.sitekeywords.value.replace(objRegExp, "");
		//document.myLink2.style.backgroundColor = "blue";
		link_clicked[linkno] = 0;
	}
	else
	{
		var fullkwstr = kw;
		var objRegExp = new RegExp(fullkwstr);
		var kwpresent = objRegExp.test(document.form1.sitekeywords.value);
		if (kwpresent)
		{
			document.form1.sitekeywords.value = document.form1.sitekeywords.value.replace(objRegExp, "");
			link_clicked[linkno] = 0;	
		}
		else
		{	
			document.form1.sitekeywords.value += kw + " ";  
			link_clicked[linkno] = 1;
		}
	}
	set_cols(linkno);

}

function onmouseoutHelp()
{
	var rightdiv = document.getElementById('madly');
	rightdiv.innerHTML = prev_madly_ihtml;
}
function onmouseoverHelp(imageid)
{
	var rightdiv = document.getElementById('madly');
	prev_madly_ihtml = rightdiv.innerHTML;
	switch(imageid)
	{
	case 'title':
		rightdiv.innerHTML = "<img src=\"../images/title_img.gif\" width=\"250\" height=\"300\">";
		break;
	case 'keywords':
		rightdiv.innerHTML = "<img src=\"../images/keywords_img.gif\" width=\"250\" height=\"300\">";
		break;
	case 'url':
		rightdiv.innerHTML = "<img src=\"../images/url_img.gif\" width=\"250\" height=\"300\">";
		break;
	case 'notes':
		rightdiv.innerHTML = "<img src=\"../images/notes_img.gif\" width=\"250\" height=\"300\">";
		break;
	case 'categories':
		rightdiv.innerHTML = "<img src=\"../images/categories_img.gif\" width=\"250\" height=\"300\">";
		break;
	case 'collections':
		rightdiv.innerHTML = "<img src=\"../images/collections_img.gif\" width=\"250\" height=\"300\">";
		break;
	case 'overview':
		rightdiv.innerHTML = "<img src=\"../images/overview_img.gif\" width=\"250\" height=\"300\">";
		break;
	case 'image':
		rightdiv.innerHTML = "<img src=\"../images/image_img.gif\" width=\"250\" height=\"300\">";
		break;
	}
}
function add_sites(collection_id)

{

	// define the variables we'll use

	var win_url, win_width, win_height, win_attribs, win_handle

	

	win_url = "http://www.respexi.com";

	win_url += "/collections/AddSites.php?collid=";

	

	win_url += collection_id;



	// the window width & height

	win_width = 950;

	win_height = 800;


	// the attributes of the new child window, stuff like control of menus, toolbars etc...

	win_attribs = "width=" + win_width + ",height=" + win_height + ",toolbar=0,menubar=0,scrollbars=1" + 

					",resizable=0,location=0,directories=0,status=0"

	

	// open the new window and store the window handle, then set the focus on the new child window

	win_handle = window.open(win_url,"Add Sites",win_attribs);

	win_handle.focus();

}
function open_window(page,title)

{

	// define the variables we'll use

	var win_url, win_width, win_height, win_attribs, win_handle
	// the window width & height
	win_width = 950;
	win_height = 800;
	win_url = page;
	win_title = title;
	// open the window and set its focus	


	// the attributes of the new child window, stuff like control of menus, toolbars etc...

	win_attribs = "width=" + win_width + ",height=" + win_height + ",toolbar=0,menubar=0,scrollbars=1" + 

					",resizable=0,location=0,directories=0,status=0"

	

	// open the new window and store the window handle, then set the focus on the new child window

	win_handle = window.open(win_url,win_title,win_attribs);

	win_handle.focus();

}
function open_help_window(imageid)

{

	// define the variables we'll use

	var win_url, win_width, win_height, win_attribs, win_handle, image_link
	// the window width & height
	win_width = 350;
	win_height = 400;
	win_url = "";
	win_title = imageid;

	switch(imageid)
	{
	case 'title':
		image_link = "<img src=\"../images/title_img.gif\" width=\"250\" height=\"300\">";
		break;
	case 'keywords':
		image_link = "<img src=\"../images/keywords_img.gif\" width=\"250\" height=\"300\">";
		break;
	case 'url':
		image_link = "<img src=\"../images/url_img.gif\" width=\"250\" height=\"300\">";
		break;
	case 'notes':
		image_link = "<img src=\"../images/notes_img.gif\" width=\"250\" height=\"300\">";
		break;
	case 'categories':
		image_link = "<img src=\"../images/categories_img.gif\" width=\"250\" height=\"300\">";
		break;
	case 'collections':
		image_link = "<img src=\"../images/collections_img.gif\" width=\"250\" height=\"300\">";
		break;
	case 'overview':
		image_link = "<img src=\"../images/overview_img.gif\" width=\"250\" height=\"300\">";
		break;
	case 'image':
		image_link = "<img src=\"../images/image_img.gif\" width=\"250\" height=\"300\">";
		break;
	}

	// the attributes of the new child window, stuff like control of menus, toolbars etc...

	win_attribs = "width=" + win_width + ",height=" + win_height + ",toolbar=0,menubar=0,scrollbars=1" + 

					",resizable=0,location=0,directories=0,status=0"

	

	// open the new window and store the window handle, then set the focus on the new child window

	win_handle = window.open(win_url,win_title,win_attribs);
	win_handle.document.open();

	win_handle.document.write(image_link);
	win_handle.focus();

}


