﻿/// <reference path="jquery-1.7.1-vsdoc.js" />

$( document ).ready( function () {
	init();
} );

function init() {
	initMenu();
	initTagCloud();
}

function initMenu() {
	var items = $( '.menu .item' );

	items.each( function ( index, value ) {
		$( value ).hover( 
				function () {
					$( this ).toggleClass( "hover" );
				},
				function () {
					$( this ).toggleClass( "hover" );
				} )
				.click( function ( event ) {
					event.stopPropagation()
					window.location = $( this ).find( "A" ).attr( 'href' );
				} );
	} );

}

function initTagCloud() {
	var tagCloud = $( 'div.tagCloud' )

	var width = tagCloud.width();
	var height = tagCloud.height();

	$( 'div.tagCloud' ).tagcloud( {
		centrex: width / 2,
		centrey: height / 2,
		init_motion_x: 5,
		init_motion_y: 5,
		rotate_factor: 5.00

		} );
}
