function substr( f_string, f_start, f_length )
{
	if ( f_start < 0 )
		f_start += f_string.length ;
 
	if ( f_length == undefined ) {
		f_length = f_string.length ;
	} else if( f_length < 0 ) {
		f_length += f_string.length ;
	} else {
		f_length += f_start ;
	}
 
	if ( f_length < f_start )
		f_length = f_start ;
	
	return f_string.substring( f_start, f_length ) ;
}

function SetVisible( item )
{
	if ( $( item ).is( ":hidden" ) )
		$( item ).fadeIn() ;
	else
		$( item ).slideUp() ;
}

function ShowFaq( id ) {
	var id ;var item ;
	
	item = 'div#faq' + id ;
	
	$( 'img.f4q' ).attr( 'src', 'http://www.oki-doki.ru/design/images/icons/plus.png' ) ;
	$( 'img.f4q' ).attr( 'alt', '+' ) ;
	
	if ( $( item ).is( ":hidden" ) ) {
		$( 'div.faq' ).slideUp() ;
		$( 'img#f4q' + id ).attr( 'src', 'http://www.oki-doki.ru/design/images/icons/minus.png' ) ;
		$( 'img#f4q' + id ).attr( 'alt', '-' ) ;
		$( item ).fadeIn() ;
	}
	else {
		$( item ).slideUp() ;
	}
	
}

function SetItem( id, isSet )
{
	var id ; var item ; var isSet ;
	
	item = 'span#item-' + id ;
	
	if ( true == isSet )
		$( item ).removeClass( 'item-normal' ).addClass( 'item-selected' ) ;
	else
		$( item ).removeClass( 'item-selected' ).addClass( 'item-normal' ) ;
}
	
$(document).ready(function() {$("a[rel^='lightBox']").prettyPhoto({theme:'dark_rounded', showTitle: false});if('' != window.location.hash){ShowFaq(substr(window.location.hash,4))}});