$(document).ready(function() {

	$('#navi').corner("10px");
	$('#cont-text').corner("top 12px");

	$('#cont-frage').corner("12px");

	$('#pricebox').corner("12px");

	$('a.warenkorb').corner("bottom 10px");

	$('.cont-main-bottom').corner("bl 12px");
	$('.cont-main-bottom div').corner("bl 10px");

	$('.contlinks span').corner("bottom 12px");
	$('.contlinks a').corner("bottom 10px");


	
	$('.box').corner("12px");
	$('#side .warenkorb p').corner("bottom 12px");
	$('#side input.login_submit').corner("tr br 12px");
	$('#side input.search_submit').corner("8px");

    // things that do not work in ie
    if(!($.browser.msie)){
    	$('#breadcrumb').corner("top 11px");
    	$('#inWarenkorb').corner("11px");
	$('#pricebox .bottomborder').corner("br 12px");
	$('#pricebox .bottomborder div').corner("br 10px");
    		$('#cont-main').corner("bottom 11px");
    	$('#cont-text').corner("bottom 12px");
        $('#topsearch').corner("10px");
    	$('#topsearch form').corner("8px");
    }


    // transform Labels to placeholder values
    formLabelToValue($('.login #passwort, .login #email'));

    // show or hide anfrageformular
    $('#cont-frage').hide();
    $(".anfragezeigen a").toggle(
      function () {
        $('#cont-frage').slideDown("400");
        $(this).text("Anfrageformular verbergen");
      },
      function () {
        $('#cont-frage').slideUp("400");
        $(this).text("Frage zum Produkt");
      }
    );



});

function formLabelToValue(elem) {
    elem.each(function(){
        var labelText = $(this).siblings('label').text();
        labelText = labelText + ' ...'
        $(this).siblings('label').css({
            position: 'absolute',
            left: '-9999px'
        });
        $(this).siblings('label').next('input').attr('value',labelText);
    });
}
