var pre='document.content';
var inc = 3;
var inc2 = 4;
var time = 35;
var time1 = 5;

	dom = (document.getElementById)?1:0; 
    ns4 = (document.layers)?1:0; 
    ns6 = (dom&&!document.all)?1:0;

function obj(name)
{		var nest = arguments[1]||pre+'.document';
		var obj = (ns4)? eval(nest+'.'+name+'Div') : document.getElementById(name+'Div');
	obj.nam = name;																
	obj.css = (ns4)? obj : obj.style;
	obj.doc = (ns4)? obj.document : document;
return obj;
}

var expr = /^([\w_]+)Div$/;

function make(path)
{		
		var path = path||pre+'.document';
		var arr = (ns4)? eval(path).layers : document.getElementsByTagName('DIV')
	for(var i=0;i<arr.length;i++)
	{	var sobj = (ns4)? expr.test(arr[i].id) : expr.test(arr.item(i).id)
		if(sobj) 
		{	var name = RegExp.$1;	
			eval(name+'=obj("'+name+'","'+path+'")');
			if(ns4)	make(path+'.'+name+'Div.document');
		}
	}
}

function show(obj,vis) {obj.css.visibility = (vis)? 'visible' : 'inherit';}
function hide(obj) {obj.css.visibility = 'hidden'}

var move = 0;
function scr(sobj)
{	var obj = eval(sobj);
	obj.data = eval(obj.nam+'Data');
	obj.start = obj.data.y = 0;
	obj.end = obj.offset = (ns4)? obj.clip.height-obj.data.clip.height : obj.offsetHeight - obj.data.offsetHeight;
	obj.timer = null;
	if(obj.offset<0)
	{	obj.up = eval(obj.nam+'Up');
		obj.dn = eval(obj.nam+'Down')
		show(obj.up);
		show(obj.dn);
	}
}

function verPos(obj,pos)
{	obj.y = (pos)? pos : obj.y;
	obj.css.top = obj.y;
}

function scrUp(sobj)
{	var obj = eval(sobj);
	if(obj.data.y<obj.start&&move)
	{ 	obj.data.y+=inc;
		obj.timer = setTimeout('scrUp('+obj.nam+')',time);
	}	
	else obj.data.y = obj.start;
	verPos(obj.data);
return true;
}
function scrDn(sobj)
{	var obj = eval(sobj);
	if(obj.data.y>obj.end&&move)
	{ 	obj.data.y-=inc;
		obj.timer = setTimeout('scrDn('+obj.nam+')',time);
	}	
	else obj.data.y = obj.end;
	verPos(obj.data);
return true;
}

function stop(sobj)
{	var obj = eval(sobj);
	move = 0;
	clearTimeout(obj.timer);
}

document.onmousewheel = wheelHandler;
function wheelHandler() {return false;}

function clip(obj)
{	if(ns4)
 	{	obj.clip.top = obj.t;
		obj.clip.right = obj.r;
		obj.clip.bottom = obj.b;
		obj.clip.left = obj.l;
	}
	else obj.css.clip='rect('+obj.t+' '+obj.r+' '+obj.b+' '+obj.l+')';
}

//reveal variables initialisation
function reveal(obj,start,end)
{	obj.w = (ns4)? obj.clip.width : obj.offsetWidth;
	obj.h = (ns4)? obj.clip.height : obj.offsetHeight;
	obj.t = 0;
	obj.r = obj.w;
	obj.b = obj.h;
	obj.l = 0;
	obj.start = start||0;
	obj.end = end||0;
	//alert(obj.t+','+obj.r+','+obj.b+','+obj.l);
}

//reveal up initialisation
function revealDown(obj)
{	obj.end = obj.h;
	obj.b = obj.start;
	clip(obj);
	show(obj);
	revealDownGo(obj);
}

//reveal up function
function revealDownGo(sobj)
{	var obj = (typeof(sobj!='object'))? eval(sobj) : sobj;
	if(obj.b<obj.end)
	{ 	obj.b += inc2*2;
		clip(obj);
		setTimeout('revealDownGo('+obj.nam+')',time);
	}
	else
	{	obj.b = obj.end;
		clip(obj); 	
		onRevealDownEnd(obj);
	}
}
//on reveal end functions
function onRevealDownEnd(obj)
{
	if(obj.nam=="login_back"){revealDown(guides_back); show(login)}
	if(obj.nam=="guides_back"){show(guides); show(search_back); show(search);}
	// put your events handling code here or overwrite the functions

}

var oSel = 0;
var count=1;
function positionDiv()
{
document.contIdFr.document.getElementById('submenu2').style.top=document.contIdFr.document.body.scrollTop+1;
if(count%2){document.contIdFr.document.getElementById('submenu2').style.visibility='visible';}
else{document.contIdFr.document.getElementById('submenu2').style.visibility='hidden';}
count++;
}

function showSub()
{
if(document.contIdFr.isLoaded)
	{
		s=document.contIdFr;
		var r='';
		for (i in s)
		{
			r=r+i+"-"+s[i]+"<br>";
		}
		positionDiv();
	}
	else{}
}

function arrangeOpt(htitle, visparam1, visparam2)
{
document.getElementById('info_header_text').innerHTML=htitle;
if(visparam1==1){document.getElementById('printpreview').style.visibility="visible";}else{document.getElementById('printpreview').style.visibility="hidden";}
if(visparam2==1){document.getElementById('fastnavigation_back').style.visibility="visible"; document.getElementById('fastnavigation').style.visibility="visible";}else{document.getElementById('fastnavigation_back').style.visibility="hidden"; document.getElementById('fastnavigation').style.visibility="hidden";}
}

function setGuide(id) {document.forms['selGuide'].IdGuide.value = id}
var n=0;
function printpreview() {
	if(n) { n.close(); n=0; }
	n = window.open("print.php?"+document.forms['selGuide'].IdGuide.value,"print","left="+document.getElementById('info_header_back').style.left+",top="+document.getElementById('info_header_back').style.top+posY+",width=507,height=320,toolbar=no,menubar=no,resizable=yes,statusbar=no,screenX=249,screenY=183, scrollbars=1");
	n.focus();
}

var contWidth = 778;
var contHeight = 450;
var width = 0;
var height = 0;
function setPos()//not generic- changes made for the current project
{		width = (ns4||ns6)? window.innerWidth : document.body.offsetWidth;
		height = (ns4||ns6)? window.innerHeight : document.body.offsetHeight-10;
		var bgColor = arguments[0] || '#002252';
	posX = parseInt(width/2-contWidth/2);	posY = parseInt((height-contHeight)/2);
	(posX<0)? posX = 0 : 0;	(posY<0)? posY = 0 : 0;
	document.write('<style type="text/css">#content{ position:absolute; left:'+posX+'; top:'+posY+'; width:778; height:'+contHeight+';  z-index:0;}</style>');
}	