function isSecure()
{
   return window.location.protocol == 'https:';
}
function goElseWhere()
{
var oldURL = window.location.hostname + window.location.pathname;
var newURL = "http://" + oldURL;
window.location = newURL;
}
if (isSecure()) {
	goElseWhere();
}