<!--

//Copyright e-Business Systems Limited  www.e-businesssystems.co.uk

//customised for client: 

// BB version 2 - 16/01/12

//preload bb images
var preload_img = new Array();
preload_img[0] = new Image();
preload_img[0].src = "../images/style/menu_b_bg.png";
preload_img[1] = new Image();
preload_img[1].src = "../images/style/menu_t_bg.png";



function Setup_pf_menu()
{
	ebsl_menu[0] = new Ebsl_menu_control(0,"gmenu","_m");
	//ebsl_menu[0].set_abolute_position = false;
	ebsl_menu[0].menu_root_is_relatively_positioned = true;
	ebsl_menu[0].Set_level_controls(1,0,0,"pf_img","pf_img");
	ebsl_menu[0].Set_level_controls(2,-25,-25,"m_0_hi","m_0_lo");
	//ebsl_menu[0].Set_level_controls(3,110,0,"m_0_hi","m_0_lo");
		
	ebsl_menu[0].Finalise_setup();
}






function Setup_p_menu()
{
	ebsl_menu[1] = new Ebsl_menu_control(1,"pmenu","_m");
	ebsl_menu[1].menu_root_is_relatively_positioned = true;
	ebsl_menu[1].Set_level_controls(1,0,0,"p_cat_1_hi","p_cat_1");
	ebsl_menu[1].Set_level_controls(2,180,-40,"","");		
	ebsl_menu[1].Finalise_setup();
}




function Postcode_custom(post_code)
{
	var need_to_change_postcode = false;
	var required_delivery_option = "";
	
	
	
	if (delivery_option_selected != "4")
	{
		if (post_code.substr(0,2) == "BT")
		{
			required_delivery_option = "Northern Ireland";
			need_to_change_postcode = true;
		}
	}

	
	

	if (delivery_option_selected != "5")
	{
		if (Postcode_matched_highlands_and_islands(post_code))
		{
			required_delivery_option = "Scottish Highlands and Islands";
			need_to_change_postcode = true;
		}
	}

	
	if (need_to_change_postcode)
	{
		window.alert("Please click on the View Basket button\nto return to the View Basket page\nand select the delivery option for " + required_delivery_option + ".\nThank you.");
		return false;
	}
	else
	{
		return true;
	}
}




function Postcode_matched_highlands_and_islands(post_code)
{
	var matched = false;
	
	//Isle of Man
	if (post_code.substr(0,2) == "IM"){matched = true}	
	
	
	//Inverness
	if (post_code.substr(0,2) == "IV"){matched = true}	
	if (post_code.substr(0,3) == "KW1"){matched = true}
	if (post_code.substr(0,3) == "KW2"){matched = true}
	if (post_code.substr(0,3) == "KW3"){matched = true}
	if (post_code.substr(0,3) == "KW5"){matched = true}
	if (post_code.substr(0,3) == "KW6"){matched = true}
	if (post_code.substr(0,3) == "KW7"){matched = true}
	if (post_code.substr(0,3) == "KW8"){matched = true}
	if (post_code.substr(0,3) == "KW9"){matched = true}
	if (post_code.substr(0,4) == "KW10"){matched = true}
	if (post_code.substr(0,4) == "KW11"){matched = true}
	if (post_code.substr(0,4) == "KW12"){matched = true}
	if (post_code.substr(0,4) == "KW13"){matched = true}
	if (post_code.substr(0,4) == "KW14"){matched = true}
	if (post_code.substr(0,4) == "PH20"){matched = true}
	if (post_code.substr(0,4) == "PH21"){matched = true}
	if (post_code.substr(0,4) == "PH22"){matched = true}
	if (post_code.substr(0,4) == "PH23"){matched = true}
	if (post_code.substr(0,4) == "PH24"){matched = true}
	if (post_code.substr(0,4) == "PH25"){matched = true}
	if (post_code.substr(0,4) == "PH26"){matched = true}
	if (post_code.substr(0,4) == "PH31"){matched = true}
	if (post_code.substr(0,4) == "PH32"){matched = true}
	if (post_code.substr(0,4) == "PH34"){matched = true}
	if (post_code.substr(0,4) == "PH35"){matched = true}
	if (post_code.substr(0,4) == "PH36"){matched = true}
	if (post_code.substr(0,4) == "PH37"){matched = true}
	if (post_code.substr(0,4) == "PH38"){matched = true}
	if (post_code.substr(0,4) == "PH39"){matched = true}
	if (post_code.substr(0,4) == "PH40"){matched = true}
	if (post_code.substr(0,4) == "PH41"){matched = true}
	if (post_code.substr(0,4) == "PH42"){matched = true}
	if (post_code.substr(0,4) == "PH43"){matched = true}
	if (post_code.substr(0,4) == "PH44"){matched = true}
	if (post_code.substr(0,3) == "HS1"){matched = true}
	if (post_code.substr(0,3) == "HS2"){matched = true}
	if (post_code.substr(0,3) == "HS3"){matched = true}
	if (post_code.substr(0,3) == "HS4"){matched = true}
	if (post_code.substr(0,3) == "HS5"){matched = true}
	if (post_code.substr(0,3) == "HS6"){matched = true}
	if (post_code.substr(0,3) == "HS7"){matched = true}
	if (post_code.substr(0,3) == "HS8"){matched = true}
	if (post_code.substr(0,4) == "FK17"){matched = true}
	if (post_code.substr(0,4) == "FK18"){matched = true}
	if (post_code.substr(0,4) == "FK19"){matched = true}
	if (post_code.substr(0,4) == "FK20"){matched = true}
	if (post_code.substr(0,4) == "FK21"){matched = true}

	
	
	
	//Isle of Wight
	if (post_code.substr(0,4) == "PO30"){matched = true}
	if (post_code.substr(0,4) == "PO31"){matched = true}
	if (post_code.substr(0,4) == "PO32"){matched = true}
	if (post_code.substr(0,4) == "PO33"){matched = true}
	if (post_code.substr(0,4) == "PO34"){matched = true}
	if (post_code.substr(0,4) == "PO35"){matched = true}
	if (post_code.substr(0,4) == "PO36"){matched = true}
	if (post_code.substr(0,4) == "PO37"){matched = true}
	if (post_code.substr(0,4) == "PO38"){matched = true}
	if (post_code.substr(0,4) == "PO39"){matched = true}
	if (post_code.substr(0,4) == "PO40"){matched = true}
	if (post_code.substr(0,4) == "PO41"){matched = true}
	
	//Arran
	if (post_code.substr(0,4) == "KA27"){matched = true}
	
	
	//Orkney
	if (post_code.substr(0,4) == "KW15"){matched = true}
	if (post_code.substr(0,4) == "KW16"){matched = true}
	if (post_code.substr(0,4) == "KW17"){matched = true}
	

	//Shetland
	if (post_code.substr(0,3) == "ZE1"){matched = true}
	if (post_code.substr(0,3) == "ZE2"){matched = true}
	if (post_code.substr(0,3) == "ZE3"){matched = true}
	
	
	//Aberdeen
	if (post_code.substr(0,3) == "DD8"){matched = true}
	if (post_code.substr(0,3) == "DD9"){matched = true}
	if (post_code.substr(0,4) == "DD10"){matched = true}
	if (post_code.substr(0,3) == "AB1"){matched = true}
	if (post_code.substr(0,3) == "AB2"){matched = true}
	if (post_code.substr(0,3) == "AB9"){matched = true}
	if (post_code.substr(0,4) == "AB10"){matched = true}
	if (post_code.substr(0,4) == "AB11"){matched = true}
	if (post_code.substr(0,4) == "AB12"){matched = true}
	if (post_code.substr(0,4) == "AB21"){matched = true}
	if (post_code.substr(0,4) == "AB22"){matched = true}
	if (post_code.substr(0,4) == "AB23"){matched = true}
	if (post_code.substr(0,4) == "AB24"){matched = true}
	if (post_code.substr(0,4) == "AB25"){matched = true}
	
	if (post_code.substr(0,2) == "AB"){matched = true}	//all Aberdeen


	//Scilly Isles
	if (post_code.substr(0,4) == "TR21"){matched = true}
	if (post_code.substr(0,4) == "TR25"){matched = true}

	
	
	//Oban
	if (post_code.substr(0,4) == "PH33"){matched = true}
	if (post_code.substr(0,4) == "PA20"){matched = true}
	if (post_code.substr(0,4) == "PA21"){matched = true}
	if (post_code.substr(0,4) == "PA22"){matched = true}
	if (post_code.substr(0,4) == "PA23"){matched = true}
	if (post_code.substr(0,4) == "PA24"){matched = true}
	if (post_code.substr(0,4) == "PA25"){matched = true}
	if (post_code.substr(0,4) == "PA26"){matched = true}
	if (post_code.substr(0,4) == "PA27"){matched = true}
	if (post_code.substr(0,4) == "PA28"){matched = true}
	if (post_code.substr(0,4) == "PA29"){matched = true}
	if (post_code.substr(0,4) == "PA30"){matched = true}
	if (post_code.substr(0,4) == "PA31"){matched = true}
	if (post_code.substr(0,4) == "PA32"){matched = true}
	if (post_code.substr(0,4) == "PA33"){matched = true}
	if (post_code.substr(0,4) == "PA34"){matched = true}
	if (post_code.substr(0,4) == "PA35"){matched = true}
	if (post_code.substr(0,4) == "PA36"){matched = true}
	if (post_code.substr(0,4) == "PA37"){matched = true}
	if (post_code.substr(0,4) == "PA38"){matched = true}
	if (post_code.substr(0,4) == "PA39"){matched = true}
	if (post_code.substr(0,4) == "PA40"){matched = true}
	if (post_code.substr(0,4) == "PA41"){matched = true}
	if (post_code.substr(0,4) == "PA42"){matched = true}
	if (post_code.substr(0,4) == "PA43"){matched = true}
	if (post_code.substr(0,4) == "PA44"){matched = true}
	if (post_code.substr(0,4) == "PA45"){matched = true}
	if (post_code.substr(0,4) == "PA46"){matched = true}
	if (post_code.substr(0,4) == "PA47"){matched = true}
	if (post_code.substr(0,4) == "PA48"){matched = true}
	if (post_code.substr(0,4) == "PA49"){matched = true}
	if (post_code.substr(0,4) == "KA28"){matched = true}
	if (post_code.substr(0,3) == "HS9"){matched = true}
	

	//Jersey and Guernsey
	if (post_code.substr(0,2) == "JE"){matched = true}
	if (post_code.substr(0,2) == "GY"){matched = true}
		




	return matched;
}

















var popup_backdrop_id = "popup_backdrop";
var popup_id = "";	//changes depending on popup activated
var popup_product_code = "";	//picture product code
var popup_pic_id = "";	//id of div containing the picture
var allow_bg_click_cancel = true;	//if false, don't allow a click on background to cancel the popup






function Setup_popup()
{
	var popup_bd = Gebid(popup_backdrop_id);
	if (popup_bd)
	{
		popup_bd.onclick = Ebsl_popup_cancel;

	}
}








function Ebsl_popup_cancel_conditional()
{
	if (allow_bg_click_cancel)
	{
		Ebsl_popup_cancel()
	}
}




function Ebsl_popup_cancel()
{
	var popup = Gebid(popup_id);
	if (popup)
	{
		popup.style.display = "none";
	}
	
	
	var popup_pic = Gebid(popup_pic_id);
	if (popup_pic)
	{
		popup_pic.innerHTML = "";
	}
	
	
	

	
	Ebsl_popup_backdrop_off();
	
	allow_bg_click_cancel = true;

}




function Ebsl_popup_show(pic_type)
{
	var popup = Gebid(popup_id);
	if (popup)
	{
		popup.style.top = getPageScroll() + "px";
		popup.style.display = "block";
	}
	
	
	var popup_pic = Gebid(popup_pic_id);
	if (popup_pic)
	{
		
		if (pic_type == "product")
		{
			popup_pic.innerHTML = '<img  src="product_images_large/' + popup_product_code + '">';

		}
		else if (pic_type == "subcategory")

		{
			popup_pic.innerHTML = '<img  src="subcategory_images_large/'  + popup_product_code + '">';
		}

		
		
		
		else
		{
			popup_pic.innerHTML = '<img  src="gallery/' + pic_type + 'large/' + popup_product_code + '.jpg">';
		}
		
		
	}

	
	
	
	
	Ebsl_popup_backdrop_on();
}





function Ebsl_popup_backdrop_on()
{
	var popup_bd = Gebid(popup_backdrop_id);
	if (popup_bd)
	{
		popup_bd.style.display = "block";
	}
	

}





function Ebsl_popup_backdrop_off()
{
	var popup_bd = Gebid(popup_backdrop_id);
	if (popup_bd)
	{
		popup_bd.style.display = "none";
	}
	
	
}








function Bigger_picture(pic_type,pic_no)
{
	popup_id = "bigger_picture";
	popup_pic_id = "pictures_container"
	popup_product_code = pic_no;
	Ebsl_popup_show(pic_type);

}


// y page scroll value
// Core code from - quirksmode.org
//
function getPageScroll(){

	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}

	return yScroll;
}









function Info_on(id)
{
	Display_on("info_" + id);
}

function Info_off(id)
{
	Display_off("info_" + id);
}












//-->
