/******************************************************************************/
/*Ändra kategorier från vänster menyn och "fortsätt handla" knappar i högermenyn*/
/******************************************************************************/
function changeHeadCategory(CatTreeID,ArtTreeID){
	var MainLocation = parent.Main.location.href;
//	var CartLocation = parent.Cart.location.href;
	var hostname = document.location.hostname;
	if (MainLocation.substr(MainLocation.lastIndexOf("/") + 1,3) != "Sub"){
		if (ArtTreeID) parent.Main.location.href = "http:\/\/" + hostname + "\/SubFrames.asp?CatTreeID=" + CatTreeID + "&ArtTreeID=" + ArtTreeID;
		else parent.Main.location.href = "http:\/\/" + hostname + "\/SubFrames.asp?CatTreeID=" + CatTreeID;
		}
	else {
		if (ArtTreeID) parent.Main.SubMain.location.href = "http:\/\/" + hostname + "\/Shop\/Articles.asp?TreeID=" + CatTreeID + "#" + ArtTreeID;
		else parent.Main.SubMain.location.href = "http:\/\/" + hostname + "\/Shop\/Articles.asp?TreeID=" + CatTreeID;
		//parent.Main.RightMenu.location.href = "http:\/\/" + hostname + "\/Shop\/Categorys.asp?TreeID=" + CatTreeID;
		}

//	if (CartLocation.substr(CartLocation.lastIndexOf("/") + 1) != "Cart.asp")
//		parent.Cart.location.href = "http:\/\/" + hostname + "\/Shop\/Cart.asp";

	return false;
}

/****************************************************************************/
/*Ändra kategorier från höger menyn, endast SubMainFramen berös och eventuellt rightmenuframen*/
/****************************************************************************/
function changeCategory(CatTreeID,ArtTreeID){
//	var CartLocation = parent.parent.Cart.location.href;
	var hostname = document.location.hostname;
	
	if (ArtTreeID)
		parent.SubMain.location.href = "http:\/\/" + hostname + "\/Shop\/Articles.asp?TreeID=" + CatTreeID + "#" + ArtTreeID;
	else
		parent.SubMain.location.href = "http:\/\/" + hostname + "\/Shop\/Articles.asp?TreeID=" + CatTreeID;
	
//	if (CartLocation.substr(CartLocation.lastIndexOf("/") + 1) != "Cart.asp")
//		parent.parent.Cart.location.href = "http:\/\/" + hostname + "\/Shop\/Cart.asp";

//	if (MoreCategorys == 1) //Ändra på kategorierna i högra menyn om det finns mer kat under (MoreCategorys == 1)
//		parent.RightMenu.location.href = "http:\/\/" + hostname + "\/Shop\/Categorys.asp?TreeID=" + CatTreeID;

	return false;
}

/******************************************************************************/
/*Gå till Huvudsidan*/
/******************************************************************************/
function toMain(){
	alert ("ToMain")
	var MainLocation = parent.Main.location.href;
//	var CartLocation = parent.Cart.location.href;
	var hostname = document.location.hostname;


	if (MainLocation.substr(MainLocation.lastIndexOf("/") + 1,3) != "Sub")
		parent.Main.location.href = "http:\/\/" + hostname + "\/SubFrames.asp";
	else {
		parent.Main.SubMain.location.href = "http:\/\/" + hostname + "\/Main.asp";
		parent.Main.RightMenu.location.href = "http:\/\/" + hostname + "\/NewsList.asp";
		}

//	if (CartLocation.substr(CartLocation.lastIndexOf("/") + 1) != "Cart.asp")
//		parent.Cart.location.href = "http:\/\/" + hostname + "\/Shop\/Cart.asp";

	return false;
}

/******************************************************************************/
/*Gå till vald infotext*/
/******************************************************************************/
function toInfoText(NewsID){
	var MainLocation = parent.Main.location.href;
	var hostname = document.location.hostname;

	if (MainLocation.substr(MainLocation.lastIndexOf("/") + 1,3) != "Sub")
		parent.Main.location.href = "http:\/\/" + hostname + "\/SubFrames.asp?NewsID=" + NewsID;
	else
		parent.Main.SubMain.location.href = "http:\/\/" + hostname + "\/ShowInfoText.asp?NewsID=" + NewsID;


	return false;
}


/****************************************************************************/
/*Till den stora kundvagnen*/
/****************************************************************************/
function toBigCart(){
	var hostname = document.location.hostname;
	
	//Anropet kommer inte från subFrame
	if (parent.Main){ 
		parent.Main.location.href= "http:\/\/" + hostname + "\/Shop\/BigCart.asp"
		}
	//Anropet kommer inte från subFrame
	else{
		parent.parent.Main.location.href= "http:\/\/" + hostname + "\/Shop\/BigCart.asp"
		}
	return;
}


/****************************************************************************/
/*Till Kassan*/
/****************************************************************************/
function toCheckOut(){
	var hostname = document.location.hostname;
	
	//Anropet kommer inte från subFrame
	if (parent.Main){
		parent.Main.location.href= "http:\/\/" + hostname + "\/Shop\/CheckOut.asp"
		}
	//Anropet kommer inte från subFrame
	else{
		parent.parent.Main.location.href= "http:\/\/" + hostname + "\/Shop\/CheckOut.asp"
		}

	return;
}

