function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "block";
}
function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; }
else { document.getElementById(d).style.display = "none"; }
}

function moveIt(obj, mvTop, mvLeft) {
	obj.style.position = "absolute";
	obj.style.top = mvTop;
	obj.style.left = mvLeft;
}
function positionIngredients() {
	var obj = document.getElementById('ingredientsWindow');

	  var myWidth = 0, myHeight = 0;
	  if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	  }
	
	var newPosTop = 160;
	var newPosLeft = 140;
	
	if (myWidth > 1020) {
		newPosLeft = ((myWidth-1020)/2) + 140; 
	}
	//alert(myWidth);
	moveIt(obj, newPosTop, newPosLeft);
}
function positionElements(d) {
	var obj = document.getElementById(d);

	  var myWidth = 0, myHeight = 0;
	  if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	  }
	
	var newPosTop = 160;
	var newPosLeft = 140;
	
	if (myWidth > 1020) {
		newPosLeft = ((myWidth-1020)/2) + 140; 
	}
	//alert(myWidth);
	moveIt(obj, newPosTop, newPosLeft);
}
function setPopups() {
	positionElements('cookingWindow');
	positionElements('nutritionWindow');
	positionElements('ingredientsWindow');
}
function setPopups_en_dinners() {
	positionElements('ingredientsWindow');
}


