// JavaScript Document
function objMaxHeight(obj, val, dots, frontpage) {
 var startLen = $(obj).html().length;
 var meer = '... <span class="bold wit">meer &gt;</span>';
 
 while ($(obj).height() > val) {
  $(obj).html( $(obj).html().substr(0, $(obj).html().length-5) );
 }
 
 if (frontpage) {
  $(obj).html( $(obj).html().substr(0, $(obj).html().length-2) + meer );
  while ($(obj).height() > val) {
   $(obj).html( $(obj).html().substr(0, $(obj).html().length-2-meer.length) + meer );
  }
 } else if (dots && startLen > $(obj).html().length) {
  $(obj).html( $(obj).html().substr(0, $(obj).html().length-3) + '...' );
 }
 
 $(obj).css('height', val+'px');
}

function fixInputDefaults(obj) {
 $(obj).each(function() {
  if ($(this).attr('default')) {
   $(this).focus(function() {
    if ($(this).attr('value') == $(this).attr('default')) {
     $(this).attr('value', ''); 
    }
   }).blur(function() {
    if ($(this).attr('value').length == 0) {
     $(this).attr('value', $(this).attr('default')); 
    }
   });
   
   $(this).attr('value', $(this).attr('default')); 
  }
 });
}

$(document).ready(function() {

	if($(".popup")){
	  $(".popup").fancybox({
			'overlayShow':	true,
			'overlayOpacity':0.5,
			'zoomSpeedIn':	300, 
			'zoomSpeedOut':	0
	  });
	}

	$('.stnd').blur(function() {
		if($(this).val()==''){
			$(this).val($(this).attr('alt'));
		}
	});
	$('.stnd').focus(function() {
		if($(this).val()==$(this).attr('alt')){
			$(this).val('');
		}
	});
	$('.stnd').each(function(){
		if($(this).val()==''){
			$(this).val($(this).attr('alt'));
		}
	});
	

});


function logout(){
	$.post('../controller/logout.php', function(){
		window.location='checkout';
	});
}

