
//makes sure that domain is correct for software and also only works when downloaded
//This goes on mylivebookpages

function doNotMyLiveBookURL(){
	if(document.location.href.indexOf("mylivebook.co.uk")<1) {
		var theURL=window.location.href;
		var newURL='';
		if(document.location.href.indexOf("self-publish-books.co.uk")>0) {
			newURL=(theURL.replace('self-publish-books.co.uk', 'mylivebook.co.uk'));
		}
		window.location.href=newURL;
	}
}

function doIsSPB_URL(){
	if(document.location.href.indexOf("mylivebook.co.uk")>0) {
		var theURL=window.location.href;
		var newURL='';
		newURL=(theURL.replace( 'mylivebook.co.uk','self-publish-books.co.uk'));
		window.location.href=newURL;
	}
	if(document.location.href.indexOf("definitiveprint.com")>0) {
		var theURL=window.location.href;
		var newURL='';
		newURL=(theURL.replace( 'definitiveprint.com','self-publish-books.co.uk'));
		window.location.href=newURL;
	}
}










//if you come to index.html with mylivebook.co.uk in URL you get home.html page
function doIsMyLiveBookURL(){//divert mylivebook to correct home page
	if(document.location.href.indexOf("mylivebook.co.uk")>0) {
			document.location.href='http://www.mylivebook.co.uk/MyLiveBook/mlb_pages/home.html';
	}
}

//if you come to 404.html with mylivebook.co.uk in URL you get 404er.html page
function do404mlbURL(){//divert mylivebook to correct home page
	if(document.location.href.indexOf("liveedition.co.uk")>0) {
			document.location.href='http://www.mylivebook.co.uk/404mlb.html';
	}
}
//if you come to 404le.html with NOT mylivebook.co.uk in URL you get 404.html page
function do404URL(){//divert mylivebook to correct home page
	if(document.location.href.indexOf("mylivebook.co.uk")<0) {
			document.location.href='http://www.mylivebook.co.uk/404.html';//thinkthisiswrong
	}
}


//DONT USE ON HOME.html FOR NOW
//if you come to home.html and DONT have liveedition.co.uk in URL you get moved to index.html
/*
function doSortURL(){//change URL and divert to index.html
	if(document.location.href.indexOf("liveedition.co.uk")<1) {
		if(document.location.href.indexOf("ictus.co.uk")>0) {
			document.location.href='http://www.ictus.co.uk/index.html';
		}
		if(document.location.href.indexOf("gilmourprint.co.uk")>0) {
			document.location.href='http://www.gilmourprint.co.uk/index.html';
		}
		if(document.location.href.indexOf("gilmourprint.com")>0) {
			document.location.href='http://www.gilmourprint.com/index.html';
		}
	}
}
*/
