/*
 * JQuery Random Plugin
 * 
 * Adds two random number functions to jQuery -
 * one to find a random number and one to find a random number between a max and min limit.
 * 
 * Version 1.0
 * 
 * by Christian Bruun - 23. jan 2009
 * 
 * Like it/use it? Send me an e-mail: rockechris@rockechris.com
 * 
 * License: None. Use and abuse. Comes with no warranty, of course!
 * 
 * 
 * Usage:
 * $.random(int);
 * $.randomBetween(min, max);
 * 
 * Code found at:
 * http://www.merlyn.demon.co.uk/js-randm.htm
 * 
 */
jQuery.extend({
    random: function(X) {
        return Math.floor(X * (Math.random() % 1));
    },
    randomBetween: function(MinV, MaxV) {
      return MinV + jQuery.random(MaxV - MinV + 1);
    }
});


$(document).ready(function () {
	$('.text').hide();
	
	$('.trigger')
		.mouseover(function () {
			$ParentContainer = $(this).parents('.contentlink');
			$currentId = $ParentContainer.find('.text');
			$currentId.show();
		})
		.mouseout(function () {
			$ParentContainer = $(this).parents('.contentlink');
			$currentId = $ParentContainer.find('.text');
			$currentId.hide();
		});

  $(".pfeil").each(function() {
			$ParentContainer = $(this).parents('.contentlink');
			$ParentId = $ParentContainer.attr('id');
			$time = ($ParentId == "Text4" || $ParentId == "Text5" || $ParentId == "Text6") ? 0 : $.randomBetween(100, 1000);
			$(this).everyTime($time, function () {
    	$(this).animate({
      	left: '+=5'
    	}, 700).animate({
      	left: '-=5'
    	}, 700);
		})
  });

  $('.text').transify({
    opacityOrig: .85,
    fadeSpeed: 1000,
    percentWidth: '100%'
  });

});
