/*// Legacy error messages
function remoteTP(){
	//win2=window.open("custom_content/popuploginTP.asp","",'toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,width=180,height=220,');
	//win2.creator=self;
	requiresTeachitWorks();
}

function ShowTPWarning() {
	//alert("This resource is only available to Teachit.plus members");
	requiresTeachitPlus();
}

function ShowNMWarning() {
	//alert("This resource is only available to Teachit members");
	requiresTeachitPlus();
}

// New error functions
function requiresTeachitPlus(intWidth,intHeight) {
	if(intWidth === undefined){
		intWidth=180;
	}
	if(intHeight === undefined){
		intHeight=220;
	}
	openWindow("applocal/popupErrorL1Req.html", intWidth, intHeight);
}

function requiresTeachitWorks(intWidth,intHeight) {
	if(intWidth === undefined){
		intWidth=180;
	}
	if(intHeight === undefined){
		intHeight=220;
	}
	openWindow("applocal/popupErrorL2Req.html", intWidth, intHeight);
}

function requiresTeachitLanguage(intWidth,intHeight) {
	if(intWidth === undefined){
		intWidth=180;
	}
	if(intHeight === undefined){
		intHeight=220;
	}
	openWindow("applocal/popupErrorL3Req.html", intWidth, intHeight);
}

function requiresLevel0(intWidth,intHeight) {
	if(intWidth === undefined){
		intWidth=360;
	}
	if(intHeight === undefined){
		intHeight=300;
	}
	openWindow("applocal/popupErrorL0Req.html", intWidth, intHeight);
}
function requiresLevel0a(intWidth,intHeight) {
	if(intWidth === undefined){
		intWidth=360;
	}
	if(intHeight === undefined){
		intHeight=300;
	}
	openWindow("applocal/popupErrorL0aReq.html", intWidth, intHeight);
}

function requiresLevel1(intWidth,intHeight) {
	if(intWidth === undefined){
		intWidth=180;
	}
	if(intHeight === undefined){
		intHeight=220;
	}
	openWindow("applocal/popupErrorL1Req.html", intWidth, intHeight);
}

function requiresLevel2(intWidth,intHeight) {
	if(intWidth === undefined){
		intWidth=180;
	}
	if(intHeight === undefined){
		intHeight=220;
	}
	openWindow("applocal/popupErrorL2Req.html", intWidth, intHeight);
}

function requiresLevel3(intWidth,intHeight) {
	if(intWidth === undefined){
		intWidth=180;
	}
	if(intHeight === undefined){
		intHeight=220;
	}
	openWindow("applocal/popupErrorL3Req.html", intWidth, intHeight);
}

function upgradeLevel2(intWidth,intHeight) {
	if(intWidth === undefined){
		intWidth=180;
	}
	if(intHeight === undefined){
		intHeight=220;
	}
	openWindow("applocal/popupErrorL2Upgrade.html", intWidth, intHeight);
}

function openWindow(url, width, height) {
	var wh = window.open(url, "test", 'toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,width='+width+',height='+height);
	wh.creator = self;
}

function openResizableWindow(url, width, height) {
	var wh = window.open(url, "", 'toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=yes,width='+width+',height='+height);
	wh.creator = self;
}

function openMenu(item, anchor) {
	if (document.getElementById) {
		var elem = document.getElementById("MENUDIV" + item);
		if (elem) {
			var tl = getParentMenuDiv(elem);
			closeMenus(tl);
			elem.style.display = "block";
			document.body.className = elem.className;
		}
	}
}

function closeMenus(notitem) {
	var divs = document.getElementsByTagName("div");
	for (var i = 0; i < divs.length; i++) {
		if (divs[i].id.substring(0, 7) == "MENUDIV") {
			if (getParentMenuDiv(divs[i]) != notitem) {
				divs[i].style.display="none";
			}
		}
	}
}

function getParentMenuDiv(elem) {
	var rv;
	if (elem.id && elem.id.substring(0, 7) == "MENUDIV")
		rv = elem.id;
	if (elem.parentNode)
		return getParentMenuDiv(elem.parentNode) || rv;
	return rv;
}

function positionUserMsg(message_width) {
	if (!document.getElementById) return;
	var elem = document.getElementById("divUserMsg");
	if (!elem) return;
	elem.style.display = "block";
	var scrollX = 0, scrollY = 0;
	if (document.body && typeof document.body.scrollTop != "undefined") {
		scrollX+= document.body.scrollLeft;
		scrollY+= document.body.scrollTop;
		if (document.body.parentNode && typeof document.body.parentNode.scrollTop != "undefined") {
			scrollX+= document.body.parentNode.scrollLeft;
			scrollY+= document.body.parentNode.scrollTop;
		}
	} else if (typeof window.pageXOffset != "undefined") {
		scrollX+= window.pageXOffset;
		scrollY+= window.pageYOffset;
	}
	var x = Math.round((getInsideWindowWidth()/2) - (document.getElementById("tblUserMsg").clientWidth / 2)) + scrollX;
	var y = Math.round((getInsideWindowHeight()/2) - 200) + scrollY;
	elem.style.top = y + "px";
	elem.style.left = x + "px";
}
function getInsideWindowHeight() {
	if (window.innerHeight) {
		return window.innerHeight;
	} else if (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) {
		return document.body.parentElement.clientHeight;
	} else if (document.body && document.body.clientHeight) {
		return document.body.clientHeight;
	}
	return 800;
}
function getInsideWindowWidth() {
	if (window.innerWidth) {
		return window.innerWidth;
	} else if (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) {
		return document.body.parentElement.clientWidth;
	} else if (document.body && document.body.clientWidth) {
		return document.body.clientWidth;
	}
	return 800;
}
function closeUserMsg() {
	document.getElementById("divUserMsg").style.display = "none";
}
var xLoad = window.onload;
window.onload = function () { positionUserMsg(); if (xLoad) xLoad(); };
var xResize = window.onresize;
window.onresize = function () { positionUserMsg(); if (xResize) xResize(); };

function calculateInstitutionPrice(intTeachers){
		bolEmail = 0
		if(intTeachers>=0){
			if(intTeachers<=100){	
				if(intTeachers<=10){
					fltPrice = 25;
					fltNormalPrice = 25;
				}else if(intTeachers<=50){
					fltPrice = 17.5;
					fltNormalPrice = 17.5;
				}else{
					fltPrice = 15;
			 		fltNormalPrice = 15;	
				}
				fltTotalPrice = fltPrice * intTeachers;
				fltTotalPrice = fltTotalPrice.toFixed(2);
				fltTotalNormalPrice = fltNormalPrice * intTeachers;
				fltTotalNormalPrice = fltTotalNormalPrice.toFixed(2);
				strText = "*Special Offer* - Total price for 1st year = £" + fltTotalPrice;
				strText2 = "Total price per year = £" + fltTotalNormalPrice;	
			}else{ 
				strText = 'Please e-mail <a href="mailto:membership@teachitworld.com">membership@teachitworld.com</a> for bespoke quotation';
				//strText = "Please e-mail "
				strText2 = ""
				//bolEmail = 1
			}
		}else{
			strText = "Invalid number of teachers";
			strText2 = "";
		}

	document.getElementById("institution_price_span").innerHTML = strText;
	document.getElementById("institution_normal_price_span").innerHTML = strText2;

}

var g_siteDesc = "My Content";
function addToMyTeachit(intResource, intSite, strDesc){
	g_siteDesc = strDesc;
	utilFetchXML('application/favourites/addtomyteachitxml.asp?resource=' + intResource + '&works=0&site=' + intSite,addToMyTeachitPopup,null);
	return false;
}

function addToMyTeachitWorks(intResource, intSite, strDesc){
	g_siteDesc = strDesc;
	utilFetchXML('application/favourites/addtomyteachitxml.asp?resource=' + intResource + '&works=1&site=' + intSite,addToMyTeachitPopup,null);
	return false;
}

function addToMyLea(intResource, intSite, intGroup, strDesc){
	g_siteDesc = strDesc;
	utilFetchXML('application/favourites/addtomyteachitxml.asp?resource=' + intResource + '&works=2&site=' + intSite + "&group=" + intGroup,addToMyLeaPopup,null);
	return false;
}

function addToMyTeachitPopup(p1,p2,p3){
	var intSite = p1.firstChild.firstChild.nodeValue;
	var strDiv = 'content';
	if(intSite == 2 && g_siteDesc == "My Teachitprimary"){
		strDiv = 'content_home';
	}

	popShowWindow(strDiv, 'over', '<div id="resourcepop" style="position:absolute; width: 200px; border: 1px solid #000; text-align: center; padding: 20px; background-color: #FFF">Resource added to ' + g_siteDesc + '</div>', "ADDTOTEACHIT");

	if (!document.getElementById) return;
	var elem = document.getElementById("resourcepop");
	if (!elem) return;
	elem.style.display = "block";
	var scrollX = 0, scrollY = 0;
	if (document.body && typeof document.body.scrollTop != "undefined") {
		scrollX+= document.body.scrollLeft;
		scrollY+= document.body.scrollTop;
		if (document.body.parentNode && typeof document.body.parentNode.scrollTop != "undefined") {
			scrollX+= document.body.parentNode.scrollLeft;
			scrollY+= document.body.parentNode.scrollTop;
		}
	} else if (typeof window.pageXOffset != "undefined") {
		scrollX+= window.pageXOffset;
		scrollY+= window.pageYOffset;
	}
	var x = Math.round((getInsideWindowWidth()/2) - (elem.clientWidth / 2)) + scrollX;
	var y = Math.round((getInsideWindowHeight()/2) - 200) + scrollY;
	elem.style.top = y + "px";
	elem.style.left = x + "px";

	setTimeout('document.getElementById("resourcepop").style.display = "none"',4000);
}

function addToMyLeaPopup(p1,p2,p3){
	
	var intGroup = p1.firstChild.firstChild.nodeValue;
	var strDiv = 'content';
	
	popShowWindow(strDiv, 'over', '<div id="resourcepop" style="position:absolute; width: 200px; border: 1px solid #000; text-align: center; padding: 20px; background-color: #FFF">Resource added to ' + g_siteDesc + '</div>', "ADDTOTEACHIT");

	if (!document.getElementById) return;
	var elem = document.getElementById("resourcepop");
	if (!elem) return;
	elem.style.display = "block";
	var scrollX = 0, scrollY = 0;
	if (document.body && typeof document.body.scrollTop != "undefined") {
		scrollX+= document.body.scrollLeft;
		scrollY+= document.body.scrollTop;
		if (document.body.parentNode && typeof document.body.parentNode.scrollTop != "undefined") {
			scrollX+= document.body.parentNode.scrollLeft;
			scrollY+= document.body.parentNode.scrollTop;
		}
	} else if (typeof window.pageXOffset != "undefined") {
		scrollX+= window.pageXOffset;
		scrollY+= window.pageYOffset;
	}
	var x = Math.round((getInsideWindowWidth()/2) - (elem.clientWidth / 2)) + scrollX;
	var y = Math.round((getInsideWindowHeight()/2) - 200) + scrollY;
	elem.style.top = y + "px";
	elem.style.left = x + "px";

	setTimeout('document.getElementById("resourcepop").style.display = "none"',4000);
}

function changeImg(imgId, imgSrc) {
	var elem = document.getElementById(imgId);
	if (elem)
		elem.src = "/custom_content/images/" + imgSrc;
}
*/ 
