/*
* gsmenu.js v1.0.01.00015
* 
* Copyright (c) 2003-2008 Gens Software Ltd. All Rights Reserved.
*/

var FontColor = '#4F4F4F';
var FontColorOver = '#FFFFFF';

var BGColor = '#f1f2f4';
var BGColorOver = '#999999';

var tmBGColor = '#4F4F4F';
var tmBGColorOver = '#999999';

var smBGColor = '#FFFFFF';
var smBGColorOver = '#f1f2f4';

var naBGColor = '#0099FF';

var sideMenuWidth = 177;
var separatorWidth = 17;

function writeHeader (nPage)
{
	var str1 = '<table cellpadding="0" cellspacing="0" border="0">'+
			'<tr><td><table cellpadding="0" cellspacing="0" border="0" background="/images/gs_bg1.gif">'+
			'<tr><td align="left" valign="middle" height="107" width="135"><a href="/index.html"><IMG src="/images/logobot_new.gif" border="0"></a></td></tr>'+
			'</table></td>'+
			'<td><table cellpadding="0" cellspacing="0" border="0" background="/images/gs_header3.gif">'+
			'<tr><td align="left" valign="middle"><IMG height="107" width="750" src="/images/spacer.gif" border="0"></td></tr>'+
			'</table></td>'+
			'<td><table cellpadding="0" cellspacing="0" border="0" background="/images/gs_header3-1.gif">'+
			'<tr><td align="left" valign="middle" height="107" width="750"><IMG height="1" width="1" src="/images/spacer.gif" border="0"></td></tr>'+
			'</table></td></tr>'+
			'<tr bgColor="black"><td colspan="3" align="left" valign="middle" height="25" background="/images/top_gradient.gif"  STYLE="background-repeat:repeat-y;">';
	var str2 = '</td></tr></table>';

	var str3 = '<BR><TABLE cellSpacing=0 cellPadding=0 width="720" border=0>'+
			'<TR><TD valign="top">'+
			'<BR><BR><BR>';
	var str4 = '</TD>'+
			'<TD width="1%"><IMG alt="" border=0 height=23 src="/images/empty.gif" width=17></TD>'+
			'<TD width="99%">';

	document.write(str1);
	writeTopMenu (nPage);
	document.write(str2);
	document.write(str3);
	writeSideMenu (nPage);
	document.write(str4);
}

function writeFooter ()
{
	var str1 = '<BR><IMG height=1 src="/images/empty.gif" width=524 border=0>'+
		'</TD>'+
		'<TD width="1%"><IMG height=1 alt="" src="/images/empty.gif" width=5 border=0></TD>'+
		'</TR></TABLE>'+
		
		'<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>'+
		'<TBODY>'+
		/* New code */
		'<TR>'+'<TD align="center">'+'<SMALL class=graymd>'
		+'If you have any questions please contact us at '
		+'<a href="mailto:RadikG@genssoft.com">'+'<i>'
		+'Support@genssoft.com'
		+'</i>'+'</a>'+'<BR>'
		+'<i>4050 38th West Avenue, Vancouver BC, V6N 2Y9, Canada, </i>'
		+'Tel: <i>604-266-5767 </i>Fax: <i>604-266-5769</i></td>'
		+'</TR>'+
		/* End */
		'<TR>'+
		'<TD background="/images/bg_bot2.gif">&nbsp;</TD></TR>'+
		'</TBODY></TABLE>'+
		
		'<IMG height=6 src="/images/empty.gif" width=1 border=0>'+
		'<BR><TABLE cellSpacing=0 cellPadding=0 width=720 border=0>'+
		'<TBODY>'+
		'<TR vAlign=top>'+
		'<TD width="1%"><IMG height=1 src="/images/empty.gif" width=17 border=0></TD>'+
		'<TD width="99%"><SMALL class=graymd>'+
		' Copyright © 2003-2010. Gens Software Ltd. All Rights Reserved.'+
		'</TD>'+
		'<TD><A href="/contacts/">'+
		'<IMG class=linknorm'+
		' onmouseover="this.className=\'linkover\'"'+
		' onmouseout="this.className=\'linknorm\'" height=16 alt=Feedback'+
		' src="/images/link_feedback.gif" width=71 border=0></A></TD>'+
		'</TR>'+
		'</TBODY></TABLE>'+
		'</TD></TR></TBODY></TABLE>'+
		'<IMG height=6 src="/images/empty.gif" width=1 border=0><BR>';
		document.write(str1);
}

function writeSideMenu (nMenu)
{
	if (nMenu == 2)
	{
		m1 = new sideMenu (nMenu,'About');
		m1.addItem ('Company Profile','/about/company_profile/company_pr1.html');
		m1.addItem ('Major Projects','/about/major_projects/projects.html');
//		m1.addItem ('Staff','/about/staff/staff.html');
		m1.addItem ('Partners','/about/partners/partners.html');
		m1.addItem ('Contact Us','/contacts');
	}
	else if (nMenu == 3)
	{
		m1 = new sideMenu (nMenu,'Products');
	
		i1 = m1.addItem ('QuickMail Migration','/products/QM/QM.html');
		i1.addSubItem ('Microsoft Exchange','/products/QM/ex.html');
		i1.addSubItem ('Lotus Notes','/products/QM/lotus.html');
		i1.addSubItem ('IMAP4 Server','/products/QM/imap4.html');
		i1.addSubItem ('Others','/products/QM/others.html');
	
		i2 = m1.addItem ('Biometric Certificates','/products/biocert/index.html');
		i2.addSubItem ('Iris Biometric Certificate','/products/biocert/iris.html');
		i2.addSubItem ('BioAPI Biometric Certificate','/products/biocert/bioapi.html');
	
		i3 = m1.addItem ('Biometric Single Sign-On','/products/sso/index.html');
		i3.addSubItem ('Iris Recognition SSO','/products/sso/iris.html');

		i4 = m1.addItem ('BioLink Products','/products/biolink/index.html');
		i4.addSubItem ('BioLink Products','/products/biolink/index.html');
	}	
	else if (nMenu == 4)
	{
		m1 = new sideMenu (nMenu,'Services');
		
		i1 = m1.addItem ('Biometric Application Development','/services/bio_app_devel/index.html');
		i1.addSubItem ('Iris Recognition','/services/bio_app_devel/iris.html');
		i1.addSubItem ('BioAPI','/services/bio_app_devel/bioapi.html');
		i1.addSubItem ('Fingerprint U-Match','/services/bio_app_devel/umatch.html');
		
		i2 = m1.addItem ('Application Development','/services/appdevelopment/');
		i2.addSubItem ('Web/Java/XML','/services/appdevelopment/webapps.html');
		i2.addSubItem ('Custom Applications','/services/appdevelopment/cust_app.html');
		i2.addSubItem ('Smart Cards','/services/appdevelopment/sc.html');
		i2.addSubItem ('APPC/LU6.2','/services/appdevelopment/appc.html');
		i2.addSubItem ('3270 EHLLAPI','/services/appdevelopment/3270.html');
		
		i3 = m1.addItem ('E-Mail Solutions','/services/mail_solution/index.html');
		i3.addSubItem ('Migration','/services/mail_solution/migration.html');
		i3.addSubItem ('Integration','/services/mail_solution/integration.html');
		i3.addSubItem ('Gateways','/services/mail_solution/gateways.html');
		
		i4 = m1.addItem ('IBM Mainframe','/services/mainframe/index.html');
		i4.addSubItem ('Capacity Planning','/services/mainframe/capacity.html');
		i4.addSubItem ('Performance Tuning','/services/mainframe/perf.html');
		i4.addSubItem ('Service Level Agreements','/services/mainframe/serv_level.html');
		i4.addSubItem ('Accounting &amp; Chargeback','/services/mainframe/acc.html');
		i4.addSubItem ('Legacy Applications','/services/mainframe/legacy.html');
		i4.addSubItem ('Application Porting','/services/mainframe/porting.html');
	}
	else if (nMenu == 5)
	{
		m1 = new sideMenu (nMenu,'Customers');
		m1.addItem ('Customers','/customers');
//		m1.addItem ('What our customers say about us','/customers');
	}
	else if (nMenu == 6)
	{
		m1 = new sideMenu (nMenu,'Contacts');
		m1.addItem ('Company Profile','/about/company_profile/company_pr1.html');
		m1.addItem ('Major Projects','/about/major_projects/projects.html');
	//	m1.addItem ('Staff','/about/staff/staff.html');
		m1.addItem ('Partners','/about/partners/partners.html');
		m1.addItem ('Contact Us','/contacts');
	}
	else
	{
		document.write('<IMG alt="" border=0 height=23 src="/images/empty.gif" width='+sideMenuWidth+'>');
		return;
	}
	
	document.write(m1);
};

function writeTopMenu (nPage)
{
	m1 = new topMenu (1);
	
	if (nPage == 2)
	{
		m1.addItem ('/images/nav_about.gif');
	}
	else
	{
		i1 = m1.addItem ('/images/nav_about.gif','/about');
		i1.addSubItem ('Company Profile','/about/company_profile/company_pr1.html');
		i1.addSubItem ('Major Projects','/about/major_projects/projects.html');
	//	i1.addSubItem ('Staff','/about/staff/staff.html');
		i1.addSubItem ('Partners','/about/partners/partners.html');
		i1.addSubItem ('Contact Us','/contacts');
	}
	if (nPage == 3)
	{
		m1.addItem ('/images/nav_products.gif');
	}
	else
	{
		i2 = m1.addItem ('/images/nav_products.gif','/products');
		i2.addSubItem ('QuickMail Migration','/products/QM/QM.html');
		i2.addSubItem ('Biometric Certificates','/products/biocert/index.html');
		i2.addSubItem ('Biometric Single Sign-On','/products/sso/index.html');
		i2.addSubItem ('BioLink Products','/products/biolink/index.html');
	}	
	if (nPage == 4)
	{
		m1.addItem ('/images/nav_services.gif');
	}
	else
	{
		i3 = m1.addItem ('/images/nav_services.gif','/services');
		i3.addSubItem ('Biometric Application Development','/services/bio_app_devel/iris.html');
		i3.addSubItem ('Application Development','/services/appdevelopment/webapps.html');
		i3.addSubItem ('E-Mail Solutions','/services/mail_solution/migration.html');
		i3.addSubItem ('IBM Mainframe','/services/mainframe/capacity.html');
	}	
	if (nPage == 5)
	{
		m1.addItem ('/images/nav_customers.gif');
	}
	else
	{
		i4 = m1.addItem ('/images/nav_customers.gif','/customers');
		i4.addSubItem ('Customers','/customers');
//		i4.addSubItem ('What our customers say about us','/customers');
	}
	if (nPage == 6)
	{
		m1.addItem ('/images/nav_contacts.gif');
	}
	else
	{
		i5 = m1.addItem ('/images/nav_contacts.gif','/contacts');
	}
	
	document.write(m1);
};

var act = "";
var mact = "0";

var tid;	//timer id
var kto=200; //killTimeout [ms]

function pop_Up(m,m1,n)
{

	master = event.srcElement;
	if (master.height == 20)
		mt = master.offsetTop 
	else
		mt = 0;
	
	if (document.getElementById(m)) 
	{
		if (tid)
		{
			window.clearTimeout(tid);
			pop_Down();
		}
		topmenu = (m.substr (0, 2) == 'tm');
		
		if (n)	
		{
			if (act != '' && act != m)
			{
				document.getElementById(act).style.visibility = 'hidden';
				if (mact != "0")
					document.getElementById('m'+mact).style.backgroundColor=(topmenu)?tmBGColor:smBGColor;
			}
			if (topmenu)
			{
				document.getElementById(m).style.pixelLeft=event.x - event.offsetX+document.body.scrollLeft+5;
				document.getElementById(m).style.pixelTop=event.y - event.offsetY+document.body.scrollTop+master.height+1;
			}
			else
			{
				document.getElementById(m).style.pixelLeft=sideMenuWidth-1;//event.x - event.offsetX+document.body.scrollLeft+135;
				document.getElementById(m).style.pixelTop=event.y - event.offsetY+document.body.scrollTop-3-mt;
			}
		}
		if (m1 != "0")
			mact = m1;
		if (mact != "0")
			document.getElementById('m'+mact).style.backgroundColor = (topmenu)?tmBGColorOver:smBGColorOver;

		document.getElementById(m).style.visibility='visible';
		act = m;
	}
};

function pop_Down()
{
	topmenu = (act.substr (0, 2) == 'tm');
	if (mact != "0")
		document.getElementById('m'+mact).style.backgroundColor=(topmenu)?tmBGColor:smBGColor;
	if (document.getElementById(act))
	{
		document.getElementById(act).style.visibility = 'hidden';
		act="";
		if (mact!="0")
			mact = "0";
	}
	tid = null;
};

function pop_DownTM()
{
	tid=window.setTimeout('pop_Down()',kto);
};

// menuItem object
function menuItem (caption, link)
{
	this.caption = caption;
	this.link = link;
	this.aSubItems = [];
};

menuItem.prototype.addSubItem = function(caption, link)
{
	this.aSubItems[this.aSubItems.length] = new menuItem(caption, link);
};

function sideMenu (id, title)
{
	this.id = id;
	this.title = title;
	this.aItems = [];
};

sideMenu.prototype.addItem = function(caption, link)
{
	var item = new menuItem(caption, link);
	this.aItems[this.aItems.length] = item;
	return item;
};

sideMenu.prototype.toString = function()
{
	var str = "";
	str += '<TABLE WIDTH="'+sideMenuWidth+'" CELLSPACING=0 CELLPADDING=0 BORDER=0>';
	str += '<TR><TD><SMALL>&nbsp;</SMALL></TD><TD WIDTH="99%" CLASS="padmenu"><SMALL CLASS="hlt"><B>'+this.title+'</B></SMALL></TD><TD WIDTH="1%" ALIGN="right">&nbsp;</TD></TR>';
	str += '<TR><TD COLSPAN="3" >&nbsp;</TD></TR>';
	str += '<TR><TD COLSPAN="3" CLASS="bggrayltr"><IMG SRC="/images/empty.gif" WIDTH=1 HEIGHT=1 BORDER=0></TD></TR>';
	for (var i=0; i<this.aItems.length; i++)
	{
		str += '<TR ID=m'+this.id+i;
		str += ' ONMOUSEOVER="';
		if (this.aItems[i].aSubItems.length)
			str += 'document[\'empty'+this.id+i+'\'].src=\'/images/arr_blue.gif\';';
		str += 'pop_Up(\'menu'+this.id+i+'\',\''+this.id+i+'\',true);this.style.backgroundColor=\''+smBGColorOver+'\'"';
		str += ' ONMOUSEOUT="';
		if (this.aItems[i].aSubItems.length)
			str += 'document[\'empty'+this.id+i+'\'].src=\'/images/arr_gray.gif\';';
		str += 'pop_DownTM();this.style.backgroundColor=\''+smBGColor+'\'">';
		str += '<TD WIDTH=1%><SMALL>&nbsp;</SMALL></TD>';
		str += '<TD WIDTH=98% CLASS=padmenu><A HREF="'+this.aItems[i].link+'" CLASS=navmenu><SMALL>'+this.aItems[i].caption+'</SMALL></A></TD>';
		str += '<TD WIDTH=1% ALIGN=right>';
		if (this.aItems[i].aSubItems.length)
			str += '<A HREF="'+this.aItems[i].link+'"><IMG SRC=/images/arr_gray.gif WIDTH=20 HEIGHT=20 ALT="" BORDER=0 NAME="empty'+this.id+i+'"  onmouseover="" onmouseout=""></A>';
		str += '</TD>';
		str += '</TR>';
		str += '<TR><TD COLSPAN=3 CLASS=bggrayltr><IMG SRC=/images/empty.gif WIDTH=1 HEIGHT=1 BORDER=0></TD></TR>';
		if (this.aItems[i].aSubItems.length)
		{
			str += '<div id=menu'+this.id+i+' class=pmenu>';
			for (var n=0; n<this.aItems[i].aSubItems.length; n++)
			{
				str += '<div class=imenu';
				str += ' onmouseover="pop_Up(\'menu'+this.id+i+'\',\''+this.id+i+'\',false);this.style.backgroundColor=\''+BGColorOver+'\';this.style.color=\''+FontColorOver+'\'"';
				str += ' onmouseout="pop_DownTM();this.style.backgroundColor=\''+BGColor+'\';this.style.color=\''+FontColor+'\'"';
				str += ' onclick="document.location=\''+this.aItems[i].aSubItems[n].link+'\'">';
				str += '<SMALL>'+this.aItems[i].aSubItems[n].caption+'</SMALL></div>';
			}
			str += '</div>';
		}
	}
	str += '</TABLE>';
	return str;
};

function topMenu (id)
{
	this.id = id;
	this.aItems = [];
};

topMenu.prototype.addItem = function(caption, link)
{
	var item = new menuItem(caption, link);
	this.aItems[this.aItems.length] = item;
	return item;
};

topMenu.prototype.toString = function()
{
	var str = "";
	str += '<DIV style="Z-INDEX: 1;position=relative;left:'+(sideMenuWidth+separatorWidth)+'px">';
    str += '<TABLE cellSpacing=0 cellPadding=0 width="1%" bgColor=#ffffff border=0>';
    str += '<TBODY>';
    str += '<TR>';
    str += '<TD style="BACKGROUND-IMAGE: none">';
    str += '<TABLE cellSpacing=1 cellPadding=0 width="1%" bgColor=#ffffff border=0>';
    str += '<TBODY><TR>';
	for (var i=0; i<this.aItems.length; i++)
	{
		str += '<TD class=bggrayDk ID=m'+this.id+i;
		if (this.aItems[i].link)
		{
			str += ' ONMOUSEOVER="pop_Up(\'tmenu'+this.id+i+'\',\''+this.id+i+'\',true);this.style.backgroundColor=\''+tmBGColorOver+'\'"';
			str += ' ONMOUSEOUT="pop_DownTM();this.style.backgroundColor=\''+tmBGColor+'\'">';
			str += '<A href="'+this.aItems[i].link+'">';
		}
		else
		{
			str += ' style="background-color:'+naBGColor+'">';
		}
		str += '<IMG src="'+this.aItems[i].caption+'" alt="" height=16 width=74 border=0>';
		if (this.aItems[i].link)
			str += '</A>';
		str += '</TD>';
		if (this.aItems[i].aSubItems.length)
		{
			str += '<div id=tmenu'+this.id+i+' class=pmenu>';
			for (var n=0; n<this.aItems[i].aSubItems.length; n++)
			{
				str += '<div class=imenu';
				str += ' onmouseover="pop_Up(\'tmenu'+this.id+i+'\',\''+this.id+i+'\',false);this.style.backgroundColor=\''+BGColorOver+'\';this.style.color=\''+FontColorOver+'\'"';
				str += ' onmouseout="pop_DownTM();this.style.backgroundColor=\''+BGColor+'\';this.style.color=\''+FontColor+'\'"';
				str += ' onclick="document.location=\''+this.aItems[i].aSubItems[n].link+'\'">';
				str += '<SMALL>'+this.aItems[i].aSubItems[n].caption+'</SMALL></div>';
			}
			str += '</div>';
		}
	}
	str += '</TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV>';
	return str;
};
