
	function externalLink(obj) {
		href = obj.getAttribute('href');

		if( href.substring( 0, 7 ) != "http://" )
			href = "http://"+href;

		w = window.open(href, "quickaccess", "" );
		w.focus();
		
	}
	
window.onload = function() {
	/**
	 * coreQuickAccess.js
	 *
	 * @author: 	aluis@corefactor.pt
	 * @date:		30 Oct 2006
	 *
	 */

	// plain text links -- attach onclick handler
	links = window.document.getElementById("coreQuickAccess").getElementsByTagName( "a" );
	for(i=0;i<links.length;i++) {
	
		if( links[i].className.match( /ext/ ) ) {
			links[i].onclick = function () {externalLink(this); return false;}			
		}
	}



	// comboboxes -- attach eventhandler

	if( window.document.getElementById('coreQuickAccess') ) {
	
		root = window.document.getElementById('coreQuickAccess');

		selects = root.getElementsByTagName("select");

		for( i=0;i<selects.length;i++ ) {
		
			sel = selects[i];
			
			
			sel.onchange = function() {

				opts = this.getElementsByTagName( "option" );
				
				selOpt = opts[this.selectedIndex];
	
				if( selOpt.value != "#" && selOpt.value != "" ) {
					linktype = selOpt.className;

					if( linktype.match( /int/ ) )  
						location.href = selOpt.value;
					else if( linktype.match( /ext/ ) ) {
						a = window.open(selOpt.value, "","" );
						a.focus();
					}
				}


			}
		
		}
	
	}

}

function buscar (URL)
{ 
window.open(URL,'ventana1','width=600, height=400, scrollbars=yes, menubar=yes, location=yes, resizable=no,toolbar=yes,directories=yes,top=50,left=50');
}
