function setCookie(){
	var pagefinder = "2a895610_11be1a211e5_-7fea" + "yes";
	var nextyear = new Date();
	nextyear.setFullYear(nextyear.getFullYear() + 1);
	document.cookie = "2a895610_11be1a211e5_-7fea=" + pagefinder +"; expires=" + nextyear.toGMTString() + "; path = /";
}


function lastPage(){ 
	windowSize();
}	

function windowSize(){	
	var height = screen.height;
		if (height < 786){
			newwindow=window.open("index2.html", "newWind", "width=990,height=645");
			newwindow.focus();
		} else {
			if(!self.opener){
				var w = self;
			}else{
				var w = self.opener;
			}

			w.location = "index2.html";
		}			
}



function openWindow(URLtoOpen,windowName,height,width)
{
windowFeatures ="menubar=no,scrollbars=no,location=no,favorites=no,resizable=no,status=no,toolbar=no,directories=no";
var test = "'"; 
winLeft = (screen.width-width)/2; 
winTop = (screen.height-(height+30))/2; 
myWin= open(URLtoOpen,windowName,"width=" + width +",height=" + height + ",left=" + winLeft + ",top=" + winTop + test + windowFeatures + test);

}

function readingCookie(args){
	var setPage = "";
	var readcookie = document.cookie;
	var findpage = readcookie.indexOf("2a895610_11be1a211e5_-7fea");


	if (findpage != -1){ 

		if (readcookie.indexOf("2a895610_11be1a211e5_-7fea" + "yes") != -1){
			var setPage = "yes";
		
		}else{
			var setPage = "no"

		}
	}else{
		var setPage = "no"
	}

	window.document.course_index.SetVariable("startvar", setPage);	
}


function bookPage(content){
	var booked = window.opener.parent.Main.location.href;
	window.document.bmark.SetVariable("receivedpage", booked);	
}


function loginBoxFunction(lbanswer){
	
		if (lbanswer == true){
			windowSize();			
			self.close();
		}else{

			opener.document.cookie = "2a895610_11be1a211e5_-7fea" +"; expires= Thu, 01-Jan-75 00:00:00 GMT" + "; path = /";
			windowSize();			
			self.close();
		}

}

function openCert(){
		window.open("certificate/cert_of_completion.html", "cert", "toolbar=no, status=no, scrollbars=no, resizable=no, menubar = no, width=540,height=675")
}
