// check radio buttons
function getCheckedValue(radioObj) {
   if(!radioObj)
       return "";
   var radioLength = radioObj.length;
   if(radioLength == undefined)
       if(radioObj.checked)
           return radioObj.value;
       else
           return "";
   for(var i = 0; i < radioLength; i++) {
       if(radioObj[i].checked) {
           return radioObj[i].value;
       }
   }
   return "";
} 


// check strings voor numeriek
function is_numeric (strString) {

   	var strValidChars = "0123456789";
   	var strChar;
   	var blnResult = true;

   	if (strString.length == 0) 
   		return false;

   	for (i = 0; i < strString.length && blnResult == true; i++) {
      	strChar = strString.charAt(i);
      	
      	if (strValidChars.indexOf(strChar) == -1) {
         	blnResult = false;
        }
   	}
   	
   	return blnResult;
}

function removeSpaces (string) {
	
	var tstring = "";
	string = '' + string;
	splitstring = string.split(" ");
	for(i = 0; i < splitstring.length; i++)
	tstring += splitstring[i];
	return tstring;
}


function verify (postcode) {
	
	postcode = removeSpaces(postcode);
	
	if (is_numeric(postcode.substr(0,4)) == false)
		return false;
	if (postcode.length != 4)
		return false;
	else
		document.location.href = '?pagina=dealerlocator&postcode=' + postcode;
}

function autoChange()
{
var timeID = setTimeout("location.href= 'http://www.dunlopmotorcycle.be'", 5000)
}

