// Ver 1.0.090916 mod GRC

var site_tic = 60000;
var site_timer = setTimeout('siteTicSession()', site_tic);

function siteTicSession() {

	if (!window.ajaxInterface)
		return;

	var Ajax = new ajaxInterface("tic", "", "/members/tic.phtml");

	Ajax.doRequest();

	site_timer = setTimeout('siteTicSession()', site_tic);

}

function openWindow(url, name, width, height) {

	if (!width) width = 640;
	if (!height) height = 480;

	window.open(url, name, 'width=' + width + ',height=' + height + ',scrollbars=yes');

}

function changeClass(obj, class_name) {

	obj.className = class_name;

}

function openDrill(id, sessionid, mod) {

	var url = "/members/3d/media.phtml?id=" + id + "&mode=drill";

	if (sessionid)
		url += "&PHPSESSID=" + sessionid;

	if (mod)
		url += "&mod=" + mod;

	window.open(url, "drill", "width=780,height=555,scrollbars=no");

}

function deleteScheme(id) {

	mainform.action.value = "delete";
	mainform.id.value = id;
	mainform.submit();

}

function openChalkboard(schemeid) {

	if (schemeid)
		window.open("/members/scheme2?id=" + schemeid, "cb" + schemeid, "width=1040,height=730,menubar=no,scrollbars=yes");
	else
		window.open("/members/scheme2", "cb", "width=1040,height=730,menubar=no,scrollbars=yes");

}

function showScheme(id) {

	window.open("/members/scheme/view_scheme.phtml?id=" + id, "scheme_view", "width=650,height=610,scrollbars=no");

}

function printPage(url) {

	window.open(url, "print", "width=750,height=500,scrollbars=yes,menubar=yes");

}

function applyAction(action) {

	if (document.mainform) {

		document.mainform.action.value = action;
		document.mainform.submit();

	}

}

function showPopupPage(name) {

	window.open("/members/popup.phtml?name=" + name, name, "width=650,height=610,scrollbars=yes");

}

function showTrickbox() {

	var tb_title = "Tell a Friend about this site";
	var tb_href  = "/inviter/importer.php?keepThis=true&imgpath=http://www.grassrootscoaching.com/inviter/images/ajax-loader1.gif&TB_iframe=true&height=500&width=700";
	var tb_rel   = "";

	if (tb_show)
		tb_show(tb_title, tb_href, tb_rel);

}
