<!--

function ReadCookie (key, skips) 
	{
		if (skips == null) {skips = 0}
		var cookie_string = '' + document . cookie;
		var cookie_array = cookie_string . split ('; ');
		for (var i = 0; i < cookie_array . length; ++ i) 
			{
				var single_cookie = cookie_array [i] . split ('=');
				if (single_cookie . length != 2) {continue}
				var name  = unescape (single_cookie [0]);
				var value = unescape (single_cookie [1]);
				if (key == name && skips -- == 0) {return value}
			}
		return 'None';
	}

function SetCookie (name, value) 
	{
		var argv = SetCookie.arguments; 
		var argc = SetCookie.arguments.length;
		var expires = (argc > 2) ? argv[2] : null;
		var path = (argc > 3) ? argv[3] : null;
		var domain = (argc > 4) ? argv[4] : null;
		var secure = (argc > 5) ? argv[5] : false;
		document.cookie = name + '=' + escape (value) +
		((expires == null) ? '' : ('; expires=' + expires.toGMTString())) +
		((path == null) ? '' : ('; path=' + path)) +
		((domain == null) ? '' : ('; domain='+domain)) +
		((secure == true) ? '; secure' : '');
	}
	
function setExpiry(days)
{	var newExpires = new Date ();
	newExpires.setTime (newExpires.getTime() + days * (24 * 60 * 60 * 1000)); // 1 days from now
	return (newExpires)
}

var localHost = ''
var localCookie = null 


if ( document.location.protocol == 'http:') 
	{ if (document.location.hostname.indexOf('lucy')!=-1)	
		{	var localHost = 'http://lucy'; var localCookie = null	} 
		else if (document.location.hostname.indexOf('10.0.0.226')!=-1)	
		{	var localHost = 'http://10.0.0.226'; var localCookie = null	} 
		else if ((document.location.hostname.indexOf('192.168')!=-1) || (document.location.hostname.indexOf('thinkpad')!=-1))	
		{	var localHost = ''; var localCookie = null	} 
		else
		{	var localHost = 'http://www.vizualhr.com';	} 
	}

document.writeln('<link rel="shortcut icon" href=/favicon.ico>')


function MM_order(filename)
   {	msgWindow = window.open(filename,'orderWindow','location=yes,toolbar=yes,width=590,height=500,directories=yes,status=yes,scrollbars=yes,resizable=yes,menubar=yes');}

function callSupport()	{ MM_callSupport()	}
function callSales()	{ MM_callSupport()	}

function MM_callSupport()
   {	msgWindow = window.open( '/callback/index.asp','callWindow','width=350,height=350,scrollbars=yes'); }

function MM_callSales()	{	MM_callSupport()  }

function MM_openGeneral(theURL,winName,features) 
   {	window.open(theURL,winName,features+'buttonbar=yes,toolbar=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');	}

function MM_openBasic(theURL,winName,features) 
   {	window.open(theURL,winName,features);	}


function menuCall()
	{	if (partnerType != 'whitebrand')
		{
			document.writeln('<table width=140 border=0 cellspacing=0 cellpadding=0 align=right><tr><td align=right>');
			document.writeln('<a href="#" onClick="javascript:;callSales()"><img src=' + localHost + '/r/btons/newcallback.gif border=0></a><br>');
			document.writeln('<img src=' + localHost + '/r/spacers/spacer.gif width=140 height=12><br>');
			writeAdverts()
			document.writeln('</td></tr></table>')
		}
	}

function salesButton()
	{	document.write('<a href="javascript:MM_callSales()"><img src=' + localHost + '/r/btons/callme1.gif border=0 align=right width=60 height=66 title="Click here if you would like one of our staff to call you and discuss this service - free of charge"></a>') }

function supportButton()
	{	document.write('<a href="javascript:MM_callSupport()"><img src=' + localHost + '/r/btons/callme1.gif border=0 align=right  width=60 height=66 title="Click here if you would like one of our support staff to call you and discuss this service - free of charge"></a>')	}

function addtoBasket(product)
	{	document.forms.orderForm.action = document.forms.orderForm.Initial.value + '&ID=OCH'+ product;
		document.forms.orderForm.submit();
	}
function addMultitoBasket(product,quantity)
	{	document.forms.orderForm.action = '/admin/pages/orders/processorder/addtobasket.asp?quantity=' + quantity + '&ID=OCH'+ product;
		document.forms.orderForm.submit();
	}

function doOnLoad () {
//alert("nothing to do")
}


function showHideTR(what,doWhat) { 

	if (document.getElementById(what) != null ) 
		{ var el = document.getElementById(what); }
	else 
		{ var el = getElementsByClass(what); }
	
	
	
	for (var i=0; i < el.length; i++)
	{	
		obj = el[i] 

		if (obj.style) 
			{ 
				obj=obj.style; 
				if (obj.display == "" )
					{ v = "hide" }
				else if (obj.display == "inline" )
					{  v = "hide" }
				else if (obj.display == "block" )
					{  v = "hide" }
				else if (obj.display == "none" )
					{  v = "show" }
				
				
				if ((doWhat != '') && (typeof(doWhat) != 'undefined')) v = doWhat
				if (v=="show") 
				{
				try { obj.display='';} 
				catch(e) { }
				
				}
			else if (v=="hide") 
				{
				try { obj.display='none';} 
				catch(e) { }
				}
			
			}
	}
}

function getElementsByClass(searchClass,node,tag) 
	{
		var classElements = new Array();
		if ( node == null ) node = document;
		if ( tag == null ) tag = '*';
		var els = node.getElementsByTagName(tag);
		var elsLen = els.length;
		var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
		
		for (i = 0, j = 0; i < elsLen; i++) 
			{ 
				if (els[i].className !='')
				{
				
				if (( pattern.test(els[i].className) ) || (contains(els[i].className,"-"+searchClass)> -1) || (contains(els[i].className,searchClass+"-")> -1))
					{
					
					
					classElements[j] = els[i];
					j++;
					}
				}
			}
		return classElements;
	}

oldCN = "";
function mouseOverClass(where,newClass,addIt)
	{
	oldCN = where.className;
	if (addIt == 1)
		{	where.className += ' '+newClass;	}
	else
		{	where.className = newClass;	}
	}
function mouseOutClass(where)
	{
	where.className = oldCN;
	oldCN = ""
	}
	
function bookmarkUs(url, title){

if (window.sidebar) // firefox
    {window.sidebar.addPanel(title, url, "");}
else if(window.opera && window.print){ // opera
    var elem = document.createElement('a');
    elem.setAttribute('href',url);
    elem.setAttribute('title',title);
    elem.setAttribute('rel','sidebar');
    elem.click();
	} 
else if(document.all)// ie
  {  window.external.AddFavorite(url, title);}
else 
   { alert("Sorry, your browser doesn\'t seem to support this function. \nHit Ctrl+D to bookmark this page.")}
}

triggerDiv = ""
hide2 = ""

function lowlight (what)
{
	if (what != '')
	{
	theThing = MM_findObj(what)
	if (theThing != null)
		{
		theThing.style.visibility="hidden"; 
		theThing.style.display="none"; 
		}
	else if (what != "")
		{
		showHideTR(what,'hide')
		}
	}

}

function highlight (what,whither)
{
	if (what != '')
	{
	theThing = MM_findObj(what)
	// alert('lowligh')
	if (theThing != null)
		{
		// alert('obj')
		theThing.style.visibility="visible"; 
		theThing.style.display="block"; 
		}
	else 
		{
		showHideTR(what,'show')
		}
	}

}

function triggerOn(whichID)
	{	
	if (triggerDiv!='') 
		{	
			lowlight(triggerDiv);
			clearTimeout(hide2)
		}
	if (whichID!='') 
		{
		triggerDiv = whichID; 
		highlight(triggerDiv,'l')
		}
	}
function triggerOff(whichID,howLong)
	{	
	if(!howLong) howLong = 2000
	if (whichID!='') 
		{		
			toDo = 'lowlight("'+whichID+'")'
			hide2 = setTimeout(toDo,howLong);
		}
	}

function flipTR (which,what)
	{
	if (which != '' )
		{
		if (what=='show') {triggerOn(which);} else {triggerOff(which);}
		}
	return false;
	}
function showHideTR(what,doWhat,matchFirst) { // v6.0

	if (what!="") {
	if (document.getElementById(what) != null ) 
		{ var el = MM_findObj(what); }
	else 
		{ var el = getElementsByClass(what); }
	
	// alert(el.length)
	//  this loops thru the array and sets the style you want
	var Match = ""

	for (var i=0; i < el.length; i++)
	{	
		obj = el[i];  

		if (obj) 
			{ 
				if (!obj.style) obj.style = ""
				obj=obj.style; 
				if (obj.display == "" )
					{ v = "hide" }
				else if (obj.display == "inline" )
					{  v = "hide" }
				else if (obj.display == "block" )
					{  v = "hide" }
				else if (obj.display == "none" )
					{  v = "show" }
				else 
					{  v = "hide" }
					
				if ( !matchFirst ) 
					{ Match = v }
				else if (matchFirst==1 && Match=="") 
					{ Match = v }
				else if (matchFirst==1 && Match!="") 
					{ v = Match }

				// alert(doWhat+' '+typeof(doWhat))
				if ((doWhat != '') && (typeof(doWhat) != 'undefined')) v = doWhat

				if (v=="show") 
					{	
						try { obj.display='';obj.visibility='' } 
						catch(e) { }
					
					}
			else if (v=="hide") 
				{	
					try {obj.display='none';obj.visibility='hidden'; } 
					catch(e) { }
				}
			}
		}
	}
}

function getElementsByClass(searchClass,node,tag) 
	{
		var classElements = new Array();
		if ( node == null ) node = document;
		if ( tag == null ) tag = '*';
		var els = node.getElementsByTagName(tag);
		var elsLen = els.length;
		var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
		
		for (i = 0, j = 0; i < elsLen; i++) 
			{ 
				if (els[i].className !='')
				{
				// alert ('testing "' + els[i].className + '"for "' + searchClass +'" returns ' + pattern.test(els[i].className))
				// if (els[i].className!='arrow') {alert(els[i].className +': '+ pattern.test(els[i].className))}
				if (( pattern.test(els[i].className) ) || (contains(els[i].className,"-"+searchClass)> 0) || (contains(els[i].className,searchClass+"")> 0))
					{
					
					// if (confirm(searchClass+';'+els[i].className+';'+els[i].className.indexOf (searchClass))) return false
					classElements[j] = els[i];
					j++;
					}
				}
			}
		return classElements;
	}



// -->
