jQuery.noConflict(); var userAgent = navigator.userAgent.toLowerCase(); // Figure out what browser is being used jQuery.browser = { version: (userAgent.match( /.+(?:rv|it|ra|ie|me)[\/: ]([\d.]+)/ ) || [])[1], chrome: /chrome/.test( userAgent ), safari: /webkit/.test( userAgent ) && !/chrome/.test( userAgent ), opera: /opera/.test( userAgent ), msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ), mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ) } jQuery.create = function() { if (arguments.length == 0) return []; var args = arguments[0] || {}, elem = null, elements = null; var siblings = null; // In case someone passes in a null object, // assume that they want an empty string. if (args == null) args = ""; if (args.constructor == String) { if (arguments.length > 1) { var attributes = arguments[1]; if (attributes.constructor == String) { elem = document.createTextNode(args); elements = []; elements.push(elem); siblings = jQuery.create.apply(null, Array.prototype.slice.call(arguments, 1)); elements = elements.concat(siblings); return elements; } else { elem = document.createElement(args); // Set element attributes. var attributes = arguments[1]; for (var attr in attributes) jQuery(elem).attr(attr, attributes[attr]); // Add children of this element. var children = arguments[2]; children = jQuery.create.apply(null, children); jQuery(elem).append(children); // If there are more siblings, render those too. if (arguments.length > 3) { siblings = jQuery.create.apply(null, Array.prototype.slice.call(arguments, 3)); return [elem].concat(siblings); } return elem; } } else return document.createTextNode(args); } else { elements = []; elements.push(args); siblings = jQuery.create.apply(null, (Array.prototype.slice.call(arguments, 1))); elements = elements.concat(siblings); return elements; } }; /* Float box */ function openFloatBox(content, newClass){ jQuery('.floatBoxContent').attr('class', 'floatBoxContent '+newClass); jQuery('.floatBoxInner').html(content); jQuery('#floatBox').show(); } function closeFloatBox(){ jQuery('#floatBox').hide(); } /* Init ZopIM */ function initZopIM(id){ if(id != ''){ window.$zopim||(function(d,s){var z=$zopim=function(c){z._.push(c)},$= z.s=d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o ){z.set._.push(o)};$.setAttribute('charset','utf-8');$.async=!0;z.set. _=[];$.src=('https:'==d.location.protocol?'https://ssl':'http://cdn')+ '.zopim.com/?'+id;$.type='text/java'+s;z. t=+new Date;z._=[];e.parentNode.insertBefore($,e)})(document,'script') } } /* Init Google Analytics */ function initGA(id){ if( id != '' ){ var _gaq = _gaq || []; _gaq.push(['_setAccount', id]); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); } } jQuery(document).ready(function(){ //Form jQuery("form input[type='text'], form input[type='email'], form textarea").focus(function(){ var obj = jQuery(this), currentVal = obj.val(); if( !jQuery(obj).hasClass('changed') ){ obj.val(''); jQuery(this).blur(function(){ var newVal = jQuery(this).val(); if(jQuery.trim(newVal) == '' || jQuery.trim(newVal) == currentVal){ jQuery(this).val(currentVal); }else{ jQuery(this).addClass('changed'); } }) } }); //Banner jQuery('#banner_wrapp').cycle({ fx: 'fade', speed: 1000, timeout: 6000 }); //Main style if( jQuery('.iWidgets div').length <= 0 ){ jQuery('.iWidgets').remove(); jQuery('.iMain').addClass('iMainfull'); } //Hope page boxes if( jQuery('.hpboxes').length > 0 ){ jQuery('.hpboxes li:last-child').css('margin', '0'); } //Colorbox jQuery("a.colorBox").colorbox({rel:'colorBoxGroup'}); //Express Interst Form jQuery("#eiForm").validate({ rules: { Name: "required", Phone: "number", Email: { required: true, email: true } }, messages: { Name: "Please fill Your Name", Phone: "Phone Number must be a number", Email: "Please fill a valid Email" }, errorLabelContainer: jQuery("ul.eif-message"), wrapper: 'li', submitHandler: function(form){ var data = jQuery(form).serialize(); jQuery.ajax({ type: 'POST', url: 'course-detail/ExpressIntersert', data: data, dataType: 'json', beforeSend: function(){ jQuery('ul.eif-message').html('
  • ').show(); }, success: function(result){ if(result.error != ''){ jQuery('ul.eif-message').html('
  • ').show(); } if(result.msg != ''){ jQuery('ul.eif-message').html('
  • ').show(); jQuery(form)[0].reset(); } return false; }, error: function(){ jQuery('ul.eif-message').html('
  • ').show(); }, complete: function(){ } }); return false; //form.submit(); } }); //Contact page jQuery('#Form_Form label.left').each(function(){ var obj = jQuery(this), label = obj.text(), name = obj.attr('for'); jQuery('input#'+name+', textarea#'+name).val(label); }); //Other jQuery('input[type="submit"]').addClass('button'); }) function openEIForm(CourseName, Location){ jQuery('#eiForm input[name="CourseName"]').val(CourseName); jQuery('#eiForm input[name="Location"]').val(Location); jQuery('.eif-course-name span').text(CourseName); jQuery.colorbox({inline:true, width:'725px', height: '80%', href:'#express-interest'}) }