function highlight()
{
    var giz = document.getElementById("gizmo");
    var pics = giz.getElementsByTagName("img");
    the_pics = new Array();
    for (var i = 0; i < Math.ceil(Math.random()*pics.length*0.8); i++)
    {
    the_pics[i] = pics[Math.floor(Math.random()*pics.length)];
    the_pics[i].src = "images/grey1.gif";
    }
}

function dehighlight()
{
    for (i = 0; i < the_pics.length; i++)
    {
    the_pics[i].src = "images/grey2.gif";
    }
}

function framecheck() 
{   
    if (top.frames.length == 0)
        location.replace("portfolio.php");   
    else if (!top.noreload && top.location.search) 
    {      
        var parts = top.location.search.split("url=");      
        var url = unescape(parts[1]);     
        if (url != location.href)         
            location.replace(url);      
            top.noreload = true;   
    }
}

var MessageArray = new Array()
MessageArray[0] = "Image processing and graphic construction ...";
MessageArray[1] = "Web site design and internet programming ...";
MessageArray[2] = "Data bases and data base administration ...";
MessageArray[3] = "Rich-Media contents and interactive applications ...";
MessageArray[4] = "\"Come in and have a look - you’re welcome!\"";

var timerID = null;
var NewsRunning = false;
var currentMessage = 0;
var offset = 0;

function stopNews()
{
    if (NewsRunning)
        clearTimeout(timerID);
        NewsRunning = false;
}

function startNews()
{
    stopNews();
    showNews();
}

function showNews()
{
    var text = MessageArray[currentMessage];
    if (offset < text.length)
    {
        if (text.charAt(offset) == " ")
            offset ++;
            var partialMessage = text.substring(0, offset + 1);
            document.NewsForm.NewsField.value = partialMessage;
            offset ++;
            timerID = setTimeout("showNews()", 35);
            NewsRunning = true;
    }
    
    else
    {
        offset = 0;
        currentMessage ++;
        if (currentMessage == MessageArray.length)
            currentMessage = 0;
            timerID = setTimeout("showNews()", 2000);
            NewsRunning = true;
    }
}

//* Form Validator

function validator()
{
    var input = document.theForm.txtName.value;
    if (document.getElementById("txtName").value == "")
    {
        alert ("Please type in your name.");
        return false;
    }
    input = document.theForm.txtPhone.value;
    if (!checktxtPhone(input))
    {
        alert("Your phone number isn't correct.\n\nPlease correct your phone number.");
        return false;
    }
    input = document.theForm.txtEmail.value;
    if (!checktxtEmail(input))
    {
        alert("Your email address isn't correct.\n\nPlease correct your email address.");
        return false;
    }
    input = document.theForm.selWorkNeeded.value;
    if (!checkselWorkNeeded(input))
    {
        alert("Please tell us the type of project you need to have done.");
        return false;
    }
    input = document.theForm.txtSpecificNeeds.value;
    if (!txtSpecificNeeds(input))
    {
        alert ("Please tell us a little about the project, any special comments or provide\na website address to a current site you have now.\n\nThank you.");
        return false;
    }
    return true;
}

function checkChar(x)
{
    if (x.match(/^[a-zA-ZäÄöÖüÜ ß-]+ [a-zA-ZäÄöÖüÜ ß-]{10,}$/))
        { return true; }
    else
        { return false; }
}

function checktxtPhone(x)
{
    if(x.match(/^(\+?\d+[ \/-])?\d+([ \/-]\d+)*$/))
        { return true; }
    else
        { return false; }
}

function checktxtEmail(x)
{
    if (x.match(/^[a-zA-Z0-9]+@[a-zA-Z0-9-]{2,}\.[a-zA-Z]{2,5}$/))
        { return true; }
    else
        { return false; }
}

function checkselWorkNeeded(x)
{
    if (document.getElementById("selWorkNeeded").value == "instructions")
        { return (false); }
    else
        { return true; }
}

function txtSpecificNeeds(x)
{
    if (document.getElementById("txtSpecificNeeds").value == "")
        { return false; }
    else
        { return true; }
}

//* Form Validator

var text = "web design, flash design and networking by robin's showcase"
var speed = 100
var x = 0
function bb() {
var a = text.substring(0,x)
var b = text.substring(x,x+1).toUpperCase()
var c = text.substring(x+1,text.length)
window.status = a + b + c
if (x == text.length) {
x = 0
}
else {
x++
}
setTimeout("bb()",speed)
}

bb();

function right(e) {
if (navigator.appName == 'Netscape' && 
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' && 
(event.button == 2 || event.button == 3)) {
alert("Web Design, Flash Design and Networking by Robin's Showcase.");
return false;
}
return true;
}

document.onmousedown=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right;
//  End -->