$(document).ready(function(){

function makeHover(){  
$(this).addClass("sfhover");
}

function makeNormal(){  
$(this).removeClass("sfhover");
}

$('a.pirobox_gall').colorbox({rel:'gallery', next:'Далее',previous:'Назад',close:'Закрыть'});

$('a.checkmydcard').colorbox({close:'Закрыть', html:"<div id=\"inline\" style=\"width:500px; padding: 0 32px\"><form method=\"post\" action=\"/mycard#maincontent\"> <h2 style=\"padding: 8px 0px\">Введите номер карты:</h2><p><input type=\"text\" name=\"number\" id=\"mycardnum\" class=\"mycardnum\" pattern=\"[0-9]{2,}\" maxlength=\"13\"  value=\"\"></p><h2 style=\"padding: 8px 0px\">Выберите вид карты:</h2><p></p><table cellspacing=\"0\" cellpadding=\"4\" border=\"0\" width=\"100\" style=\"width:100%;\"><tbody><tr><td style=\"width: 50px; vertical-align:middle; text-align:center;\"><input type=\"radio\" name=\"ctype\" value=\"gold\" checked=\"\"></td><td style=\"width: 100px; height: 64px; background: url('/images/discount/gold.gif') no-repeat top left;\">&nbsp;</td><td style=\"vertical-align:top; vertical-align:middle; text-align:left; padding-left:32px;\">Карта Gold</td></tr></tbody></table> <table cellspacing=\"0\" cellpadding=\"4\" border=\"0\" width=\"100\" style=\"width:100%;\"><tbody><tr><td style=\"width: 50px; vertical-align:middle; text-align:center;\"><input type=\"radio\" name=\"ctype\" value=\"silver\"></td><td style=\"width: 100px; height: 64px; background: url('/images/discount/silver.gif') no-repeat top left;\">&nbsp;</td><td style=\"vertical-align:top; vertical-align:middle; text-align:left; padding-left:32px;\">Карта Silver</td></tr></tbody></table> <table cellspacing=\"0\" cellpadding=\"4\" border=\"0\" width=\"100\" style=\"width:100%;\"><tbody><tr><td style=\"width: 50px; vertical-align:middle; text-align:center;\"><input type=\"radio\" name=\"ctype\" value=\"makeup\"></td><td style=\"width: 100px; height: 64px; background: url('/images/discount/makeup.gif') no-repeat top left;\">&nbsp;</td><td style=\"vertical-align:top; vertical-align:middle; text-align:left; padding-left:32px;\">Карта MakeUp&amp;Spa</td></tr></tbody></table><table cellspacing=\"0\" cellpadding=\"4\" border=\"0\" width=\"100\" style=\"width:100%;\"><tbody><tr><td style=\"width: 50px; vertical-align:middle; text-align:center;\"><input type=\"radio\" name=\"ctype\" value=\"accumulate\"></td><td style=\"width: 100px; height: 64px; background: url('/images/discount/accumulate.gif') no-repeat top left;\">&nbsp;</td><td style=\"vertical-align:top; vertical-align:middle; text-align:left; padding-left:32px;\">Карта Accumulate</td></tr></tbody></table><table cellspacing=\"0\" cellpadding=\"4\" border=\"0\" width=\"100\" style=\"width:100%;\"><tbody><tr><td style=\"width: 50px; vertical-align:middle; text-align:center;\"><input type=\"radio\" name=\"ctype\" value=\"jaguar\"></td><td style=\"width: 100px; height: 64px; background: url('/images/discount/jaguar.gif') no-repeat top left;\">&nbsp;</td><td style=\"vertical-align:top; vertical-align:middle; text-align:left; padding-left:32px;\">Карта Jaguar</td></tr></tbody></table><p></p>  <input type=\"hidden\" name=\"todo\" value=\"checkdiscountcard\"><input type=\"submit\" value=\"Проверьте карту\" class=\"button\"></form>",
onComplete:function(){ $("#mycardnum").mask("2990000009999",{placeholder:"_"}); },
onClosed:function(){ $("#mycardnum").unmask(); }
});

  $("#jokes").expander({
    slicePoint:       100,
    expandText:         'Читать полностью >>',
    collapseTimer:    10000,
    userCollapseText: '<< Свернуть',
    userCollapsePrefix: ' '   
  });

  $("#textexpander").expander({
    slicePoint:       440,
    expandText:         'Читать полностью >>',
    collapseTimer:    30000,
    userCollapseText: '<< Свернуть',
    userCollapsePrefix: ' '   
  });

$(" .vmenu li").hover(makeHover,makeNormal);
$(" .hmenu li").hover(makeHover,makeNormal);


$("#discountcardnumber").mask("2990000009999",{placeholder:"_"}); 

  });



