


function init() {	
	
	var objReg;
	var param;		
	
	
		 				
	if (frames && frames.main && frames.main.location.href.indexOf('quasar2/index.pl') == -1) {
	
		objReg = new RegExp();
		objReg = /(.*)\?(.*)/;	
		
		param = '';
		
		if (objReg.test(location.href) == true) {
			param = '&' + RegExp.$2;
		}
		
		frames.main.location.href = script + param;	
		
	}
	
	
}

function init2() {	
		
	var objReg;
	var param;
	
	objReg = new RegExp();
	objReg = /(.*)\?(.*)/;	
	
	param = '';
	
	if (objReg.test(location.href) == true) {
		param = '?' + RegExp.$2;
	}

	frames.start.location.href = 'index2.htm' + param;
	

}



function set_frames (aid,sid,cid,url,navi) {	
	

	if (navi == 'noframes') return true;
	

	if (url.length > 0 && (top.location.href.indexOf('/html/') != -1 || top.location.href.indexOf(url) != 0 || top.location.href.indexOf('quasar2/index.pl') != -1)) {  				

	
		div = '<div class="redirect">Redirecting Page to:<br><br><a href=' + url + '>' + url + '</a></div>';		

		if (document.getElementById('content')) document.getElementById('content').innerHTML = div;
		
		objReg = new RegExp();
		objReg = /(.*)\?(.*)/;	
	
		param = '';	
		
		if (objReg.test(location.href) == true) {
			param = '/?' + RegExp.$2 + '&s=' + sid;
			url = url + param;
			
		}

		top.location.href = url;
		return true;
	
	}		

	n = top.frames.navi;
	
	if (top.frames[0] && top.frames[0].frames.navi) {
		n = top.frames[0].frames.navi;
	}
	
	if (navi == 'no') return true;	

				
	if (n) {					
		if (navi == 'force' || ( navi == 'check' && ! String(n.location).match(/quasar2\/index.pl/gi))) {
			n.location.href = location.pathname + "?sid=" + sid + "&c=" + cid + "&a=" + aid + "&t=1";
		}			
	}	
	
	
	return true;
			
}


function set_navi () {
	
	var m,n,n0,aid,sid;
	
	if (top.frames.main) m = top.frames.main;
	if (top.frames[0] && top.frames[0].frames.main) m = top.frames[0].frames.main;	
	
	if (m && m.frames.main2) m = m.frames.main2;	
	
	if (!m) return;
		
	if (top.frames.navi) n = top.frames.navi;
	if (top.frames[0] && top.frames[0].frames.navi) n = top.frames[0].frames.navi;
	
	if (!n) return;
	
	n0 = n;
	
	m = m.document.formmain;
	n = n.document.formnavi;

	if (!n) return;
	
	if (m) {
	
		aid = (m.a ? m.a.value : 0);
		sid = (m.sid ? m.sid.value : 0);
	
		if (aid == 0) return;
		
		aid = aid - (aid % 10);
		
		n.sid.value = sid;
		n.a.value = aid;
		
		if (n0.anavi[aid]) n0.navi_id0 = n0.anavi[aid];
	
	}

	n0.do_navi(0);
	
}


function set_user(user_name) {
   			
  var b;
		
	if (top.frames.bottom) b = top.frames.bottom;
	if (top.frames[0] && top.frames[0].frames.bottom) b = top.frames[0].frames.bottom;	

	if (!b) return;
	
	if (b.document.getElementById("user_name")) {	
			b.document.getElementById("user_name").innerHTML = user_name;	
	}   			
   			
} 

function do_action (a) {

	var n, s, c, u;
	
	if (top.frames.navi) n = top.frames.navi;
	if (top.frames[0] && top.frames[0].frames.navi) n = top.frames[0].frames.navi;	

	if (!n) return;		
	
	n = n.document.formnavi;	
	
	s = n.sid.value;
	c = n.c.value;
	
	u = n.action + '?c=' + c + '&sid=' + s + '&a=' + a;
	
	frames.main2.location.href = u;
	
	
}	


function do_scroll (n) {

	var item;
	var m_top;

	item = document.getElementsByName(n)[0];
	
	if (! item) {		
		item = document.getElementById(n);	
	}
	
		
	m_top = 0;
	
	while (item) {

 		m_top += item.offsetTop;
 		item = item.offsetParent;			
	
	}
	
	m_top -= 4;
	
	if (parent.frames.main) {	
		parent.frames.main.document.body.scrollTop = m_top;	
	}
	else {
		document.body.scrollTop = m_top;	
	}

}