$(function(){ 
	$('input[title!=""]').hint();
	$('textarea[title!=""]').hint();
});

$(document).ready(function() {
	
	$('#gominisearch, #sendthis, .olist dl, #request input.submit, #advsearch input.submit, #sendtofriend input.submit').hover(function() {
	$(this).addClass('hover');
	}, function() {
	$(this).removeClass('hover');
	});
	
    $('#slide').jcarousel({
        vertical: true,
        scroll: 3
    });
	
	$('#slide a').click(function() {
		var elem = $(this).attr('rel');
		$('#bimg').html("<img src='" + elem + "' alt='' />");
	});	
	
	$('a.request').click(function() {
		$('#request').toggle();
		$('#sendtofriend').css("display","none");
	});
	
	$('a.send').click(function() {
		$('#sendtofriend').toggle();
		$('#request').css("display","none");
	});	
	//$('#keyword').autocomplete('/autocomplete.php');
	$('#keyword').autocomplete(
	'/autocomplete.php',
	{		
		
		cellSeparator:"|@|",
		onItemSelect:selectItem
				
    }
	);	
});
function selectItem(li)
{
    //$('#sitesearch').submit();
    
	if( li == null ) ;
	if( !!li.extra ) var sValue = li.extra[0];
    else var sValue = li.selectValue;
    if(sValue)	location.href=sValue;
}
function addtofav(url, title) {
	
	if (window.sidebar) { 
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { 
		window.external.AddFavorite( url, title); }
	else if(window.opera && window.print) {
		return true; }
}

function newimg(elem) {
	$('#bimg').html("<img src='" + elem + "' alt='' />");
}

$(function() {
	$('.gallery a').lightBox();
});
function StepByStepUnique( Position, MaxCount, Container, Prefix, FirstElement){



 var SelectArray = new Array();

 var PropertyContainer = document.getElementById( Container );





 for(cL = 0; cL < MaxCount; cL++)

 SelectArray[cL] = document.getElementById( Prefix+cL );



if(SelectArray[Position].value == "" || !PropertyContainer ){



 for(cL = Position+1; cL < MaxCount; cL++)

 while(SelectArray[cL].options.length > 1)

 SelectArray[cL].options[SelectArray[cL].options.length - 1] = null;



 }else{



 for(cL = Position+1; cL < MaxCount; cL++){

 SelectArray[cL].options.length = null;

 SelectArray[cL].options[SelectArray[cL].options.length] = new Option(FirstElement,"")

 }





var FoundNewItemKeys = new Array();



 var AvailArray = PropertyContainer.getElementsByTagName( 'a' );

 for(cA = 0; cA < AvailArray.length; cA++)



 if(AvailArray[cA].getAttribute('linkedid') == SelectArray[Position].value){



 SelectArray[Position+1].options[SelectArray[Position+1].options.length] = new Option(AvailArray[cA].getAttribute('name'), AvailArray[cA].getAttribute('itemid'))

 }





 }



}
