function showExtraInfo( id, k, destination ){

	if ( !document.getElementById( destination ).isopen ) {
	
		var resHandle = {
			success : function(o) {
			
				var elem = document.getElementById( this.destination );
				elem.innerHTML = o.responseText;
				
				var attributes = { height: { from: 0, to: 90 } };
				
				var anim = new YAHOO.util.Anim(this.destination, attributes, 0.60, YAHOO.util.Easing.elasticOut);
				anim.animate();
				
				elem.isopen = true;
				
			}
		     
		}
		 
		resHandle.destination = destination;
		YAHOO.util.Connect.asyncRequest( 'GET', 'extrainfo.php?id=' + id + '&k=' + k, resHandle );
	
	} else {
	
		var attributes = { height: { from: 90, to: 0 } };
		
		var elem = document.getElementById( destination );
		
		elem.innerHTML = "";
		
		var anim = new YAHOO.util.Anim( elem, attributes, 0.60, YAHOO.util.Easing.easeIn );
		anim.animate();
		
		elem.isopen = false;
	
	}

}

YAHOO.namespace("extendedinfo");

function init() {

	// Instantiate the Dialog
	YAHOO.extendedinfo.dnb_dialog = new YAHOO.widget.SimpleDialog("dnb_dialog", { width: "500px", fixedcenter: true, visible: false, draggable: false, close: true, constraintoviewport: true, effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.15}, modal:true });
	YAHOO.extendedinfo.dnb_dialog.setHeader("<div class=\"tl\"></div><h3>Opplysning 1890</h3><h2>Mer info med <span>Dun&amp;Bradstreet Credit Control</span></h2><div class=\"tr\"></div>");
	YAHOO.extendedinfo.dnb_dialog.setBody("<p class=\"ingress\"><img src=\"/gfx/dunbradstreet-logo.png\" alt=\"Dun&amp;Bradstreet\" />V&aring;r samarbeidspartner, Dun&amp;Bradstreet, leverer kredittopplysninger om bedrifter og organisasjoner.</p><p>Dun&amp;Bradstreet gir oversikt over juridisk informasjon, n&oslash;kkeltall, fulle regnskaper, betalingsanmerkninger, relasjoner mellom konsern og datterselskaper, lenker til aksjon&aelig;rer og styremedlemmer og panter og leasingavtaler.</p><ul id=\"dnb-buttons\"><li id=\"dnb-prospect\"><a href=\"/hjelp/vil-bli-dnb-kunde/\"><span><strong>Jeg vil bli kunde</strong></span></a></li><li id=\"dnb-customer\"><a href=\"/hjelp/allerede-dnb-kunde/\"><span><strong>Jeg er allerede kunde</strong></span></a></li><li><a href=\"\" id=\"hide\" onclick=\"YAHOO.extendedinfo.dnb_dialog.hide(); return false;\"><span>Avbryt</span></a></li></ul>");

	
	// Render the Dialog
	YAHOO.extendedinfo.dnb_dialog.render(document.body);

	// Get all link elements with class "extended-partner-info" inside element "tlf1890_result"
	var links = YAHOO.util.Dom.getElementsByClassName("extended-partner-info", "button", document.getElementById("tlf1890_result"));
	// Attach the handler to all the links in one fell swoop
	//YAHOO.util.Event.addListener(links, "click", YAHOO.extendedinfo.dnb_dialog.show, YAHOO.extendedinfo.dnb_dialog, true);
	//YAHOO.util.Event.addListener("hide", "click", YAHOO.extendedinfo.dnb_dialog.hide, YAHOO.extendedinfo.dnb_dialog, true);

}

YAHOO.util.Event.addListener(window, "load", init);

