p = document;


function createcssmenu2(){
for (var i=0; i<cssmenuids.length; i++){
  var ultags=document.getElementById(cssmenuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
			ultags[t].style.top=ultags[t].parentNode.offsetHeight+csssubmenuoffset+"px"
    	var spanref=document.createElement("span")
			spanref.className="arrowdiv"
			spanref.innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;"
			ultags[t].parentNode.getElementsByTagName("a")[0].appendChild(spanref)
    	ultags[t].parentNode.onmouseover=function(){
    	this.getElementsByTagName("ul")[0].style.visibility="visible"
    	}
    	ultags[t].parentNode.onmouseout=function(){
			this.getElementsByTagName("ul")[0].style.visibility="hidden"
    }
    }
  }
}



function subForm(cond,a,b)
{
var inp = event.srcElement.elements;
var err ='';
var nop = '';

for (i=0 ; i<inp.length-2 ; i++)
	{
//alert(i+' '+inp(i).value);
	if (inp(i).req == 'y')
		{
		if (inp(i).value == '' && !inp(i).selectedIndex || inp(i).selectedIndex == -1)
			{
			
			nop += '\r\n- ' + inp(i).nm;
			if (err == '') err = i;
			inp(i).style.backgroundColor = 'E2D1D1';
			}
		else inp(i).style.backgroundColor = '';
		}
	}

if (nop != '')
	{
	alert('The following field/s (also highlighted in red in the form)                 \r\n must be filled in before submiting this form:\r\n' + nop);
	p.all.scrollTop = 0;
	inp(err).focus();
	return false;
	}
	else
	{
	for (i=0 ; i<inp.length-2 ; i++)
		{
		if (inp(i).value.length < inp(i).min && inp(i).value.length != 0) 
			{
			nop += '\r\n ' + inp(i).nm + ' -   minimum ' + inp(i).min + ' characters.';
			if (err == '') err = i;
			inp(i).style.backgroundColor = 'E2D1D1';
			}
			else if (inp(i).min) inp(i).style.backgroundColor = '';
		}
	if (nop != '')
		{
		alert('The following field/s (also highlighted in red in the form)                  \r\n must have a minimum number of characters:\r\n' + nop);
		p.all.scrollTop = 0;
		inp(err).focus();
		return false;
		}
	}

if (cond == 'eq' && inp(a).value != inp(b).value)
		{
		alert('The Confirmed Password you have entered does not match the password you have chosen.    ');
		p.all.contentH.scrollTop = 0;
		inp(b).focus();
		inp(b).style.backgroundColor = 'E2D1D1';
		return false;
		}

return true;
}



function validK(flt,xtr,nm)
{

// nm - max number of char.
// xtr - add any extra character.. Note: when adding.. the default space is cancelled!
// flt - 1 - letter, 2-numbers, 3-let+num 4-names, 5-tel, 6-email  

if (nm) if (nm-1 < event.srcElement.value.length) 
	{
	alert('Wow... there is maximum of ' + nm + ' characters in the '+ event.srcElement.nm+' field...             ');
	return false;
	}

var cen;

if (flt)
	{
//	var symb = '!;@#$%^&*()_-+=<[]{},./?\|`"~';
	var num = '0123456789';
	var let = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
	if (flt == '1') cen = let;
	if (flt == '2') cen = num;
	if (flt == '3') cen = num + let;
	if (flt == '4') cen = let + "-&,.'()";
	if (flt == '5') cen = num + '-()+/';
	if (flt == '6') cen = num + let + '-_@.';
	}
	else if (xtr) cen = xtr; else return true;

var k = String.fromCharCode(event.keyCode);

if (!xtr && flt != '6') cen += ' ';
if (xtr && flt) cen += xtr;

if (cen.indexOf(k) != -1) return true; 
else 
	{
	alert("Sorry... but you can't use the ' " + k + " ' character in the " + event.srcElement.name + " field...         ");
	return false;
	}
}


function framePrint(whichFrame)
{
parent[whichFrame].focus();
parent[whichFrame].print();
}