function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}

var selected;
var submitter = null;
function submitFunction() {
   submitter = 1;
   }
function selectRowEffect(object, buttonSelect) {
  if (!selected) {
    if (document.getElementById) {
      selected = document.getElementById('defaultSelected');
    } else {
      selected = document.all['defaultSelected'];
    }
  }

  if (selected) selected.className = 'moduleRow';
  object.className = 'moduleRowSelected';
  selected = object;

// one button is not an array
	if (document.checkout_payment) {
	  if (document.checkout_payment.payment[0]) {
		document.checkout_payment.payment[buttonSelect].checked=true;
	  } else {
		document.checkout_payment.payment.checked=true;
	  }
	}
}

function rowOverEffect(object) {
  if (object.className == 'moduleRow') object.className = 'moduleRowOver';
}

function rowOutEffect(object) {
  if (object.className == 'moduleRowOver') object.className = 'moduleRow';
}

function check_form() {
  var error = 0;
  var error_message = "Errors have occured during the process of your form.\n\nPlease make the following corrections:\n\n";
  var payment_value = null;
  if (document.checkout_payment.payment.length) {
    for (var i=0; i<document.checkout_payment.payment.length; i++) {
      if (document.checkout_payment.payment[i].checked) {
        payment_value = document.checkout_payment.payment[i].value;
      }
    }
  } else if (document.checkout_payment.payment.checked) {
    payment_value = document.checkout_payment.payment.value;
  } else if (document.checkout_payment.payment.value) {
    payment_value = document.checkout_payment.payment.value;
  }

  if (payment_value == "cc") {
    var cc_owner = document.checkout_payment.cc_owner.value;
    var cc_number = document.checkout_payment.cc_number.value;
    var cvvnumber = document.checkout_payment.cvvnumber.value;
    if (cc_owner == "" || cc_owner.length < 3) {
      error_message = error_message + "* The owner's name of the credit card must be at least 3 characters.\n";
      error = 1;
    }
    if (cc_number == "" || cc_number.length < 10) {
      error_message = error_message + "* The credit card number must be at least 10 characters.\n";
      error = 1;
    }
    if (cvvnumber.length > 4) {
      error_message = error_message + "*** The credit card validation number must be 4 digits or less. \n";
      error = 1;
    }
    if (cvvnumber == ""|| cvvnumber.length < 3) {
      error_message = error_message + "*** The credit card validation number must be at least 3 digits . \n";
      error = 1;
    }
  }

  if (payment_value == null && submitter != 1) {
    error_message = error_message + "* Please select a payment method for your order.\n";
    error = 1;
  }

  if (error == 1 && submitter != 1) {
    alert(error_message);
    return false;
  } else {
    return true;
  }
}

function couponpopupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,left=150')
}




  
function loadImages() {
if (document.getElementById) { 
document.getElementById('hidepage').style.visibility = 'hidden';
}
else {
if (document.layers) { 
document.hidepage.visibility = 'hidden';
}
else {  
document.all.hidepage.style.visibility = 'hidden';
      }
   }
}

function MM_openBrWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}

function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}



function checkboxRowEffect(object) {
  document.checkout_confirmation.elements[object].checked = !document.checkout_confirmation.elements[object].checked;
  if(document.checkout_confirmation.elements[object].checked) {
    document.checkout_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowSelected';
  } else {
    document.checkout_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowOver';
  }
}

function check_agree(TheForm) {
  if (TheForm.agree.checked) {
	document.getElementById('bconfirm').style.display = 'none';
	document.getElementById('bconfirmed').style.display = 'block';
    return true;
  } else {
    alert(unescape('Bitte bestätigen Sie unsere AGB'));
    return false;
  }
}

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}

function fl03cright_resizer(comp_width, comp_height) {
	document.getElementById('rightFL03C00065').style.width = comp_width+"px";
	document.getElementById('rightFL03C00065').style.height = comp_height+"px";
}
function fl03c_resizer(comp_width, comp_height) {
	document.getElementById('FL03C00065').style.width = comp_width+"px";
	document.getElementById('FL03C00065').style.height = comp_height+"px";
}
var posDefault;
var posOffset;

function fl03c_findPosY(obj) {
	var curtop = 0;
	if (obj.offsetParent) {
		while (obj.offsetParent) {
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y) curtop += obj.y;
	return curtop;
}

function fl03c_position_default() {
	var cat_flash_az = document.getElementById("rightFL03C00065");
	if (document.all) cat_flash_az.style.posLeft = posDefault;
	else cat_flash_az.style.left  = posDefault;
}

function fl03c_position_offset() {
	var cat_flash_az = document.getElementById("rightFL03C00065");
	if (document.all) cat_flash_az.style.posLeft = posOffset;
	else cat_flash_az.style.left  = posOffset;
}



