function startTimer(loc){
	$("#timeoutRedir").html(countDown + " seconds");	
	tId = setInterval("countDownTimer('" + loc + "')",1000);
}
function countDownTimer(loc){
	countDown--;
	var msg = "";
	if(countDown==0){
		clearInterval(tId);
		msg = "0 seconds.";
		window.location = loc;
	}else{
		msg = countDown + " ";
		msg += "second";
		if(countDown != 1){
			msg += "s";
		}
	}
	$("#timeoutRedir").html(msg);
}


var gAutoPrint = true;
function printById(id){
	var html = "<html><head>";	
	/*if (document.getElementsByTagName != null){
		var headTags = document.getElementsByTagName("head");
		if (headTags.length > 0) {
			html += headTags[0].innerHTML;
		}
	}*/
	html += "<link type=\"text/css\" rel=\"stylesheet\" href=\"/library/styles/pg.css\" />";

	
	html += "</head><body>";
	html += $("#" + id).html();
	html += "</body></html>";
	var printWin = window.open("","processPrint");
	printWin.document.open();
	printWin.document.write(html);
	printWin.document.close();
	if(gAutoPrint){
		printWin.print();	
	}
	return false;
}

