

var isIphone = "no";
var isIpad = "no";

var agt2 = new String(navigator.userAgent.toLowerCase());
if (agt2.indexOf("iphone") != -1) {
	isIphone = "yes";
}
if (agt2.indexOf("ipad") != -1) {
	isIpad = "yes";
}


function getInsideWindowWidth() {
	isIE6CSS = (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) ? true : false;
	if (window.innerWidth) {
		return window.innerWidth;
	}
	else if (isIE6CSS) {
		// measure the html element's clientWidtht
		return document.documentElement.clientWidth;
	}
	else if (document.body && document.body.clientWidth) {
		return document.body.clientWidth;
	}
	return 1; // 0 could lead to dividing 0 by 2.
}





function resetStyleSheet() {
	var xBrowserCssRule;

	if (document.styleSheets[0].rules) {				// IE
		xBrowserCssRule = document.styleSheets[0].rules
	}
	else if (document.styleSheets[0].cssRules) {		// Mozilla and the others
		xBrowserCssRule = document.styleSheets[0].cssRules
	}

	
	var winWidth = 0;
	winWidth = getInsideWindowWidth();


	var marginLeftToUse = winWidth - 990;
	if (marginLeftToUse > 2) { // avoid dividing by 0;
		marginLeftToUse = marginLeftToUse/2;
	}


	xBrowserCssRule[2].style.display =  'none';
	xBrowserCssRule[3].style.display =  'none';

	
	if (marginLeftToUse > 1) {
		xBrowserCssRule[1].style.marginLeft =  marginLeftToUse + 'px';
		xBrowserCssRule[0].style.backgroundPosition= (marginLeftToUse - 211) + 'px 0px';
	}
	else {
		xBrowserCssRule[0].style.backgroundPosition= '-211px 0px';
		xBrowserCssRule[1].style.marginLeft = '0px';

	}
}


window.onresize=resetStyleSheet;



function openEnglish() {
	var newPG = "http://www.meadowviewcottage.co.uk/" + tE + ".html";
	top.location.href = newPG;
}



function openFrench() {
	var newPG = "http://www.meadowviewcottage.co.uk/" + tF + ".html";
	top.location.href = newPG;
}



function openGerman() {
	var newPG = "http://www.meadowviewcottage.co.uk/" + tG + ".html";
	top.location.href = newPG;
}
















