// JavaScript Document /* ***************************************************************************************** * All content, including (but not exclusive to) photos, videos, graphics, style, and * * code are owned and copyrighted to Nineteen05. The use of these copyrighted * * materials is on a licensed basis and use will be revoked upon completion and * * non-renewal of the license by the client. * * © "nineteen 05" 2007. All rights reserved. * ***************************************************************************************** * Change Log * * Authors: Paul D Prins * * 2008-04-26 PDP - Initial Implimentation of the LM * * 2008-07-20 PDP - Added Block management * * 2009-12-19 PDP - Updated to dynamically load additional js files here * * 2010-01-01 PDP - Changed the date selector from CalendarPopup to jQuery.DatePicker * * 2010-01-02 PDP - Added validatePassword() for use when setting passwords * ***************************************************************************************** Purpose: lm - Load Manager handles all the on-load events for the nineteen05 software to make sure that multiple onloads are accomidated. */ // Function builds out the correct file path // function getPath(){ // if( path != '' ) // return path; // // tmpPath = $("[language=javascript][src*='lm.js']").attr('src'); // path = tmpPath.replace('/includes/js/lm.js', '') + '/'; // } // Set the Global Variabls var olms = new Array(); var ulms = new Array(); var jsnames = new Array(); var path = ''; //getPath(); // Load all of the other JS files // addJavascript('includes/js/bsn.AutoSuggest_2.1.3_comp.js', 'body'); // addJavascript('includes/js/jquery-ui-1.7.2.custom.min.js', 'head'); // addJavascript('includes/js/jquery.alerts-1.1.js', 'body'); // addJavascript('includes/js/jquery.qtip-1.0.0-rc3.min.js', 'body'); // addJavascript('includes/js/jquery.tagdragon.min.js', 'body'); // addJavascript('includes/js/swfobject.js', 'body'); // addJavascript('includes/fusioncharts/FusionCharts.js', 'body'); // addJavascript('includes/uploadify/jquery.uploadify.v2.1.0.min.js', 'body'); /* the onLoad Manager */ function olmOn() { window.onload = olmGo; } function olmGo() { for(var i = 0;i < olms.length;i++) { eval(olms[i]); } } function olmAdd(func) { olms[olms.length] = func; } /* The unLoad Manager */ function ulmUn() { window.unload = ulmGo; } function ulmGo() { for(var i = 0;i < ulms.length;i++) eval(ulms[i]); } function ulmAdd(func) { ulms[ulms.length] = func; } /* Run the scripts */ olmOn(); ulmUn(); // Script to load other javascript files (pos = head/body ) function addJavascript(jsname,pos) { if( jsname.indexOf('://') != -1 ) return; // do not allow off site scripts loaded if( jsname in oc(jsnames) ) return; if( document.body == null ){ setTimeout( function(){ addJavascript(jsname,pos); }, 100); return; } // Add script to array jsnames[jsnames.length + 1] = jsname; // Add script to page var th = document.getElementsByTagName( pos.toUpperCase() )[0]; var s = document.createElement('script'); s.setAttribute('type','text/javascript'); s.setAttribute('src', path + jsname); th.appendChild(s); } // Function converts an array to a literal string for use with 'in' function function oc( a ){ var o = {}; for( var i=0; i= 6 && $('#'+field1).val() == $('#'+field2).val() ){ $('#'+field1).closest('form').contents().find(':submit').removeAttr('disabled'); } // Clear Status if we make it here $('#'+status).hide('normal').val(''); } // Block hiding and reveiling for usability, requires the use of jquery $(document).ready(function(){ // Set all the tabs to their page load settings $(".settingHidden").children("#inner").hide(); // Close all tabs not open by default // Sets the value for input images to use in the post $(":image").click(function() { // $(this).closest('form').children("input[name='ButtonValue']").val($(this).val()); $("input[name='ButtonValue']").val($(this).val()); // Change every ButtonValue input item }); // // Start Checkbox selection functions /* How to utilize these checkbox selection features * Select All * Select None * Invert Selection */ // Select all $("A[href='#select_all']").click( function() { $("#" + $(this).attr('rel') + " input:checkbox:not(:checked)").click(); return false; }); // Select none $("A[href='#select_none']").click( function() { $("#" + $(this).attr('rel') + " input:checkbox:checked").click(); return false; }); // Invert selection $("A[href='#invert_selection']").click( function() { $("#" + $(this).attr('rel') + " input:checkbox").click(); return false; }); // Start Checkbox selection functions // // Testing to hide the blocks $("H4").click(function(event) { if( $(this).siblings("#inner").is(":hidden") ) { $(this).siblings("#inner").slideDown("slow"); if($(this).parent().hasClass("settingHidden")) { $(this).parent().removeClass("settingHidden"); } if(!($(this).parent().hasClass("settingShow")) ) { $(this).parent().addClass("settingShow"); } } else { $(this).siblings("#inner").slideUp("slow"); if(!($(this).parent().hasClass("settingHidden")) ) { $(this).parent().addClass("settingHidden"); } if($(this).parent().hasClass("settingShow")) { $(this).parent().removeClass("settingShow"); } } }) .end(); }); // Function will set the default settings for the Validator plugin jQuery.validator.setDefaults({ errorElement: "div" }); // Function will get the values of an object into an array jQuery.fn.getObjectVal = function( attribute ){ attribute = attribute || 'value'; var vals = []; var i = 0; this.each(function(){ vals[i++] = jQuery(this).attr( attribute ); }); return vals; }