/*
********************************************************************************
* 
* ONLOAD.JS
* Framework Interface
* 
* v2.0 (April 14, 2008)
* 
********************************************************************************
*/
function $INIT() { with (p)
{
	if (DCO.PG_IS_WINDOW) alert(0);
	else
	{
		p.AS			= $E('adv-search');
		  AS.dd			= AS.getElementsByTagName('select');
		  AS.tx			= $C('txt','input',AS)[0];
		  AS.b			= $C('btn','img',AS)[0];
		  AS.form		= AS.parentNode;
		  AS.b.parent	= AS;
	}
	
	AS.b.onclick=function() { with (this)
	{
		var Form = parent.form;
		
		{
			Form.e.words.value = sanitize(Form.e.words.value)
		}
		
		var topic = Form.e.topic._Value();
		var alias = Form.e.alias._Value();
		var words = Form.e.words.value;
		
		{
			var url=[];
				url.push('resources' + (alias?('/'+alias):""));
				url.push(topic ? ('&tag='+topic) : "");
				url.push(words ? ('&str='+$P.urlencode(words)) : "");
				url.push('&find');
				url=url.join("");
		}
		
		setOp(this,50);
		redir(url);
	}
	};
}
};
