/*************************************************************************/
/*                                                                       */
/*    project:  GAD web 2008                                             */
/*    code:     gadscripts.js                                            */
/*    author:   Radovan Čapek                                            */
/*    date:     4.8.2008                                                 */
/*                                                                       */
/*************************************************************************/
jQuery.noConflict();
/********************************************************************/
/*     HomePage scripts                                             */
/*     requirements : jQuery.js                                     */
/********************************************************************/
jQuery(document).ready(

		function($)
		{
    /********************************************************************/
    /*     script name: Tooltip                                         */
    /*     describe: show bubble with describe when the mouse is over   */
    /********************************************************************/
          $('#column2')
  					.bind(
  						'mouseover',                    // mouse over
  						function()
  						{
  							$('#tooltip').stop().show().fadeTo(1200,0.85);
  						}
  					)
  					.bind(
  						'mouseout',                     // mouse out
  						function()
  						{
  							$('#tooltip').stop().fadeTo(400,0, function(){$(this).hide();});
  						}
  					)
    /********************************************************************/
    /*     script name: Show Redman                                     */
    /*     describe: animate the bookmark on left after the click       */
    /********************************************************************/  					
  					$('#bookmark_redman')
  					.bind(
  						'click',                        // on click
  						function()
  						{
  							if($(this).css("left") == '72px') {                             // if redman bookmark is closed
  							  if(screen.width <= 1024) {                                    // if screen resolution is 1024px or less
                     $('#page').animate({width: '+=200px'}, 0);                 // make page wider
  							     $('#page').animate({marginLeft: '+=100px'}, 0);            // and move that to the right
  							     $('#footer').animate({width: '+=200px'}, 0);               // with footer do the same
  							     $('#footer').animate({marginLeft: '+=100px'}, 0);
  							  }
                  $(this).animate({left: '-=120px'}, 500);                      // opening bookmark
                }
                else {
                  $(this).animate({left: '+=120px'}, 500);                      // bookmark is opened, so close it
                  if(screen.width <= 1024) {                                    // if screen resolution is 1024px or less
                    $('#page').animate({width: '-=200px'}, 500);                // turn back page changes
                    $('#page').animate({marginLeft: '-=100px'}, 500);
                    $('#footer').animate({width: '-=200px'}, 500);
                    $('#footer').animate({marginLeft: '-=100px'}, 500);
                  }
  							  
                }
  						}
  					)
  	/********************************************************************/
    /*     script name: Show marking of page                     */
    /*     describe: animate the bookmark on right after the click      */
    /********************************************************************/ 					
  					$('#mark')
  					.bind(
  						'click',                        // on click
  						function()
  						{
                if($('#bookmark_plus').css("margin-left") == '-125px')          // mark bookmark is closed
                    $('#bookmark_plus').animate({marginLeft: '+=125px'}, 500);  //open it!
                
                else if($('#bookmark_plus').css("margin-left") == '0px')        // mark bookmark is opened
                    $('#bookmark_plus').animate({marginLeft: '-=125px'}, 500);  // close it!
              }
  					)
  	/********************************************************************/
    /*     script name: Show recommendation of page                     */
    /*     describe: animate the bookmark on right after the click      */
    /********************************************************************/ 					
  					$('#recommendation')
  					.bind(
  						'click',                        // on click
  						function()
  						{
  							 if($('#recommendation_bookmark').css("left") == '-122px') {     // if recommendation_bookmark is closed
                    $('#recommendation_bookmark').animate({left: '0px'}, 500);   // open it!
                  }
                 else if($('#recommendation_bookmark').css("left") == '0px') {   // if bookmark is opened
                    $('#recommendation_bookmark').animate({left: '-122px'}, 500);// close it
                    
                    
                  }
  						}
  					)
  					
  					
  					$('#rec_input_name')
  					.bind('load', function(){$(this).val() = "Vaše jméno";})    //on load
  					$('#rec_input_name')
  					.bind(
  						'focus',                                               // on focus
  						function()
  						{
  							 if ($(this).val() == "Vaše jméno") {
                    $(this).val("");
                    $(this).css({ color:"#545454" });
                 }
                 
                 
  						}
  					)
  					$('#rec_input_name')
  					.bind(
  						'blur',                                               // on blur
  						function()
  						{
  							 if ($(this).val() == "") {
                    $(this).val("Vaše jméno");
                    $(this).css({ color:"#C0C0C0" });
                 }
                 
                 
  						}
  					)
  					
  					$('#rec_input_mail')
  					.bind('load', function(){$(this).val() = "e-mail příjemce";})    //on load
  					$('#rec_input_mail')
  					.bind(
  						'focus',                        // on focus
  						function()
  						{
  							 if ($(this).val() == "e-mail příjemce") {
                    $(this).val("");
                    $(this).css({ color:"#545454" });
                 }
                 
                 
  						}
  					)
  					$('#rec_input_mail')
  					.bind(
  						'blur',                        // on focus
  						function()
  						{
  							 if ($(this).val() == "") {
                    $(this).val("e-mail příjemce");
                    $(this).css({ color:"#C0C0C0" });
                 }
                 
                 
  						}
  					)
  			     
  					
	 }
);

