 jQuery.cookie =function  ( B,I,L){if  ( typeof     I!="undefined"){L=L||{};if(I===null){I="";L.expires=-1 };var    E="";if(L.expires&&  ( typeof     L.expires=="number"||L.expires.toUTCString)) {var    F;if  ( typeof     L.expires=="number"){F =new    Date();F.setTime(F.getTime()+(L.expires*24*60*60*1000))  } else   { F=L.expires};E="; expires="+F.toUTCString() };var    K=L.path?"; path="+(L.path):"" ;var    G=L.domain?"; domain="+(L.domain):"" ;var    A=L.secure?"; secure":"";document.cookie=[B,"=",encodeURIComponent(I),E,K,G,A].join("")  } else   {  var    D=null;if(document.cookie&&document.cookie!="") {var    J=document.cookie.split(";");for (var    H=0;H<J.length;H++) {var    C=jQuery.trim(J[H]);if(C.substring(0,B.length+1)==(B+"=")){D=decodeURIComponent(C.substring(B.length+1));break}} };return    D}};  var    OPT_ID = 0;  var    OPT_TITLE = 1;  var    OPT_VOTES = 2;  var    votedID;  var    Voted = false; $(document).ready (function  ( ) { $("#btnVote").click (function  ( ) { formProcess(); }); $("#btnBackResult").click (function  ( ) { $("#btnBackResult").hide(); $("#btnResult").show(); $("#btnVote").show(); $("#ResultReplace").fadeOut (function  ( ) { $("#idlineAnswer").fadeIn(); }); }); $("#btnResult").click (function  ( ) { if ($("#result").length == 0 ) { $("#AddCommentAjaxLoad").fadeIn(500);  var    idQuestionID = $("#idPollQuestionID").val(); $.getJSON($("#idProjectPathUrl").val()+"ajax/Poll.php?QuestionID="+idQuestionID+"&OptionsID=none",loadResults); }    else     { $("#btnBackResult").show(); $("#btnResult").hide(); $("#btnVote").hide(); $("#idlineAnswer").fadeOut (function  ( ) { $("#ResultReplace").fadeIn(); }); animateResults(); } }); if ($.cookie('vote_id') == $("#idPollQuestionID").val()) { if ($("#result").length == 0 ) { Voted = true; } $("#AddCommentAjaxLoad").fadeIn(500);  var    idQuestionID = $("#idPollQuestionID").val(); $("#idlineAnswer").empty(); $.getJSON($("#idProjectPathUrl").val()+"ajax/Poll.php?QuestionID="+idQuestionID+"&OptionsID=none",loadResults); } });  function    formProcess() {  var    id = $("input[@name='PollOption']:checked").attr("value"); if(id) { Voted = true;  var    idQuestionID = $("#idPollQuestionID").val(); $.getJSON($("#idProjectPathUrl").val()+"ajax/Poll.php?QuestionID="+idQuestionID+"&OptionsID="+id,loadResults); $.cookie('vote_id', idQuestionID, {expires: 365}); $("#idlineAnswer").fadeOut("slow",function() { $(this).empty(); }); } }  function    animateResults() { $("div.result_percentage div").each (function  ( ) {  var    percentage = $(this).parent().prev().prev().text(); $(this).css({width: "0%"}).animate({width: percentage}, 'slow'); }); }  function    loadResults(data) {  var    total_votes = 0;  var    percent; for (id    in     data) { total_votes = total_votes+parseInt(data[id][OPT_VOTES]); }  var    results_html = "<div id='result'>\n"; results_html += " <div class='result_header'>\n"; results_html += " <div class='result_header_content'></div>\n"; results_html += " </div>\n"; results_html += " <div class='result_title'></div>"; results_html += " <div class='result_content'>";  var    i=1;  var    classAdd =''; for (id    in     data) { percent = Math.round((parseInt(data[id][OPT_VOTES])/parseInt(total_votes))*100); classAdd = 'result_menu'+i; results_html += " <div class='result_menu "+classAdd+"'>"; results_html += " <div class='percentage'>"+percent+"%</div>"; results_html += " <div class='result_menu_content'>"+data[id][OPT_TITLE]+"</div>"; results_html += " <div class='result_percentage'>"; results_html += " <div style='width:0%'></div>"; results_html += " </div>"; results_html += " </div>"; i++; } results_html += " </div>\n"; results_html += " </div>\n"; $("#AddCommentAjaxLoad").fadeOut(500); $("#ResultReplace").append(results_html).fadeIn("slow",function() { animateResults(); $("#btnResult").hide(); if(Voted) { $("#btnBackResult").hide(); $("#btnVote").hide(); }    else     { $("#btnBackResult").show(); $("#btnVote").hide(); } }); $("#idlineAnswer").hide(); }  var    isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;  var    isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;  var    isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;  function    ControlVersion() {  var    version;  var    axo;  var    e; try { axo =  new    ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); version = axo.GetVariable("$version"); } catch (e) { } if (!version) { try { axo =  new    ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); version = "WIN 6,0,21,0"; axo.AllowScriptAccess = "always"; version = axo.GetVariable("$version"); } catch (e) { } } if (!version) { try { axo =  new    ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"); version = axo.GetVariable("$version"); } catch (e) { } } if (!version) { try { axo =  new    ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"); version = "WIN 3,0,18,0"; } catch (e) { } } if (!version) { try { axo =  new    ActiveXObject("ShockwaveFlash.ShockwaveFlash"); version = "WIN 2,0,0,11"; } catch (e) { version = -1; } }  return    version; }  function    GetSwfVer(){  var    flashVer = -1; if (navigator.plugins != null    &&     navigator.plugins.length > 0) { if (navigator.plugins["Shockwave Flash 2.0"]    ||     navigator.plugins["Shockwave Flash"]) {  var    swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";  var    flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;  var    descArray = flashDescription.split(" ");  var    tempArrayMajor = descArray[2].split(".");  var    versionMajor = tempArrayMajor[0];  var    versionMinor = tempArrayMajor[1];  var    versionRevision = descArray[3]; if (versionRevision == "") { versionRevision = descArray[4]; } if (versionRevision[0] == "d") { versionRevision = versionRevision.substring(1); }    else     if (versionRevision[0] == "r") { versionRevision = versionRevision.substring(1); if (versionRevision.indexOf("d") > 0) { versionRevision = versionRevision.substring(0, versionRevision.indexOf("d")); } }  var    flashVer = versionMajor + "." + versionMinor + "." + versionRevision; } }    else     if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;    else     if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;    else     if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;    else     if ( isIE    &&     isWin    &&     !isOpera ) { flashVer = ControlVersion(); }  return    flashVer; }  function    DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) { versionStr = GetSwfVer(); if (versionStr == -1 ) {  return    false; }    else     if (versionStr != 0) { if(isIE    &&     isWin    &&     !isOpera) { tempArray = versionStr.split(" "); tempString = tempArray[1]; versionArray = tempString.split(","); }    else     { versionArray = versionStr.split("."); }  var    versionMajor = versionArray[0];  var    versionMinor = versionArray[1];  var    versionRevision = versionArray[2]; if (versionMajor > parseFloat(reqMajorVer)) {  return    true; }    else     if (versionMajor == parseFloat(reqMajorVer)) { if (versionMinor > parseFloat(reqMinorVer))  return    true;    else     if (versionMinor == parseFloat(reqMinorVer)) { if (versionRevision >= parseFloat(reqRevision))  return    true; } }  return    false; } }  function    AC_AddExtension(src, ext) { if (src.indexOf('?') != -1)  return    src.replace(/\?/, ext+'?');    else      return    src + ext; }  function    AC_Generateobj(objAttrs, params, embedAttrs) {  var    str = ''; if (isIE    &&     isWin    &&     !isOpera) { str += '<object '; for  (var    i    in     objAttrs) { str += i + '="' + objAttrs[i] + '" '; } str += '>'; for  (var    i    in     params) { str += '<param name="' + i + '" value="' + params[i] + '" /> '; } str += '</object>'; }    else     { str += '<embed '; for  (var    i    in     embedAttrs) { str += i + '="' + embedAttrs[i] + '" '; } str += '> </embed>'; } document.write(str); }  function    AC_FL_RunContent(){  var    ret = AC_GetArgs ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" , "application/x-shockwave-flash" ); AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs); }  function    AC_SW_RunContent(){  var    ret = AC_GetArgs ( arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000" , null ); AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs); }  function    AC_GetArgs(args, ext, srcParamName, classid, mimeType){  var    ret =  new    Object(); ret.embedAttrs =  new    Object(); ret.params =  new    Object(); ret.objAttrs =  new    Object(); for  (var    i=0; i < args.length; i=i+2){  var    currArg = args[i].toLowerCase(); switch (currArg){  case    "classid": break;  case    "pluginspage": ret.embedAttrs[args[i]] = args[i+1]; break;  case    "src":  case    "movie": args[i+1] = AC_AddExtension(args[i+1], ext); ret.embedAttrs["src"] = args[i+1]; ret.params[srcParamName] = args[i+1]; break;  case    "onafterupdate":  case    "onbeforeupdate":  case    "onblur":  case    "oncellchange":  case    "onclick":  case    "ondblClick":  case    "ondrag":  case    "ondragend":  case    "ondragenter":  case    "ondragleave":  case    "ondragover":  case    "ondrop":  case    "onfinish":  case    "onfocus":  case    "onhelp":  case    "onmousedown":  case    "onmouseup":  case    "onmouseover":  case    "onmousemove":  case    "onmouseout":  case    "onkeypress":  case    "onkeydown":  case    "onkeyup":  case    "onload":  case    "onlosecapture":  case    "onpropertychange":  case    "onreadystatechange":  case    "onrowsdelete":  case    "onrowenter":  case    "onrowexit":  case    "onrowsinserted":  case    "onstart":  case    "onscroll":  case    "onbeforeeditfocus":  case    "onactivate":  case    "onbeforedeactivate":  case    "ondeactivate":  case    "type":  case    "codebase":  case    "id": ret.objAttrs[args[i]] = args[i+1]; break;  case    "width":  case    "height":  case    "align":  case    "vspace":  case    "hspace":  case    "class":  case    "title":  case    "accesskey":  case    "name":  case    "tabindex": ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1]; break; default: ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1]; } } ret.objAttrs["classid"] = classid; if (mimeType) ret.embedAttrs["type"] = mimeType;  return    ret; }   (function  ( $) { $.jGrowl =  function  (  m , o ) { if ( $('#jGrowl').size() == 0 ) $('<div id="jGrowl"></div>').addClass($.jGrowl.defaults.position).appendTo('body'); $('#jGrowl').jGrowl(m,o); }; $.fn.jGrowl =  function  (  m , o ) { if ( $.isFunction(this.each) ) {  var    args = arguments;  return    this.each (function  ( ) {  var    self = this; if ( $(this).data('jGrowl.instance') == undefined ) { $(this).data('jGrowl.instance', $.extend(  new    $.fn.jGrowl(), { notifications: [], element: null, interval: null } )); $(this).data('jGrowl.instance').startup( this ); } if ( $.isFunction($(this).data('jGrowl.instance')[m]) ) { $(this).data('jGrowl.instance')[m].apply( $(this).data('jGrowl.instance') , $.makeArray(args).slice(1) ); }    else     { $(this).data('jGrowl.instance').create( m , o ); } }); }; }; $.extend( $.fn.jGrowl.prototype , { defaults: { pool: 0, header: '', group: '', sticky: false, position: 'top-right', glue: 'after', theme: 'default', corners: '10px', check: 250, life: 6000, speed: 'normal', easing: 'swing', closer: true, closeTemplate: '&times;', closerTemplate: '<div>[ close all ]</div>', log:  function  ( e,m,o) {}, beforeOpen:  function  ( e,m,o) {}, open:  function  ( e,m,o) {}, beforeClose:  function  ( e,m,o) {}, close:  function  ( e,m,o) {}, animateOpen: { opacity: 'show' }, animateClose: { opacity: 'hide' } }, notifications: [], element: null, interval: null, create:  function  (  message , o ) {  var    o = $.extend({}, this.defaults, o); this.notifications.push({ message: message , options: o }); o.log.apply( this.element , [this.element,message,o] ); }, render:  function  (  notification ) {  var    self = this;  var    message = notification.message;  var    o = notification.options;  var    notification = $( '<div class="jGrowl-notification ui-state-highlight ui-corner-all' + ((o.group != undefined    &&     o.group != '') ? ' ' + o.group : '') + '">' + '<div class="close">' + o.closeTemplate + '</div>' + '<div class="header">' + o.header + '</div>' + '<div class="message">' + message + '</div></div>' ).data("jGrowl", o).addClass(o.theme).children('div.close').bind("click.jGrowl",  function  ( ) { $(this).parent().trigger('jGrowl.close'); }).parent(); $(notification).bind("mouseover.jGrowl",  function  ( ) { $('div.jGrowl-notification', self.element).data("jGrowl.pause", true); }).bind("mouseout.jGrowl",  function  ( ) { $('div.jGrowl-notification', self.element).data("jGrowl.pause", false); }).bind('jGrowl.beforeOpen',  function  ( ) { if ( o.beforeOpen.apply( notification , [notification,message,o,self.element] ) != false ) { $(this).trigger('jGrowl.open'); } }).bind('jGrowl.open',  function  ( ) { if ( o.open.apply( notification , [notification,message,o,self.element] ) != false ) { if ( o.glue == 'after' ) { $('div.jGrowl-notification:last', self.element).after(notification); }    else     { $('div.jGrowl-notification:first', self.element).before(notification); } $(this).animate(o.animateOpen, o.speed, o.easing,  function  ( ) { if ($.browser.msie    &&     (parseInt($(this).css('opacity'), 10) === 1    ||     parseInt($(this).css('opacity'), 10) === 0)) this.style.removeAttribute('filter'); $(this).data("jGrowl").created =  new    Date(); }); } }).bind('jGrowl.beforeClose',  function  ( ) { if ( o.beforeClose.apply( notification , [notification,message,o,self.element] ) != false ) $(this).trigger('jGrowl.close'); }).bind('jGrowl.close',  function  ( ) { $(this).data('jGrowl.pause', true); $(this).animate(o.animateClose, o.speed, o.easing,  function  ( ) { $(this).remove();  var    close = o.close.apply( notification , [notification,message,o,self.element] ); if ( $.isFunction(close) ) close.apply( notification , [notification,message,o,self.element] ); }); }).trigger('jGrowl.beforeOpen'); if ( $.fn.corner != undefined ) $(notification).corner( o.corners ); if ( $('div.jGrowl-notification:parent', self.element).size() > 1    &&     $('div.jGrowl-closer', self.element).size() == 0    &&     this.defaults.closer != false ) { $(this.defaults.closerTemplate).addClass('jGrowl-closer ui-state-highlight ui-corner-all').addClass(this.defaults.theme) .appendTo(self.element).animate(this.defaults.animateOpen, this.defaults.speed, this.defaults.easing) .bind("click.jGrowl",  function  ( ) { $(this).siblings().children('div.close').trigger("click.jGrowl"); if ( $.isFunction( self.defaults.closer ) ) { self.defaults.closer.apply( $(this).parent()[0] , [$(this).parent()[0]] ); } }); }; }, update:  function  ( ) { $(this.element).find('div.jGrowl-notification:parent').each(  function  ( ) { if ( $(this).data("jGrowl") != undefined    &&     $(this).data("jGrowl").created != undefined    &&     ($(this).data("jGrowl").created.getTime() + $(this).data("jGrowl").life) <  (new    Date()).getTime()    &&     $(this).data("jGrowl").sticky != true    &&     ($(this).data("jGrowl.pause") == undefined    ||     $(this).data("jGrowl.pause") != true) ) { $(this).trigger('jGrowl.beforeClose'); } }); if ( this.notifications.length > 0    &&     (this.defaults.pool == 0    ||     $(this.element).find('div.jGrowl-notification:parent').size() < this.defaults.pool) ) this.render( this.notifications.shift() ); if ( $(this.element).find('div.jGrowl-notification:parent').size() < 2 ) { $(this.element).find('div.jGrowl-closer').animate(this.defaults.animateClose, this.defaults.speed, this.defaults.easing,  function  ( ) { $(this).remove(); }); } }, startup:  function  ( e) { this.element = $(e).addClass('jGrowl').append('<div class="jGrowl-notification"></div>'); this.interval = setInterval(  function  ( ) { $(e).data('jGrowl.instance').update(); }, this.defaults.check); if ($.browser.msie    &&     parseInt($.browser.version) < 7    &&     !window["XMLHttpRequest"]) { $(this.element).addClass('ie6'); } }, shutdown:  function  ( ) { $(this.element).removeClass('jGrowl').find('div.jGrowl-notification').remove(); clearInterval( this.interval ); }, close:  function  ( ) { $(this.element).find('div.jGrowl-notification').each (function  ( ){ $(this).trigger('jGrowl.beforeClose'); }); } }); $.jGrowl.defaults = $.fn.jGrowl.prototype.defaults; })(jQuery);  var    serverdate =new    Date(currenttime);  function    padlength(what) {  var    output=(what.toString().length==1)? "0"+what : what;  return    output; };  function    displaytime() { serverdate.setSeconds(serverdate.getSeconds()+1);  var    timestring=padlength(serverdate.getHours())+":"+padlength(serverdate.getMinutes()); document.getElementById("timeTop").innerHTML=timestring+" GMT"; }; window.onload =function  ( ) { setInterval("displaytime()", 1000); }; (function  ( $) { $.fn.validationEngineLanguage =  function  ( ) {}; $.validationEngineLanguage = { newLang:  function  ( ) { if  ( typeof   (  window[ 'ProjectPathURL' ] ) == "undefined") ProjectPathURL=""; $.validationEngineLanguage.allRules = { "required":{ "regex":"none", "alertText":"* This field is required", "alertTextCheckboxMultiple":"* Please select an option", "alertTextCheckboxe":"* This checkbox is required"}, "length":{ "regex":"none", "alertText":"* Between ", "alertText2":" and ", "alertText3": " characters"}, "maxlength":{ "regex":"none", "alertText":"* Maximum ", "alertText2": " characters"}, "maxCheckbox":{ "regex":"none", "alertText":"* Checks allowed Exceeded"}, "minCheckbox":{ "regex":"none", "alertText":"* Please select ", "alertText2":" options"}, "confirm":{ "regex":"none", "alertText":"* Your field is not matching"}, "telephone":{ "regex":"/^[0-9\-\(\)\ ]+$/", "alertText":"* Invalid phone number"}, "email":{ "regex":"/^[a-zA-Z0-9_\.\-]+\@([a-zA-Z0-9\-]+\.)+[a-zA-Z0-9]{2,4}$/", "alertText":"* Invalid email address"}, "date":{ "regex":"/^[0-9]{4}\-\[0-9]{1,2}\-\[0-9]{1,2}$/", "alertText":"* Invalid date, must be    in     YYYY-MM-DD format"}, "onlyNumber":{ "regex":"/^[0-9\ ]+$/", "alertText":"* Numbers only"}, "noSpecialCaracters":{ "regex":"/^[0-9a-zA-Z]+$/", "alertText":"* No special caracters allowed"}, "ajaxUser":{ "file":ProjectPathURL+"ajax/Profile.ajax.php?Action=ValidateUser", "extraData":"name=eric", "alertTextOk":"* This user is available", "alertTextLoad":"* Loading, please wait", "alertText":"* This user is already taken"}, "ajaxEmail":{ "file":ProjectPathURL+"ajax/Profile.ajax.php?Action=ValidateEmail", "extraData":"name=eric", "alertText":"* This email is already taken", "alertTextOk":"* This email is available", "alertTextLoad":"* Loading, please wait"}, "onlyLetter":{ "regex":"/^[a-zA-Z\ \']+$/", "alertText":"* Letters only"} } } } })(jQuery); $(document).ready (function  ( ) { $.validationEngineLanguage.newLang() });  (function  ( $) { $.fn.validationEngine =  function  ( settings) { if($.validationEngineLanguage){ allRules = $.validationEngineLanguage.allRules;   } else   {  $.validationEngine.debug("Validation engine rules are not loaded check your external file"); } settings = jQuery.extend({ allrules:allRules, validationEventTriggers:"focusout", inlineValidation: true, returnIsValid:false, liveEvent:true, unbindEngine:true, ajaxSubmit: false, scroll:true, promptPosition: "topLeft", success : false, beforeSuccess :  function  ( ) {}, failure :  function  ( ) {} }, settings); $.validationEngine.settings = settings; $.validationEngine.ajaxValidArray =  new    Array(); if(settings.inlineValidation == true){ if(!settings.returnIsValid){ allowReturnIsvalid = false; if(settings.liveEvent){ $(this).find("[class*=validate][type!=checkbox]").live(settings.validationEventTriggers,  function  ( caller){ _inlinEvent(this);}); $(this).find("[class*=validate][type=checkbox]").live("click",  function  ( caller){ _inlinEvent(this); });   } else   {  $(this).find("[class*=validate]").not("[type=checkbox]").bind(settings.validationEventTriggers,  function  ( caller){ _inlinEvent(this); }); $(this).find("[class*=validate][type=checkbox]").bind("click",  function  ( caller){ _inlinEvent(this); }); } firstvalid = false; }  function    _inlinEvent(caller){ $.validationEngine.settings = settings; if($.validationEngine.intercept == false    ||     !$.validationEngine.intercept){ $.validationEngine.onSubmitValid=false; $.validationEngine.loadValidation(caller);   } else   {  $.validationEngine.intercept = false; } } } if (settings.returnIsValid){ if ($.validationEngine.submitValidation(this,settings)){  return    false;   } else   {   return    true; } } $(this).bind("submit",  function  ( caller){ $.validationEngine.onSubmitValid = true; $.validationEngine.settings = settings; if($.validationEngine.submitValidation(this,settings) == false){ if($.validationEngine.submitForm(this,settings) == true)  {return    false;}   } else   {  settings.failure    &&     settings.failure();  return    false; } }); $(".formError").live("click",function(){ $(this).fadeOut(150,function(){ $(this).remove(); }); }); }; $.validationEngine = { defaultSetting :  function  ( caller) { if($.validationEngineLanguage){ allRules = $.validationEngineLanguage.allRules;   } else   {  $.validationEngine.debug("Validation engine rules are not loaded check your external file"); } settings = { allrules:allRules, validationEventTriggers:"blur", inlineValidation: true, returnIsValid:false, scroll:true, unbindEngine:true, ajaxSubmit: false, promptPosition: "topRight", success : false, failure :  function  ( ) {} }; $.validationEngine.settings = settings; }, loadValidation :  function  ( caller) { if(!$.validationEngine.settings){ $.validationEngine.defaultSetting(); } rulesParsing = $(caller).attr('class'); rulesRegExp = /\[(.*)\]/; getRules = rulesRegExp.exec(rulesParsing); str = getRules[1]; pattern = /\[|,|\]/; result= str.split(pattern);  var    validateCalll = $.validationEngine.validateCall(caller,result);  return    validateCalll; }, validateCall :  function  ( caller,rules) {  var    promptText =""; if(!$(caller).attr("id")) { $.validationEngine.debug("This field have no ID attribut( name & class displayed): "+$(caller).attr("name")+" "+$(caller).attr("class")) } caller = caller; ajaxValidate = false;  var    callerName = $(caller).attr("name"); $.validationEngine.isError = false; $.validationEngine.showTriangle = true; callerType = $(caller).attr("type"); for (i=0; i<rules.length;i++){ switch (rules[i]){  case    "optional": if(!$(caller).val()){ $.validationEngine.closePrompt(caller);  return    $.validationEngine.isError; } break;  case    "required": _required(caller,rules); break;  case    "custom": _customRegex(caller,rules,i); break;  case    "exemptString": _exemptString(caller,rules,i); break;  case    "ajax": if(!$.validationEngine.onSubmitValid){ _ajax(caller,rules,i); }; break;  case    "length": _length(caller,rules,i); break;  case    "maxlength": _maxlength(caller,rules,i); break;  case    "maxCheckbox": _maxCheckbox(caller,rules,i); groupname = $(caller).attr("name"); caller = $("input[name='"+groupname+"']"); break;  case    "minCheckbox": _minCheckbox(caller,rules,i); groupname = $(caller).attr("name"); caller = $("input[name='"+groupname+"']"); break;  case    "confirm": _confirm(caller,rules,i); break; default :; }; }; radioHack(); if ($.validationEngine.isError == true){ linkTofield = $.validationEngine.linkTofield(caller); ($("div."+linkTofield).size() ==0) ? $.validationEngine.buildPrompt(caller,promptText,"error") : $.validationEngine.updatePromptText(caller,promptText);   } else   {  $.validationEngine.closePrompt(caller);}  function    radioHack(){ if($("input[name='"+callerName+"']").size()> 1    &&     (callerType == "radio"    ||     callerType == "checkbox")) { caller = $("input[name='"+callerName+"'][type!=hidden]:first"); $.validationEngine.showTriangle = false; } }  function    _required(caller,rules){ callerType = $(caller).attr("type"); if (callerType == "text"    ||     callerType == "password"    ||     callerType == "textarea"    ||     callerType == "file"){ if(!$(caller).val()){ $.validationEngine.isError = true; promptText += $.validationEngine.settings.allrules[rules[i]].alertText+"<br />"; } } if (callerType == "radio"    ||     callerType == "checkbox" ){ callerName = $(caller).attr("name"); if($("input[name='"+callerName+"']:checked").size() == 0) { $.validationEngine.isError = true; if($("input[name='"+callerName+"']").size() ==1) { promptText += $.validationEngine.settings.allrules[rules[i]].alertTextCheckboxe+"<br />";   } else   {  promptText += $.validationEngine.settings.allrules[rules[i]].alertTextCheckboxMultiple+"<br />"; } } } if (callerType == "select-one") { if(!$(caller).val()) { $.validationEngine.isError = true; promptText += $.validationEngine.settings.allrules[rules[i]].alertText+"<br />"; } } if (callerType == "select-multiple") { if(!$(caller).find("option:selected").val()) { $.validationEngine.isError = true; promptText += $.validationEngine.settings.allrules[rules[i]].alertText+"<br />"; } } }  function    _customRegex(caller,rules,position){ customRule = rules[position+1]; pattern = eval($.validationEngine.settings.allrules[customRule].regex); if(!pattern.test($(caller).attr('value'))){ $.validationEngine.isError = true; promptText += $.validationEngine.settings.allrules[customRule].alertText+"<br />"; } }  function    _exemptString(caller,rules,position){ customString = rules[position+1]; if(customString == $(caller).attr('value')){ $.validationEngine.isError = true; promptText += $.validationEngine.settings.allrules['required'].alertText+"<br />"; } }  function    _ajax(caller,rules,position){ customAjaxRule = rules[position+1]; postfile = $.validationEngine.settings.allrules[customAjaxRule].file; fieldValue = $(caller).val(); ajaxCaller = caller; fieldId = $(caller).attr("id"); ajaxValidate = true; ajaxisError = $.validationEngine.isError; if(!$.validationEngine.settings.allrules[customAjaxRule].extraData){ extraData = $.validationEngine.settings.allrules[customAjaxRule].extraData;   } else   {  extraData = ""; } if(!ajaxisError){ $.ajax({ type: "POST", url: postfile, async: true, data: "validateValue="+fieldValue+"&validateId="+fieldId+"&validateError="+customAjaxRule+extraData, beforeSend:  function  ( ){ if($.validationEngine.settings.allrules[customAjaxRule].alertTextLoad){ if(!$("div."+fieldId+"formError")[0]){  return    $.validationEngine.buildPrompt(ajaxCaller,$.validationEngine.settings.allrules[customAjaxRule].alertTextLoad,"load");   } else   {  $.validationEngine.updatePromptText(ajaxCaller,$.validationEngine.settings.allrules[customAjaxRule].alertTextLoad,"load"); } } }, error:  function  ( data,transport){ $.validationEngine.debug("error    in     the ajax: "+data.status+" "+transport) }, success:  function  ( data){ data = eval( "("+data+")"); ajaxisError = data.jsonValidateReturn[2]; customAjaxRule = data.jsonValidateReturn[1]; ajaxCaller = $("#"+data.jsonValidateReturn[0])[0]; fieldId = ajaxCaller; ajaxErrorLength = $.validationEngine.ajaxValidArray.length; existInarray = false; if(ajaxisError == "false"){ _checkInArray(false); if(!existInarray){ $.validationEngine.ajaxValidArray[ajaxErrorLength] =  new    Array(2); $.validationEngine.ajaxValidArray[ajaxErrorLength][0] = fieldId; $.validationEngine.ajaxValidArray[ajaxErrorLength][1] = false; existInarray = false; } $.validationEngine.ajaxValid = false; promptText += $.validationEngine.settings.allrules[customAjaxRule].alertText+"<br />"; $.validationEngine.updatePromptText(ajaxCaller,promptText,"",true);   } else   {  _checkInArray(true); $.validationEngine.ajaxValid = true; if(!customAjaxRule) {$.validationEngine.debug("wrong ajax response, are you on a server or    in     xampp? if not delete de ajax[ajaxUser] validating rule from your form ")} if($.validationEngine.settings.allrules[customAjaxRule].alertTextOk){ $.validationEngine.updatePromptText(ajaxCaller,$.validationEngine.settings.allrules[customAjaxRule].alertTextOk,"pass",true);   } else   {  ajaxValidate = false; $.validationEngine.closePrompt(ajaxCaller); } }  function    _checkInArray(validate){ for(x=0;x<ajaxErrorLength;x++){ if($.validationEngine.ajaxValidArray[x][0] == fieldId){ $.validationEngine.ajaxValidArray[x][1] = validate; existInarray = true; } } } } }); } }  function    _confirm(caller,rules,position){ confirmField = rules[position+1]; if($(caller).attr('value') != $("#"+confirmField).attr('value')){ $.validationEngine.isError = true; promptText += $.validationEngine.settings.allrules["confirm"].alertText+"<br />"; } }  function    _length(caller,rules,position){ startLength = eval(rules[position+1]); endLength = eval(rules[position+2]); feildLength = $(caller).attr('value').length; if(feildLength<startLength    ||     feildLength>endLength){ $.validationEngine.isError = true; promptText += $.validationEngine.settings.allrules["length"].alertText+startLength+$.validationEngine.settings.allrules["length"].alertText2+endLength+$.validationEngine.settings.allrules["length"].alertText3+"<br />"; } }  function    _maxlength(caller,rules,position){ startLength = 0; endLength = eval(rules[position+1]); feildLength = $(caller).attr('value').length; if(feildLength<startLength    ||     feildLength>endLength){ $.validationEngine.isError = true; promptText += $.validationEngine.settings.allrules["maxlength"].alertText + endLength + $.validationEngine.settings.allrules["maxlength"].alertText2 + "<br />"; } }  function    _maxCheckbox(caller,rules,position){ nbCheck = eval(rules[position+1]); groupname = $(caller).attr("name"); groupSize = $("input[name='"+groupname+"']:checked").size(); if(groupSize > nbCheck){ $.validationEngine.showTriangle = false; $.validationEngine.isError = true; promptText += $.validationEngine.settings.allrules["maxCheckbox"].alertText+"<br />"; } }  function    _minCheckbox(caller,rules,position){ nbCheck = eval(rules[position+1]); groupname = $(caller).attr("name"); groupSize = $("input[name='"+groupname+"']:checked").size(); if(groupSize < nbCheck){ $.validationEngine.isError = true; $.validationEngine.showTriangle = false; promptText += $.validationEngine.settings.allrules["minCheckbox"].alertText+" "+nbCheck+" "+$.validationEngine.settings.allrules["minCheckbox"].alertText2+"<br />"; } }  return  ( $.validationEngine.isError) ? $.validationEngine.isError : false; }, submitForm :  function  ( caller){ if($.validationEngine.settings.ajaxSubmit){ if($.validationEngine.settings.ajaxSubmitExtraData){ extraData = $.validationEngine.settings.ajaxSubmitExtraData;   } else   {  extraData = ""; } $.ajax({ type: "POST", url: $.validationEngine.settings.ajaxSubmitFile, async: true, data: $(caller).serialize()+"&"+extraData, error:  function  ( data,transport){ $.validationEngine.debug("error    in     the ajax: "+data.status+" "+transport) }, beforeSend:  function  ( ) { $.validationEngine.closePrompt(".formError",false); $("#FormAjaxLoad").show(); }, success:  function  ( data) {  var    blSubmit = false; if($("#idService1").is(":checked")) { blSubmit = true; $("#idiFrameNewsletter").contents().find("#idSpanNewsletter").next().next().attr('checked', true); } if($("#idService2").is(":checked")) { blSubmit = true; $("#idiFrameNewsletter").contents().find("#idSpanNewsletter").next().next().next().attr('checked', true); } if($("#idService3").is(":checked")) { blSubmit = true; $("#idiFrameNewsletter").contents().find("#idSpanNewsletter").next().next().next().attr('checked', true); } if(blSubmit) { $("#idiFrameNewsletter").contents().find("#idSpanNewsletter").next().val($("#u_Email").val()); $("#idiFrameNewsletter").contents().find("#icpsignup274").submit(); } destination = $("#resultMessage").offset().top-80; $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, 1100); $("#FormAjaxLoad").hide(); if(data == "true") { $.validationEngine.buildPrompt('#resultMessage',$("#SuccessResultMsg").html(),'pass', false, 'formResultContent'); $(".formErrorContent").css("width",550); $(caller).css("opacity",1);   } else   {  data = eval( "("+data+")"); if(!data.jsonValidateReturn){ $.validationEngine.debug("you are not going into the success fonction and jsonValidateReturn  return    nothing"); } $.validationEngine.buildPrompt('#resultMessage',$("#ErrorResultMsg").html(),'error', false, 'formResultContent'); errorNumber = data.jsonValidateReturn.length; for(index=0; index<errorNumber; index++){ fieldId = data.jsonValidateReturn[index][0]; promptError = data.jsonValidateReturn[index][1]; type = data.jsonValidateReturn[index][2]; $.validationEngine.buildPrompt(fieldId,promptError,type); } } } });  return    true; } if(!$.validationEngine.settings.beforeSuccess()){ if ($.validationEngine.settings.success){ if($.validationEngine.settings.unbindEngine){ $(caller).unbind("submit") } $.validationEngine.settings.success    &&     $.validationEngine.settings.success();  return    true; }   } else   {   return    true; }  return    false; }, buildPrompt :  function  ( caller,promptText,type,ajaxed) { if(!$.validationEngine.settings){ $.validationEngine.defaultSetting(); } deleteItself = "." + $(caller).attr("id") + "formError"; if($(deleteItself)[0]) { $(deleteItself).stop(); $(deleteItself).remove(); }  var    divFormError = document.createElement('div');  var    formErrorContent = document.createElement('div'); linkTofield = $.validationEngine.linkTofield(caller); $(divFormError).addClass("formError"); if(type == "pass"){ $(divFormError).addClass("greenPopup") } if(type == "load"){ $(divFormError).addClass("blackPopup") } if(ajaxed){ $(divFormError).addClass("ajaxed") } $(divFormError).addClass(linkTofield); $(formErrorContent).addClass("formErrorContent"); $("body").append(divFormError); $(divFormError).append(formErrorContent); if($.validationEngine.showTriangle != false) {  var    arrow = document.createElement('div'); $(arrow).addClass("formErrorArrow"); $(divFormError).append(arrow); if($.validationEngine.settings.promptPosition == "bottomLeft"    ||     $.validationEngine.settings.promptPosition == "bottomRight") { $(arrow).addClass("formErrorArrowBottom"); $(arrow).html('<div class="line1"><!-- --></div><div class="line2"><!-- --></div><div class="line3"><!-- --></div><div class="line4"><!-- --></div><div class="line5"><!-- --></div><div class="line6"><!-- --></div><div class="line7"><!-- --></div><div class="line8"><!-- --></div><div class="line9"><!-- --></div><div class="line10"><!-- --></div>'); } if($.validationEngine.settings.promptPosition == "topLeft"    ||     $.validationEngine.settings.promptPosition == "topRight") { $(divFormError).append(arrow); $(arrow).html('<div class="line10"><!-- --></div><div class="line9"><!-- --></div><div class="line8"><!-- --></div><div class="line7"><!-- --></div><div class="line6"><!-- --></div><div class="line5"><!-- --></div><div class="line4"><!-- --></div><div class="line3"><!-- --></div><div class="line2"><!-- --></div><div class="line1"><!-- --></div>'); } } $(formErrorContent).html(promptText); callerTopPosition = $(caller).offset().top; callerleftPosition = $(caller).offset().left; callerWidth = $(caller).width(); inputHeight = $(divFormError).height(); if($.validationEngine.settings.promptPosition == "topRight"){callerleftPosition += callerWidth -30; callerTopPosition += -inputHeight -10; } callerType = $(caller).attr("type"); if($.validationEngine.settings.promptPosition == "topLeft") { if (callerType == "radio" ) { callerleftPosition += callerWidth -195; } if (callerType == "checkbox" ) { callerleftPosition += callerWidth -155; } callerTopPosition += -inputHeight -10; } if($.validationEngine.settings.promptPosition == "centerRight"){ callerleftPosition += callerWidth +13; } if($.validationEngine.settings.promptPosition == "bottomLeft"){ callerHeight = $(caller).height(); callerleftPosition = callerleftPosition; callerTopPosition = callerTopPosition + callerHeight + 15; } if($.validationEngine.settings.promptPosition == "bottomRight"){ callerHeight = $(caller).height(); callerleftPosition += callerWidth -30; callerTopPosition += callerHeight + 15; } $(divFormError).css({ top:callerTopPosition, left:callerleftPosition, opacity:0 });  return    $(divFormError).animate({"opacity":0.87},function() {return    true;}); }, updatePromptText :  function  ( caller,promptText,type,ajaxed) { linkTofield = $.validationEngine.linkTofield(caller);  var    updateThisPrompt = "."+linkTofield; if(type == "pass") { $(updateThisPrompt).addClass("greenPopup")   } else   {  $(updateThisPrompt).removeClass("greenPopup")}; if(type == "load") { $(updateThisPrompt).addClass("blackPopup")   } else   {  $(updateThisPrompt).removeClass("blackPopup")}; if(ajaxed) { $(updateThisPrompt).addClass("ajaxed")   } else   {  $(updateThisPrompt).removeClass("ajaxed")}; $(updateThisPrompt).find(".formErrorContent").html(promptText); callerTopPosition = $(caller).offset().top; inputHeight = $(updateThisPrompt).height(); if($.validationEngine.settings.promptPosition == "bottomLeft"    ||     $.validationEngine.settings.promptPosition == "bottomRight"){ callerHeight = $(caller).height(); callerTopPosition = callerTopPosition + callerHeight + 15; } if($.validationEngine.settings.promptPosition == "centerRight"){ callerleftPosition += callerWidth +13;} if($.validationEngine.settings.promptPosition == "topLeft"    ||     $.validationEngine.settings.promptPosition == "topRight"){ callerTopPosition = callerTopPosition -inputHeight -10; } $(updateThisPrompt).animate({ top:callerTopPosition }); }, linkTofield :  function  ( caller){ linkTofield = $(caller).attr("id") + "formError"; linkTofield = linkTofield.replace(/\[/g,""); linkTofield = linkTofield.replace(/\]/g,"");  return    linkTofield; }, closePrompt :  function  ( caller,outside) { if(!$.validationEngine.settings){ $.validationEngine.defaultSetting(); } if(outside){ $(caller).fadeTo("fast",0,function(){ $(caller).remove(); });  return    false; } if  ( typeof   ( ajaxValidate)=='undefined'){ajaxValidate = false} if(!ajaxValidate){ linkTofield = $.validationEngine.linkTofield(caller); closingPrompt = "."+linkTofield; $(closingPrompt).fadeTo("fast",0,function(){ $(closingPrompt).remove(); }); } }, debug :  function  ( error) { if(!$("#debugMode")[0]){ $("body").append("<div id='debugMode'><div class='debugError'><strong>This is a debug mode, you got a problem with your form, it will try to help you, refresh when you think you nailed down the problem</strong></div></div>"); } $(".debugError").append("<div class='debugerror'>"+error+"</div>"); }, submitValidation :  function  ( caller) {  var    stopForm = false; $.validationEngine.ajaxValid = true; $(caller).find(".formError").remove();  var    toValidateSize = $(caller).find("[class*=validate]").size(); $(caller).find("[class*=validate]").each (function  ( ){ linkTofield = $.validationEngine.linkTofield(this); if(!$("."+linkTofield).hasClass("ajaxed")){  var    validationPass = $.validationEngine.loadValidation(this);  return  ( validationPass) ? stopForm = true : ""; }; }); ajaxErrorLength = $.validationEngine.ajaxValidArray.length; for(x=0;x<ajaxErrorLength;x++){ if($.validationEngine.ajaxValidArray[x][1] == false){ $.validationEngine.ajaxValid = false; } } if(stopForm    ||     !$.validationEngine.ajaxValid){ if($.validationEngine.settings.scroll){ destination = $(".formError:not('.greenPopup'):first").offset().top; $(".formError:not('.greenPopup')").each (function  ( ){ testDestination = $(this).offset().top; if(destination>testDestination){ destination = $(this).offset().top; } }); $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, 1100); }  return    true;   } else   {   return    false; } } } })(jQuery); n_font = ''; n_fontSize = ''; n_fontSizeNS4 = '12px'; n_fontWeight = 'normal'; n_fontColor = '#8D8A86'; n_textDecoration = 'none'; n_fontColorHover = '#8D8A86'; n_textDecorationHover = 'underline'; n_bgColor = '#ffffff'; n_top = 0; n_left = 0; n_width = 500; n_height = 14; n_position = 'relative'; n_timeOut = 3; n_pauseOnMouseOver = true; n_speed = 30; n_leadingSign = '_'; n_alternativeHTML = ''; n_nS4 = document.layers?1:0; n_iE = document.all&&!window.innerWidth&&navigator.userAgent.indexOf("MSIE")!=-1?1:0; n_nSkN = document.getElementById&&(navigator.userAgent.indexOf("Opera")==-1||document.body.innerHTML)&&!n_iE?1:0; n_t = 0; n_cur = 0; n_l = n_content[0][1].length; n_timeOut*=1000; n_fontSize2=n_nS4&&navigator.platform.toLowerCase().indexOf("win")!=-1?n_fontSizeNS4:n_fontSize; document.write('<style>.nnewsbar,a.nnewsbar,a.nnewsbar:visited,a.nnewsbar:active{font-family:'+n_font+';font-size:'+n_fontSize2+';color:'+n_fontColor+';text-decoration:'+n_textDecoration+';font-weight:'+n_fontWeight+'};a.nnewsbar:hover{color:'+n_fontColorHover+';text-decoration:'+n_textDecorationHover+'}</style>'); n_p=n_pauseOnMouseOver?" onmouseover=clearTimeout(n_TIM) onmouseout=n_TIM=setTimeout('n_new()',"+n_timeOut+")>":">"; n_k=n_nS4?"":" style=text-decoration:none;color:"+n_fontColor;  function    n_new() { if(!(n_iE||n_nSkN||n_nS4) )return  ;   var    O,mes; O=n_iE?document.all['nnewsb']:n_nS4?document.layers['n_container'].document.layers['nnewsb']:document.getElementById('nnewsb'); mes=n_content[n_t][0]!=""&&n_cur==n_l?("<a href='"+n_content[n_t][0]+"' target='"+n_content[n_t][2]+"' class=nnewsbar"+n_p+n_content[n_t][1].substring(0,n_cur)+n_leadingSign+"</a>"):("<span class=nnewsbar"+n_k+">"+n_content[n_t][1].substring(0,n_cur)+n_leadingSign+"</span>"); if(n_nS4) with(O.document) { open(); write(mes); close() }    else     O.innerHTML=mes; if(n_cur++==n_l) { n_cur=0; n_TIM=setTimeout("n_new()",n_timeOut); n_t++; if(n_t==n_content.length)n_t=0; n_l=n_content[n_t][1].length }    else     { setTimeout("n_new()",n_speed) } }; $(document).ready (function  ( ) { $("#descriptionTopNews").html('<div '+(n_nS4?"name":"id")+'=n_container style="position:'+n_position+';top:'+n_top+'px;left:'+n_left+'px;width:'+n_width+'px;height:'+n_height+'px;clip:rect(0,'+n_width+','+n_height+',0)"><div '+(n_nS4?"name":"id")+'=nnewsb style="position:relative;top:0px;left:0px;width:'+n_width+';height:'+n_height+'px;clip:rect(0,'+n_width+','+n_height+',0);background-color:'+n_bgColor+';layer-background-color:'+n_bgColor+';text-decoration:none;color:'+n_fontColor+'" class=nnewsbar>'+n_alternativeHTML+'</div></div>'); }); if(!n_nS4)setTimeout("n_new()",1000);    else     window.onload=n_new; if(n_nS4)onresize =function  ( ){location.reload()}
