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 openPopupScroll(w,h,url,target) {
	window.open(url,target,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+w+",height="+h)		
}	
function updateSizeRadioButtons(optionValue){
	var manufacturerName = optionValue.substring(1, optionValue.indexOf(')'));
	if(manufacturerName=="FILA" || manufacturerName=="Penguin"){
		document.getElementById("adultMaleRadio").disabled = false;
		document.getElementById("adultMaleRadio").checked = true;
		document.getElementById("adultFemaleRadio").disabled = true;
		document.getElementById("kidsRadio").disabled = true;
		document.getElementById("babyRadio").disabled = true;
		document.getElementById("adultMaleRadio").value = (manufacturerName=="FILA")?101:201;
	}else{ // Jakes
		document.getElementById("adultMaleRadio").value = 7;
		document.getElementById("adultFemaleRadio").disabled = false;
		document.getElementById("kidsRadio").disabled = false;
		document.getElementById("babyRadio").disabled = false;
	}
}

function checkOfferForm(){
  if(document.offerForm.oa.checked && !isInteger(document.offerForm.op.value)){
    alert('Please enter an integer in the price box.');
    return false;
  }
  return true;
}

function toggleOfferOnOff(){
	document.getElementById('oa').value = (document.getElementById('oa').value==0)?1:0;
	document.getElementById('onoff').innerHTML=(document.getElementById('onoff').innerHTML=="on")?"off":"on";	
	document.getElementById('onoffdiv').style.display=(document.getElementById('onoffdiv').style.display=="none")?"":"none";
}

function isInteger(s){
	var i;
	if (isEmpty(s))
	if (isInteger.arguments.length == 1) return 0;
    else return (isInteger.arguments[1] == true);
	for (i = 0; i < s.length; i++){
		var c = s.charAt(i);
		if (!isDigit(c)) return false;
	}
	return true;
}

function isEmpty(s){
  	return ((s == null) || (s.length == 0))
}

function isDigit (c) {
  	return ((c >= "0") && (c <= "9"))
}
