$(function(){ if( $('#categorieSelecter').exists() ){ $('#categorieSelecter').mouseover(function(){ $('#subnavigation').show() }) $('#categorieSelecter').mouseout(function(){ $('#subnavigation').hide() }) } if( $('#navigation').exists()){ $('#blocker').css('width', $('#navigation ul').width() + 'px' ); $('.point, .pointAct').each(function(){ $this = $(this); if( (BrowserDetect.browser != 'Explorer' && BrowserDetect.version != '6') || (BrowserDetect.browser == 'Explorer' && BrowserDetect.version == '8') ){ $('.blocks[rel='+ $this.attr('rel') +']').css({ width : $this.width() + 'px' }) } if(BrowserDetect.browser == 'Explorer' && BrowserDetect.version == '6'){ $('.blocks[rel='+ $this.attr('rel') +']').css({ width : $this.find('a').outerWidth() + 'px' }) } if(BrowserDetect.browser == 'Explorer' && BrowserDetect.version == '7'){ $('.blocks[rel='+ $this.attr('rel') +']').css({ width : $this.find('a').outerWidth() + 'px' }) } }) $('.point').mouseover(function(){ $this = $(this); if( (BrowserDetect.browser != 'Explorer' && BrowserDetect.version != '6') || (BrowserDetect.browser == 'Explorer' && BrowserDetect.version == '8') ){ $('.blocks[rel='+ $this.attr('rel') +']').stop().animate({ 'marginTop' : '2px' },'fast'); } if(BrowserDetect.browser == 'Explorer' && BrowserDetect.version == '6'){ $('.blocks[rel='+ $this.attr('rel') +']').stop().animate({ 'marginTop' : '1px' },'fast'); } if(BrowserDetect.browser == 'Explorer' && BrowserDetect.version == '7'){ $('.blocks[rel='+ $this.attr('rel') +']').stop().animate({ 'marginTop' : '1px' },'fast'); } }) $('.point').mouseout(function(){ $this = $(this); $('.blocks[rel='+ $this.attr('rel') +']').stop().animate({ 'marginTop' : '73px' },'fast') }) } if( $('#breadcrumb').exists() ){ $('#breadcrumb').jBreadCrumb(); } $('.seperator-line').html(' '); $('input[name=submitQuestion]').click(function(){ var $error = false; var $name = $('form[name="askAQuestion"] input[name="name"]'); var $email = $('form[name="askAQuestion"] input[name="email"]'); var $text = $('form[name="askAQuestion"] textarea[name="textfield"]'); var $code = $('form[name="askAQuestion"] input[name="code"]'); var $errorOptions = { border: '1px solid #d11d1d' }; var $correctOptions = { border: '1px solid #808080' }; if( $name.val() == '' || $name.val() == ' '){ $name.css( $errorOptions ); $error = true; }else{ $name.css( $correctOptions ); } if( $email.val() == '' || $email.val() == ' ' || isValidEmailAddress($email.val()) == false){ $email.css( $errorOptions ); $error = true; }else{ $email.css( $correctOptions ); } if( $text.val() == '' || $text.val() == ' '){ $text.css( $errorOptions ); }else{ $text.css( $correctOptions ); } if( $code.val() == '' || $code.val() == ' '){ $code.css( $errorOptions ); $error = true; }else{ $code.css( $correctOptions ); } if($error == false){ $.ajax({ data : $('form[name=askAQuestion]').serialize(), type : 'POST', url : '/_ajax/form.question.php', success : function(msg){ alert(msg); } }) } return false; }) }) function isValidEmailAddress(emailAddress) { var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i); return pattern.test(emailAddress); }