$(document).ready(function() {
	$('.clearField').clearField();

	$('#image-show > #pic_show').innerfade({ 
		speed: 0, 
		timeout: 4000, 
		type: 'sequence', 
		containerheight: '360px' 
	});
	
	$('#image-show-gewinner > #pic_show').innerfade({ 
		speed: 0, 
		timeout: 4000, 
		type: 'sequence', 
		containerheight: '360px' 
	});
	
	$('#image-show-gewinnspiel > #pic_show').innerfade({ 
		speed: 'slow', 
		timeout: 6000, 
		type: 'sequence', 
		containerheight: '360px' 
	});
	
	$("#pic .avarage").mouseover(function () {
      $(this).hide();
      return false;
    });
    
    /*
    $(".txt_mitmachen").mouseup(function() {
    	$(this).removeClass("cclick");
    }).mousedown(function() {
    	$(this).addClass("cclick");
    });
	*/
  
  /* font size rendering */
  _typeface_js.initialize();
  
});

function submitenter(myfield,e) {
	var keycode;
	if (window.event) keycode = window.event.keyCode;
	else if (e) keycode = e.which;
	else return true;

	if (keycode == 13) {
   		myfield.form.submit();
	   	return false;
   	} else {
	   	return true;
	}
}

function change_parent_url(url)
{
	document.location=url;
}


function openFacebook(url_par, win_title) 
{ 
 	var breite=600; 
 	var hoehe=400; 
 	var positionX=((screen.availWidth / 2) - breite / 2); 
 	var positionY=((screen.availHeight / 2) - hoehe / 2); 
 	// var url='http://www.facebook.com/sharer.php?u=http%3A%2F%2F'+ basis +'social%2Ffb%2F'+ filename +'&t='; 
 	var url=url_par; 
 	pop=window.open('', win_title,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,fullscreen=0,width='+breite+',height='+hoehe+',top=0,left=0'); 
 	pop.resizeTo(breite,hoehe); 
 	pop.moveTo(positionX,positionY); 
 	pop.location=url; 
}

/*
onerror = stopError;
function stopError()
{
	return true;
}
*/