 
    $(document).ready(function() {
      $("[empty=1]").focus(function () {
          if ($(this).val() == $(this)[0].defaultValue) {
            $(this).val("");
          }
        }).blur(function() {
          if ($(this).val() == "") {
            $(this).val($(this)[0].defaultValue);
          }
        });
        
    });
    
    $(function() {
        $('#gallery a').lightBox();                
    });     
 	
    
  $(function() { 
      $("button[rel]").overlay({
               
          onBeforeLoad: function() { 
              this.getBackgroundImage().expose({color: null, zIndex:49});
              $("#login_box").css('z-index', 1); 
          },  
           
          onLoad: function() {
             //$('select').hide();
           },  
          onClose: function() { 
              $.expose.close(); 
              $("#login_box").css('z-index', 50); 
              //$('select').show();
          } 
           
      });             

        $("#overlay_info").overlay({ 
              
            onBeforeLoad: function() { 
                 
              this.getBackgroundImage().expose({color: null, zIndex: 49}); 
                $("#login_box").css('z-index', 1); 
            },

            onLoad: function() {
              //$('select').hide();
            },  
            onClose: function() { 
                $.expose.close(); 
                $("#login_box").css('z-index', 50);
                //$('select').show();
            } 
             
        });             
        $("#overlay_info").overlay().load();


        if (resize)
        {
          var windowHeight = $(window).height();
          var bodyHeight = $('body').height();
          
          if (windowHeight!="undefined" && bodyHeight!="undefined" && bodyHeight < windowHeight)
          {         
            $('.content').css('height',windowHeight-260+'px');
          }
        }   
  });
  

  /**
   * custom popup function by b-bernard
   */
  function show_custom_popup(obj, popup_id)
  {
    var popup = $('#' + popup_id);


    $('body').append('<div id="dcde_popup" style="z-index:9998">'+popup.html()+'</div>');
    $('#dcde_popup').ie6zindex();
    $('#dcde_popup').center();

  }

  function hide_custom_popup()
  {
    $('#dcde_popup').remove();
  }

// Custom dropdown function	===========
function createDropDown(id, container, style_class)
{
	/*
	var source		= $("#" + id);
	var selected	= source.find("option[selected]");
	var options		= $("option", source);

	source.hide();
		
	container.append('<dl id="' + id + '_custom" class="dropdown ' + style_class + '"></dl>');
	$('#' + id + '_custom').append('<dt><a>' + selected.text() + 
									'<span class="value">' + selected.val() + 
									'</span></a></dt>');
	$('#' + id + '_custom').append('<dd><ul></ul></dd>');

	options.each(function()
	{
		$('#' + id + '_custom dd ul').append('<li><a>' + 
												$(this).text() + '<span class="value">' + 
												$(this).val() + '</span></a></li>');
	});
	*/

	// Events
	$('#' + id + '_custom dt span').click(function(eventObj)
	{
		$('#' + id + '_custom dd table').toggle();
	});

	$(document).bind('click', function(e)
	{
		var $clicked = $(e.target);

		if (! $clicked.parents().hasClass(style_class))
			$('#' + id + '_custom dd table').hide();
	});

	$('#' + id + '_custom dd table td#selel').click(function()
	{
		var text = $(this).html();
		$('#' + id + '_custom dt span').html(text);
		$('#' + id + '_custom dd table').hide();

		var source = $('#' + id);
		source.val($(this).find('span.value').html())
	});

}

//=====================================
$(document).ready(function(){

	$('.content_cancel_form_bottom .submit').hover(
		function() {
			$(this).css('backgroundImage', "url('views/default/images/cancel_form_submit.jpg')");
		},
		function () {
			$(this).css('backgroundImage', "url('views/default/images/cancel_form_submit_normal.jpg')");
		});
		
		
	$('.cc_btn').hover(
		function() {
			$(this).css('backgroundImage', "url('views/default/images/cc_btn_pressed.png')");
		},
		function () {
			$(this).css('backgroundImage', "url('views/default/images/cc_btn.png')");
		});
		

	$('.btn_dgm').hover(
		function() {
			$(this).css('backgroundImage', "url('views/default/images/dgm_pressed.jpg')");
		},
		function () {
			$(this).css('backgroundImage', "url('views/default/images/dgm.jpg')");
		});

	$('.btn_webgain').hover(
		function() {
			$(this).css('backgroundImage', "url('views/default/images/webgains_pressed.jpg')");
		},
		function () {
			$(this).css('backgroundImage', "url('views/default/images/webgains.jpg')");
		});
/*
	$('.fl_item').hover(
		function() {
			$(this).find('.fleet_icon').show();
		},
		function () {
			$(this).find('.fleet_icon').hide();
		});
*/
	$('.faq_table td>a').bind('click',
		function () {
			$(this).parent().parent().next().slideToggle();
			return false;
		});

	$('.cr_close').bind('click',
		function () {
			$(this).parent().parent().parent()
			.parent().parent().slideToggle();
		});

	$('.step_inactive').bind('click',
		function() {
			$('.step_active').removeClass('step_active');
			$(this).addClass('step_active');
			$('.step_banner').not('#' + $(this).attr('id') + '_banner').hide();
			$('#' + $(this).attr('id') + '_banner').show();
		});

	if($.selectbox) $('.pretty_select').selectbox({'inputClass': 'pretty_select', 'containerClass': 'pretty-selectbox-wrapper'});
/*
	$('.fl_icons td').hover(
		function() {
			$(this).find('.hint').fadeIn();
		},
		function () {
			$(this).find('.hint').fadeOut();
		});
*/
	$('.cc_b_head_item').bind('click',
		function() {
			$('.cc_b_head_select').removeClass('cc_b_head_select');
			$(this).addClass('cc_b_head_select');
			$('.contact_form').not('#' + $(this).attr('id') + '_form').hide();
			$('#' + $(this).attr('id') + '_form').show();
		});

	$('.cc_b_head_item a').bind('click',
		function() {
			$(this).parent().click();
		});
});
