var smartWindow;

function smartWindowOpen( sourcefile, W, H, X, Y )
{
        if( ! screen.width && ( X == -1 || Y == -1 ) )
        {
                X = Y = 20;
        }

        if( X == -1 || Y == -1 )
        {
                X = ( screen.availWidth -  W   ) / 2 ;
                Y = ( screen.availHeight - H ) / 2;
        }


        smartWindow = window.open( sourcefile,"smartWindow","width=" + W + ",height=" + H + ",screenX=" + X + ",screenY=" + Y + ",left=" + X + ",top=" + Y + ",resizable,scrollbars=no");
        smartWindow.focus();
}

var popup_window = null;

function infoscroll(seed,looped)
{ 	//function 1 
	var text1 =   " Welcome to www.nivek-systems.co.uk";
   var text2  = "  ";     
   var msg=text1+text2;
   var putout = " ";
   var c   = 1;

   if (looped > 2) 
   	{	//Open if 1 (if--else)
   	window.status="Thanks for visiting. Email nivek systems with any comments.";
   	}	//Close if 1  (if--else)

   	else if (seed > 100)
   		{	//Open else 1 (if--else 1)
   		seed--;
      	var cmd="infoscroll(" + seed + "," + looped + ")";
      	timerTwo=window.setTimeout(cmd,100);
   		}	//Close else 1 (if--else)

   		else if (seed <= 100 && seed > 0)
   			{	// Open else 2 (if--else 1)

   			for (c=0 ; c < seed ; c++) 
   				{	// Open for loop
            	putout+=" ";
            	}	// Close for loop
        		putout+=msg.substring(0,100-seed);
         	seed--;
         	var cmd="infoscroll(" + seed + "," + looped + ")";
         	window.status=putout;
         	timertwo=window.setTimeout(cmd,100);
        		}	//Close else 2 (if--else)

        		else if (seed <= 0)
        			{	// Open else 3 (if--else 1)

               if (-seed < msg.length)
               	{	// Open if 2
               	putout+=msg.substring(-seed,msg.length);
                  seed--;
                  var cmd="infoscroll(" + seed + "," + looped + ")";
                  window.status=putout;
                  timertwo=window.setTimeout(cmd,100); // 100
                	}	// Close if 2

                	else
                		{	// Open else 4 (if--else 2)
                     window.status=" ";
                     looped += 1;
                     var cmd = "infoscroll(100," + looped + ")";
                     timertwo=window.setTimeout(cmd,75); // 75
                		}	// Close else (if--else 2)

        			}	//Close else 3

}	//end function 1

var version4 = (navigator.appVersion.charAt(0) == "4");
var popupHandle;
function closePopup() {
if(popupHandle != null && !popupHandle.closed) popupHandle.close()
}
function displayPopup(position,url,name,height,width,evnt)
{
var properties = "toolbar=0,location=0,height="+height
properties = properties+",width="+width

var leftprop, topprop, screenX, screenY, cursorX, cursorY, padAmt

if(navigator.appName == "Microsoft Internet Explorer")
{
        screenY = document.body.offsetHeight
        screenX = window.screen.availWidth
}
else
{               screenY = screen.height;
                screenX = screen.width;
}

if(position == 1)       // if POPUP not CENTER
{
        cursorX = evnt.screenX
        cursorY = evnt.screenY
        padAmtX = 10
        padAmtY = 10
        
        if((cursorY + height + padAmtY) > screenY)      
        // make sizes a negative number to move left/up
        {
                padAmtY = (-30) + (height*-1);  
                // if up or to left, make 30 as padding amount
        }
        if((cursorX + width + padAmtX) > screenX)
        {
                padAmtX = (-30) + (width*-1);   
                // if up or to left, make 30 as padding amount
        }

        if(navigator.appName == "Microsoft Internet Explorer")
        {
                leftprop = cursorX + padAmtX
                topprop = cursorY + padAmtY
        }
        else
        { // adjust Netscape coordinates for scrolling
                leftprop = (cursorX - pageXOffset + padAmtX)
                topprop = (cursorY - pageYOffset + padAmtY)
        }
}
else    // CENTER
{
        leftvar = (screenX - width) / 2
        rightvar = (screenY - height) / 2
                
        if(navigator.appName == "Microsoft Internet Explorer")
        {
                leftprop = leftvar
                topprop = rightvar
        }
        else
        { // adjust Netscape coordinates for scrolling
                leftprop = (leftvar - pageXOffset)
                topprop = (rightvar - pageYOffset)
        }
}

if(evnt != null)
{
properties = properties+",left="+leftprop
properties = properties+",top="+topprop
}
closePopup()
popupHandle = open(url,name,properties)
}


function jemail(user, domain, suffix){



document.write('<a href="' + 'mailto:' + user + '@' + domain + '.' + suffix + '">' + user + '@' + domain + '.' + suffix + '</a>');



}