function MM_validateForm(){ //v4.0
    if (document.getElementById) {
        var i, p, q, nm, test, num, min, max, errors = '', args = MM_validateForm.arguments;
        for (i = 0; i < (args.length - 2); i += 3) {
            test = args[i + 2];
            val = document.getElementById(args[i]);
            if (val) {
                nm = val.title;
                if ((val = val.value) != "") {
                    if (test.indexOf('isEmail') != -1) {
                        p = val.indexOf('@');
                        if (p < 1 || p == (val.length - 1)) 
                            errors += '- ' + nm + ' must contain an e-mail address.\n';
                    }
                    else 
                        if (test != 'R') {
                            num = parseFloat(val);
                            if (isNaN(val)) 
                                errors += ' ' + nm + ' must contain a number.\n';
                            if (test.indexOf('inRange') != -1) {
                                p = test.indexOf(':');
                                min = test.substring(8, p);
                                max = test.substring(p + 1);
                                if (num < min || max < num) 
                                    errors += ' ' + nm + ' must contain a number between ' + min + ' and ' + max + '.\n';
                            }
                        }
                }
                else 
                    if (test.charAt(0) == 'R') 
                        errors += ' ' + nm + ' is required.\n';
            }
        }
		var formId = args[args.length-1];
        if (errors) 
            alert('The following error(s) occurred:\n\n' + errors);
       		document.MM_returnValue = (errors == '');
        if (!errors) {
            document.getElementById(formId).submit();
        }
    }
}
//
$(document).ready(function () {

    $('a.neetee').click(function (e) {
        $('#neetee_details').modal({
            opacity: 100,
            overlayClose: 'true',
            onOpen: function (dialog) {
                dialog.overlay.fadeIn('slow', function () {
                    dialog.data.hide();
                    dialog.container.fadeIn('slow', function () {
                        dialog.data.slideDown('slow');
                    });
                });
            }
        });
    });
    $('a.portway').click(function (e) {
        $('#portway_details').modal({
            opacity: 100,
            overlayClose: 'true',
            onOpen: function (dialog) {
                dialog.overlay.fadeIn('slow', function () {
                    dialog.data.hide();
                    dialog.container.fadeIn('slow', function () {
                        dialog.data.slideDown('slow');
                    });
                });
            }
        });
    });
    $('a.pureplay').click(function (e) {
        $('#pureplay_details').modal({
            opacity: 100,
            overlayClose: 'true',
            onOpen: function (dialog) {
                dialog.overlay.fadeIn('slow', function () {
                    dialog.data.hide();
                    dialog.container.fadeIn('slow', function () {
                        dialog.data.slideDown('slow');
                    });
                });
            }
        });
    });
	$('a.singamore').click(function (e) {
        $('#singamore_details').modal({
            opacity: 100,
            overlayClose: 'true',
            onOpen: function (dialog) {
                dialog.overlay.fadeIn('slow', function () {
                    dialog.data.hide();
                    dialog.container.fadeIn('slow', function () {
                        dialog.data.slideDown('slow');
                    });
                });
            }
        });
    });
	$('a.kathana').click(function (e) {
        $('#kathana_details').modal({
            opacity: 100,
            overlayClose: 'true',
            onOpen: function (dialog) {
                dialog.overlay.fadeIn('slow', function () {
                    dialog.data.hide();
                    dialog.container.fadeIn('slow', function () {
                        dialog.data.slideDown('slow');
                    });
                });
            }
        });
    });
	$('a.bizquest').click(function (e) {
        $('#bizquest_details').modal({
            opacity: 100,
            overlayClose: 'true',
            onOpen: function (dialog) {
                dialog.overlay.fadeIn('slow', function () {
                    dialog.data.hide();
                    dialog.container.fadeIn('slow', function () {
                        dialog.data.slideDown('slow');
                    });
                });
            }
        });
    });
	$('a.teamson').click(function (e) {
        $('#teamson_details').modal({
            opacity: 100,
            overlayClose: 'true',
            onOpen: function (dialog) {
                dialog.overlay.fadeIn('slow', function () {
                    dialog.data.hide();
                    dialog.container.fadeIn('slow', function () {
                        dialog.data.slideDown('slow');
                    });
                });
            }
        });
    });
	$('a.fsl').click(function (e) {
        $('#fsl_details').modal({
            opacity: 100,
            overlayClose: 'true',
            onOpen: function (dialog) {
                dialog.overlay.fadeIn('slow', function () {
                    dialog.data.hide();
                    dialog.container.fadeIn('slow', function () {
                        dialog.data.slideDown('slow');
                    });
                });
            }
        });
    });
	$('a.logitech').click(function (e) {
        $('#logitech_details').modal({
            opacity: 100,
            overlayClose: 'true',
            onOpen: function (dialog) {
                dialog.overlay.fadeIn('slow', function () {
                    dialog.data.hide();
                    dialog.container.fadeIn('slow', function () {
                        dialog.data.slideDown('slow');
                    });
                });
            }
        });
    });
	$('a.amodini').click(function (e) {
        $('#amodini_details').modal({
            opacity: 100,
            overlayClose: 'true',
            onOpen: function (dialog) {
                dialog.overlay.fadeIn('slow', function () {
                    dialog.data.hide();
                    dialog.container.fadeIn('slow', function () {
                        dialog.data.slideDown('slow');
                    });
                });
            }
        });
    });
	$('a.oak').click(function (e) {
        $('#oak_details').modal({
            opacity: 100,
            overlayClose: 'true',
            onOpen: function (dialog) {
                dialog.overlay.fadeIn('slow', function () {
                    dialog.data.hide();
                    dialog.container.fadeIn('slow', function () {
                        dialog.data.slideDown('slow');
                    });
                });
            }
        });
    });
	$('a.fs').click(function (e) {
        $('#fs_details').modal({
            opacity: 100,
            overlayClose: 'true',
            onOpen: function (dialog) {
                dialog.overlay.fadeIn('slow', function () {
                    dialog.data.hide();
                    dialog.container.fadeIn('slow', function () {
                        dialog.data.slideDown('slow');
                    });
                });
            }
        });
    });
	



    $(".pf_img").hover(function () { //On hover...
        var thumbOver = $(this).find("img").attr("src");
        $(this).find("a.thumb").css({
            'background': 'url(' + thumbOver + ') no-repeat center bottom'
        });
        $(this).find("span").stop().animate({
            opacity: 0
        },
        300);
    },


    function () {
        $(this).find("span").stop().animate({
            opacity: 1
        },
        300);
    });


    $('#social a').each(function () {
        $('<div class="fader" />').css('opacity', 0).prependTo(this);
    }).hover(function () {
        $('img', this).stop().animate({
            marginLeft: 5
        },
        250);
        $('.fader', this).stop().animate({
            opacity: 0.15
        });
    },


    function () {
        $('img', this).stop().animate({
            marginLeft: 10
        },
        250);

        $('.fader', this).stop().animate({
            opacity: 0
        });
    }).find('img').css('marginLeft', 10);

    $('#about a').each(function () {
        $('<div class="fader" />').css('opacity', 0).prependTo(this);
    }).hover(function () {
        $('img', this).stop().animate({
            marginLeft: 5
        },
        250);
        $('.fader', this).stop().animate({
            opacity: 0.15
        });
    },


    function () {
        $('img', this).stop().animate({
            marginLeft: 10
        },
        250);

        $('.fader', this).stop().animate({
            opacity: 0
        });
    }).find('img').css('marginLeft', 10);
    //
    $('input.submit').click(function () {
        MM_validateForm('name', '', 'R', 'email', '', 'RisEmail', 'tele', '', 'RisNum', 'comments', '', 'R','contactform');
        return document.MM_returnValue;
    });
});
//