﻿// JScript File
//Created by milap patel 
//Create Date 29,Oct 2009

var haveerrors = 0;
    function showImage(imagename, imageurl, errors)
    {
        document[imagename].src = imageurl;
        if (!haveerrors && errors) haveerrors = errors;
    }
    function showtitle(txtname,titlename,errors)
    {
        document[txtname].title = titlename;
        if (!haveerrors && errors) haveerrors = errors;
    }
    function validateForm(f)
    {
        haveerrors = 0;
        (f.uname.value.length < 1) // validate first name length
        ? showImage("uname_error", "../images/required.jpg", true)   // no semi-colon after this line!
        : showImage("uname_error", "../images/red_line_bg.jpg", false); // true = errors, false = no errors

        (f.pass.value.length < 1)
        ? showImage("pass_error","../images/required.jpg",true)
        : showImage("pass_error","../images/red_line_bg.jpg",false);

        return (!haveerrors);
    }
origURL = parent.document.URL;
contentURL = origURL.substring(origURL.indexOf('?')+1, origURL.length);
if(contentURL=="uname")
{
    alert("Invalid User Name");
}
else if(contentURL=="pass")
{
    alert("Invalid Password");
}
else if(contentURL=="inactive")
{
    alert("Your registration is not yet activated by administrator");
}
else if(contentURL=="store")
{
    alert("Please login in http://www.storebuilder.comparethebazaar.com to see and upload your products");
}
else
{
}    
