jQuery(document).ready(function($j) {
	$j("#contact_form").validate();

	$j(".colorbox").colorbox();
	$j("a[rel='cbox']").colorbox();

	var path = location.pathname.substring(1);
	if (path == 'euro/')
	{
		path	= 'euro/despre_noi.php';
	}
	$j('li:has(a[href$="' + path.substring(path.lastIndexOf('/') + 1) + '"])').addClass('current');



//	var divh = document.getElementById('articles').offsetHeight;
	$j("#ablank").height($j("#articles").height()+50);
	$j("#ablank").width(136);



    if( jQuery.browser.mozilla ) {
		// do when DOM is ready
		$j( function() {
		// search form, hide it, search labels to modify, filter classes nocmx and error
		$j( 'form.cmxform' ).hide().find( 'p>label:not(.nocmx):not(.error)' ).each( function() {
		var $this = $j(this);
		var labelContent = $this.html();
		var labelWidth = document.defaultView.getComputedStyle( this, '' ).getPropertyValue( 'width' );
		// create block element with width of label
		var labelSpan = $j("<span>")
			.css("display", "block")
			.width(labelWidth)
			.html(labelContent);
			// change diplay to mozilla specific inline-box
		$this.css("display", "-moz-inline-box")
		// remove children
		.empty()
		// add span element
		.append(labelSpan);
		// show form again
		}).end().show();
		});
		};
	});




function lookup(inputString) {
	if(inputString.length == 0) {
		$('#suggestions').fadeOut(); // Hide the suggestions box
	} else {
		$.post("search.php", {queryString: ""+inputString+""}, function(data) { // Do an AJAX call
			$('#suggestions').fadeIn(); // Show the suggestions box
			$('#suggestions').html(data); // Fill the suggestions box
		});
	}
}
