$(document).ready(function(){
	
	var content_height = $('#content').height();
	var center_height = $('#center').height();
	var slideshow1_height = $('#slideshow').height();
	var slideshow3_height = $('#slideshow').height(); 
	
	$('#slideshow').each(function() {
		if (center_height > 400) {
			content_height = content_height + 180;
		}
	}); 
	
	$('#slideshow').each(function() {
		if (center_height > 400) {
			content_height = content_height + 180;
		}
	});
	
	if (content_height < 600) {
		$('#left_bottom').css({top: content_height-31});
	} else {
		if (window.innerHeight) {
			if (window.innerHeight > 600) {
				$('#left_bottom').css({top: window.innerHeight - 125});
				$('#left_bottom').css({position: "fixed"});
			} else {
				$('#left_bottom').css({top: 470});
// 				$('#left_bottom').css({bottom: 8});
				$('#left_bottom').css({position: "fixed"});
			}
		}
		
		/* if($.browser.msie){
			if (document.body.clientHeight > 600) {
				$('#left_bottom').css({bottom: 8});
				$('#left_bottom').css({top: "auto"});
				$('#left_bottom').css({position: "absolute"});
			} else {
				$('#left_bottom').css({top: 495});
				$('#left_bottom').css({bottom: "auto"});
				$('#left_bottom').css({position: "absolute"});
			}
		} */
		
		if($.browser.msie){
				$('#left_bottom').css({top: 471});
			}
		
	}
	
	
	$('#form_contact .form_submit').hover(
      function () {
      	$(this).css('background-position', '0px -18px');
      	$(this).css('cursor', 'pointer');
      }, 
      function () {
      	$(this).css('background-position', '0px 0px');
      	$(this).css('cursor', 'default');
      }
    );
	$('#form_online .form_submit').hover(
      function () {
      	$(this).css('background-position', '0px -18px');
      	$(this).css('cursor', 'pointer');
      }, 
      function () {
      	$(this).css('background-position', '0px 0px');
      	$(this).css('cursor', 'default');
      }
    );
	$('#login_submit').hover(
      function () {
      	$(this).css('background-position', '0px -12px');
      	$(this).css('cursor', 'pointer');
      }, 
      function () {
      	$(this).css('background-position', '0px 0px');
      	$(this).css('cursor', 'default');
      }
    );
	$('#login_submit').hover(
      function () {
      	$(this).attr('src', '/images/buttons/login_submit_over.gif');
      }, 
      function () {
      	$(this).attr('src', '/images/buttons/login_submit.gif');
      }
    );
	
	$('#login_image').hover(
      function () {
      	
      	var pos_login = $('#login_box_inner').css('top');
      	
      	if (pos_login != '0px') {
      		$(this).css('background-position', '0px -28px');	
      	} 
      	
      	$(this).css('cursor', 'pointer');
      	
      }, 
      function () {
      	
      	var pos_login = $('#login_box_inner').css('top');
      	
      	if (pos_login == '0px') {
      		$(this).css('background-position', '0px -28px');	
      	} else {
      		$(this).css('background-position', '0px 0px');
      	}
      	$(this).css('cursor', 'default');
      	
      	
      }
    );
	
	$('#login_box_inner').css( { top: '-130px' } );
	
	$('#login_image').click(
	    function() {
	    	var pos_login = $('#login_box_inner').css('top');
	    	
	    	
	    	if (pos_login == '-130px') {
	    		$('#login_box_outer').css( { display: 'block' } );
	        	$('#login_box_inner').animate({ top: "0px" }, 1500);
	    	} else {
	    		$('#login_box_inner').animate({ top: "-130px" }, 1500, function() {$('#login_box_outer').css( { display: 'none' } );} );
	    	}
	    }
	);
	
	$('#login_close').click(
	    function() {
	    		$('#login_box_inner').animate({ top: "-130px" }, 1500, function() {$('#login_box_outer').css( { display: 'none' } );} );
	    }
	);
	
	$('.back').click(
			function() {
				window.history.go(-1);
				return false;				
			}
		);
	
	$('#words').click(
			function() {
				if ($(this).val() == 'Stichwort') {
	   				$(this).attr('value', '');
	   				}
				}
	);
	
	$('#user_name').click(
			function() {
				if ($(this).val() == 'Benutzername') {
	   				$(this).attr('value', '');
	   				}
				}
	);
	
	$('#pass').click(
			function() {
	   			$(this).attr('value', '');
			}
	);
	$('#form_online input').each(function() {
		$(this).click(function(){
			if ($(this).val()=='HH:MM') {
				$(this).attr('value', '');
			}
		});
	});
	
	$("#aktionszeitraumvon").datepicker({ 
		showOn: "both", 
		buttonImage: "/images/buttons/kalender_icon.gif", 
		buttonImageOnly: true 
	});
	
	$("#aktionszeitraumbis").datepicker({ 
		showOn: "both", 
		buttonImage: "/images/buttons/kalender_icon.gif", 
		buttonImageOnly: true 
	});
	
	$("#schulung_termin").datepicker({ 
		showOn: "both", 
		buttonImage: "/images/buttons/kalender_icon.gif", 
		buttonImageOnly: true 
	});
	
	$("#casting_termin").datepicker({ 
		showOn: "both", 
		buttonImage: "/images/buttons/kalender_icon.gif", 
		buttonImageOnly: true 
	});
	
	$('dl dt strong a.searchtitle').each(function(){
	    linktext = $(this).text();
	    linktext = linktext.replace(/PRO-VOGUE \| Fullservice Agentur : 15 Jahre Erfahrung in Promotions, Messe, & Eventservice bundesweit. Promotoren, Models, Hostessen, Messehostessen f?r Ihre Promotions, Messen und Events. \|/g, "");
	    $(this).text(linktext);
	});
	
	$('.project_video a').each(function() {
	    video_link = $(this).attr('href');
	    video_link = video_link + '?video=1';
	    $(this).attr('href', video_link);
	});
 });
	