﻿$(document).ready(function () {
    //$(".mainMenuSUB tr:even").css("background-color", "#f0f0f0");

    $('<tr><td colspan="3" class="mainMenuSUBArrow"></td></tr>').insertBefore('.root + .mainMenuSUB tbody');

    //$('.mainMenuSUB + .mainMenuSUB').css('padding-left', '5px');

    setupPlaceholder("support_username");
    setupPlaceholder("support_password");
});

if (!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)) {
    jQuery(function ($) {
        $("a[rel^='lightbox']").slimbox({ counterText: "Bild {x} av {y}" }, null, function (el) {
            return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
        });
    });
}

function setupPlaceholder(inputid) {
    if ($.browser.webkit) return false;

    var target = $('#' + inputid);
    if (target.length == 0) {
        target = $('input[type="text"], input[type="password"], input[type="email"], input[type="search"]');
    }

    target.each(function (i, el) {
        el = $(el);
        var ph = el.attr('placeholder');
        if (!ph) return true;

        el.addClass('placeholder');
        el.attr('value', ph);

        el.focus(function (e) {
            if (el.val() == ph) {
                el.removeClass('placeholder');
                el.attr('value', '');
            }
        });

        el.blur(function (e) {
            if ($.trim(el.val()) == '') {
                el.addClass('placeholder');
                el.attr('value', ph);
            }
        });
    });
}

function __doExternalPost(targetUrl) {
    theForm.__VIEWSTATE.value = "";
    theForm.encoding = "application/x-www-form-urlencoded";
    theForm.action = targetUrl;
    theForm.submit();
}

function submitenter(myfield,e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;

if (keycode == 13)
   {
   document.getElementById('Button1').click();
   return false;
   }
else
   return true;
}

