//var win = "win"; // Use this value for popup
var win = "_self";
var ansOrder = ["a", "b", "c", "d", "e", "f", "g", "h"];// Can hold more elements depending on the number of questions
/*var _subsections = [['Efficacy of Methadone Maintenance Treatment', 
					'Methadone Maintenance Treatment Program Design', 
					'Methadone Maintenance and HIV/AIDS', 
					'Gender Issues in Methadone Maintenance Treatment', 
					'Buprenorphine and Methadone Maintenance Treatment'], 
					[], []];

*/
function open_firstWindow(url, width, height){
	mywin = window.open(url,'win','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=' + width + ',height=' + height + ',top=0,left=0');
}
function open_window(url,answer) 
    {
		var goString = url + "?" + answer; 
       mywin = window.open(goString,win,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=350,height=350');
	  
    }
	
function nextPage(page){// Check if user clicked the link or browser back button
	window.location = page;

}


function sendData(qNum, score){
	var exp = new Date(); 
	exp.setTime(exp.getTime() + 86400000);//24 hours
	//alert(qNum + ' ; ' + score);
	if(qNum != 'underfined'){
		setCookie("questionNumber", qNum, exp, "/", false, false);
		
	}
	if(score != 'underfined'){
		setCookie("score", score, exp, "/", false, false);
	}
	
}

function setInitData(clickNum, quizNum, posNum){
	var exp = new Date(); 
	exp.setTime(exp.getTime() + 86400000);//24 hours
	
	if(clickNum != 'underfined'){
		setCookie("clickCount", clickNum, exp, "/", false, false);
	}
	if(quizNum != 'underfined'){
		setCookie("quizNumber", quizNum, exp, "/", false, false);
	}
	if(posNum != 'underfined'){
		setCookie("posNum", posNum, exp, "/", false, false);
	}
}

 