/**
 * JavaScript jQuery Controller
 * (c) 2009, Benjamin Zaiser, info@benjamin-zaiser.de
 */  

/**$.fn.colorbox.settings.bgOpacity = "0.81";**/
$(document).ready(function(){
  // JavaScript GET Helper Function
  HTTP_GET_VARS=new Array();
  strGET=document.location.search.substr(1,document.location.search.length);
  if(strGET!=''){
    gArr=strGET.split('&');
    for(i=0;i<gArr.length;++i){
      v='';vArr=gArr[i].split('=');
      if(vArr.length>1){v=vArr[1];}
      HTTP_GET_VARS[unescape(vArr[0])]=unescape(v);
    }
  }
  
  
  //-------------------------------------------
  // Tip-A-Firend
  //-------------------------------------------
  /**$('a#tip-a-friend').colorbox({
    fixedWidth: "540px",
    fixedHeight: "480px"
  });**/
  $('form.tx_tipafriend_form_class').live("click", function(){
    $(this).ajaxForm({
      beforeSubmit: function(formData, jqForm, options){
//        $('#TB_load').show();
      },
      success:function(responseText, statusText){
        $('#TB_ajaxContent').html(responseText);
//        $('#TB_load').hide();
      }
    });
  });
  
  
  
  
  //-------------------------------------------
  // Lightbox
  //-------------------------------------------
  /**$('a[rel="lightbox"]').colorbox();**/
  

  //-------------------------------------------
  // Langswitch-Menu / Login
  //-------------------------------------------
  $(document).ready(function() {
	$('#langswitch_menu').hide();							 
	$('#login_menu').hide();
  });

  $('#langswitch').click(function(){
    $('#langswitch_menu').slideToggle("fast");
  });
  $('#login').click(function(){
    $('#login_menu').slideToggle("fast");
  });
  
  /**$('#login').colorbox({
    fixedWidth: "457px",
    fixedHeight: "225px"
  });**/
  
  
  //-------------------------------------------
  // Testweise ein Video fürs Overlay
  //-------------------------------------------
  /**$('a.flash').colorbox({href:"http://www.wesser.de/fileadmin/wesser/flash/job/video_klein/video_klein.html"});**/

  
  
  //-------------------------------------------
  // Kontakformular SELECT
  //-------------------------------------------
/*
if(GET('submitted') == 1){
    //Formular wurde abgesendet, aber es ist wohl ein Fehler aufgetreten
    $('#mailformplus_contactform').slideToggle("slow");
    $('#mailformplus_link').hide();
    $('.mailformplus_preselect #selectForm').children("[value='Allgemein']").attr('selected', 'selected');
  }
  $('.mailformplus_preselect #selectForm').change(function(){
    if($(this).children("[selected]").text() == 'Allgemein'){
      $('#mailformplus_contactform').slideToggle("slow");
      $('#mailformplus_link').hide();
    }
    else if($(this).children("[selected]").text() == 'Bewerbung'){
      $('#mailformplus_link').slideToggle("slow");
      $('#mailformplus_contactform').hide();
    }
  }); */
});


// Customizing Add This Button
var addthis_options = 'delicious, google, misterwong, yahoobkm, digg, yigg, more';





function GET(v){
  if(!HTTP_GET_VARS[v]){return 'undefined';}
  return HTTP_GET_VARS[v];
}
