/*

Main Javascript for jQuery Realistic Hover Effect
Created by Adrian Pelletier
http://www.adrianpelletier.com

*/

var $j = jQuery;
$j.fn.extend({
    toggleValue : function (defaultText) {
        return this.each(function() {
            $j(this).focus(function() {
                if ($j(this).val() == defaultText) {
                    $j(this).addClass('colorssss');
                    $j(this).val('');

                }
                $j(this).blur(function () {
                    if ($j.trim($j(this).val()) == '') {
                        $j(this).removeClass('colorssss');
                        $j(this).val(defaultText);

                    }
                });
            });
        });
    }
});


 /* GOOGLE MAP */

 function initialize() {
  if (GBrowserIsCompatible()) {
    var map = new GMap2(document.getElementById("map_canvas"));
   map.setCenter(new GLatLng(53.550316,9.957626), 16);
    map.addControl(new GSmallMapControl());
    map.addControl(new GMapTypeControl());


    var jamsICON = new GIcon();
jamsICON.image = 'http://www.jams-club.de/markers/image.png';
jamsICON.shadow = 'http://www.jams-club.de/markers/shadow.png';
jamsICON.iconSize = new GSize(100,100);
jamsICON.shadowSize = new GSize(150,100);
jamsICON.iconAnchor = new GPoint(50,100);
jamsICON.infoWindowAnchor = new GPoint(50,0);
jamsICON.printImage = 'http://www.jams-club.de/markers/printImage.gif';
jamsICON.mozPrintImage = 'http://www.jams-club.de/markers/mozPrintImage.gif';
jamsICON.printShadow = 'http://www.jams-club.de/markers/printShadow.gif';
jamsICON.transparent = 'http://www.jams-club.de/markers/transparent.png';
jamsICON.imageMap = [94,0,96,1,97,2,98,3,99,4,99,5,99,6,99,7,99,8,99,9,99,10,99,11,99,12,99,13,99,14,99,15,99,16,99,17,99,18,99,19,99,20,99,21,99,22,99,23,99,24,99,25,99,26,99,27,99,28,99,29,99,30,99,31,99,32,99,33,99,34,99,35,99,36,99,37,99,38,99,39,99,40,99,41,99,42,99,43,99,44,99,45,99,46,99,47,99,48,99,49,99,50,99,51,99,52,99,53,99,54,99,55,99,56,99,57,99,58,99,59,99,60,99,61,99,62,99,63,99,64,99,65,99,66,99,67,99,68,99,69,99,70,99,71,98,72,97,73,96,74,94,75,56,76,55,77,54,78,53,79,52,80,51,81,50,82,49,83,48,84,47,85,46,86,45,87,44,88,43,89,42,90,41,91,40,92,39,93,38,94,37,95,36,96,35,97,34,97,34,96,35,95,35,94,35,93,36,92,36,91,36,90,37,89,37,88,37,87,38,86,38,85,38,84,39,83,39,82,40,81,40,80,40,79,41,78,41,77,41,76,5,75,3,74,2,73,1,72,0,71,0,70,0,69,0,68,0,67,0,66,0,65,0,64,0,63,0,62,0,61,0,60,0,59,0,58,0,57,0,56,0,55,0,54,0,53,0,52,0,51,0,50,0,49,0,48,0,47,0,46,0,45,0,44,0,43,0,42,0,41,0,40,0,39,0,38,0,37,0,36,0,35,0,34,0,33,0,32,0,31,0,30,0,29,0,28,0,27,0,26,0,25,0,24,0,23,0,22,0,21,0,20,0,19,0,18,0,17,0,16,0,15,0,14,0,13,0,12,0,11,0,10,0,9,0,8,0,7,0,6,0,5,0,4,1,3,2,2,3,1,5,0];

// Set up our GMarkerOptions object
     markerOptions = { icon:jamsICON };

    // Add 10 markers to the map at random locations
      var latlng = new GLatLng(53.550240,9.958026);
      map.addOverlay(new GMarker(latlng, markerOptions));

  }
}



/* = Navigation
################# */

	// Begin jQuery
	
	$(document).ready(function() {


       /* =Reflection Nav
	   -------------------------------------------------------------------------- */

		// Append span to each LI to add reflection

		$("#nav-reflection li").append("<span></span>");

		// Animate buttons, move reflection and fade

		$("#nav-reflection a").hover(function() {
		    $(this).stop().animate({ marginTop: "-3px" }, 200);
		    $(this).parent().find("span").stop().animate({ marginTop: "3px", opacity: 0.75 }, 200);
		},function(){
		    $(this).stop().animate({ marginTop: "0px" }, 300);
		    $(this).parent().find("span").stop().animate({ marginTop: "0px", opacity: 1 }, 300);
		});


	// End jQuery
 
    // QUICK BOX
    $('#quickBoxNav').scrollFollow({offset: 60});
    $('#quickBoxContent').scrollFollow({offset: 60});
 
 	//When mouse rolls over
	$(".quick-link").click(function(){

     var domE1 = this.id;
     var exploded = domE1.split(',');
     var isShow = false;

         for (var i = 1; i <= 4; i++)
         {
             if(exploded['0'] != i)
             {
               $("#panel-box-"+ i).hide();
             }
         }

        $("#panel-box-"+ exploded['0']).show();



        $("#panel").stop().animate({height: exploded['1']+'px'},{queue:false, duration:1000});
        $("#panel-box").stop().show();
        $("#panel-close").stop().show();
    

         });

         $("#panel-close").click(function(){
		 $("#panel").stop().animate({height: '0px'},{queue:false, duration:600});
         for (var i = 1; i <= 4; i++)
         {
               $("#panel-box-"+ i).hide();
         }
         $("#panel-box").stop().hide();
         $("#panel-close").stop().hide();
         
         });

         $('input[type="text"]').each(function(){$(this).toggleValue($(this).val());});
         
         
         

         
         
   
   
    // FORMULARE CLICK
    $(".jobs-work").click(function() {
        $("#jobs-position").val(this.id);
    });

	
	$("a[rel='photos']").colorbox();
	$("a.showInlineNormal").colorbox({inline:true});
	$("a.showInline").colorbox({width:"708px", inline:true});
	
	$('#captchaReload').live("click",function() {
					var oldSrc = $("img#captchaReload").attr('src');
					$("img#captchaReload").attr('src', oldSrc + "?rand="+ Math.random() );
				});

	});

