//Replace # for ?|&
var hash = '';
if (location.hash.search(/#ref=/) != -1) {
var hash = location.hash.replace(/#ref=/,'?ref=');
if (location.search.search(/\?/) != -1)
hash = hash.replace(/\?/,'&');
}

//Rewrite GSA uri to ?q=keyword
var rewriteURI = (location.search)
.toLowerCase() // change everything to lowercase	
.replace(/_+/g, "-") // change all underscores to a hyphen
.replace(/\s+|%20/g, "-") // change all spaces to a hyphen
.replace(/[-]+/g, "-") // replace multiple instances of the hyphen with a single instance
.replace(/.*%3d/g, "\?q=") // trim uri to ?q=
;

//Set domain name or set none in domain field
var domainName = document.location.hostname
var valueDomainName = (/intermediairpw\.nl/)
if (domainName.match(valueDomainName)) {
var setDomain = ("'.intermediairpw.nl'");
}
else {
var setDomain = ("'none'");
}
