// JavaScript Document	
// requires adpcart.js
function isBotTest()
{
	var botCookie = new Cookie(document, "bot");		
	return botCookie.load();
}

var args = getArgs();

if(!isBotTest())
{		
	var cfDomain = "";
	
	if(self.location.hostname.indexOf("localhost") != -1)
	{
		host = "localhost/sweetcorner";
		cfDomain = "localhost";
	}
	else
	{		
		host = "www.thesweetcorner.co.uk";
		cfDomain = "sweetcorner";
	}
	
	if(self == top || parent.location.hostname.toLowerCase().indexOf(cfDomain) == -1)
	{			
		if(args["ProductID"] && args["ProductID"] != "undefined")
			top.location.replace("http://" + host + "/Home.aspx?ProductID=" + args["ProductID"]);
			
		else if(args["SubCatID"] && args["SubCatID"] != "undefined")
			top.location.replace("http://" + host + "/Home.aspx?SubCatID=" + args["SubCatID"]);
			
		else if(self.location.pathname.toLowerCase().indexOf("offers") != -1)
			top.location .replace("http://" + host + "/Home.aspx?content=Offers");
			
		else if(self.location.pathname.toLowerCase().indexOf("about") != -1)
			top.location.replace("http://" + host + "/Home.aspx?content=About");
			
		else if(self.location.pathname.toLowerCase().indexOf("gifts") != -1)
			top.location.replace("http://" + host + "/Home.aspx?content=Gifts");
			
		else if(self.location.pathname.toLowerCase().indexOf("links") != -1)
			top.location.replace("http://" + host + "/Home.aspx?content=links");
			
		else if(self.location.pathname.toLowerCase().indexOf("usa") != -1)
			top.location.replace("http://" + host + "/Home.aspx?content=usa");
		
		else			
			top.location.replace("http://" + host + "/Default.aspx");
	}
}

