Skip to content

Instantly share code, notes, and snippets.

@lazypower
Created April 8, 2011 14:39
Show Gist options
  • Save lazypower/909970 to your computer and use it in GitHub Desktop.
Save lazypower/909970 to your computer and use it in GitHub Desktop.
<%@ Page Title="University Bound Scholarship Program" Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="Scholarship_Default" %>
<%@ Register Src="~/controls/scholarshipForm.ascx" TagPrefix="ub" TagName="ScholarshipForm" %>
<%@Register Src="~/controls/VideoScholarship.ascx" TagPrefix="ub" TagName="VidBox" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head runat="server">
<meta charset="utf-8"/>
<!--[if IE]><![endif]-->
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge;chrome=1"><![endif]-->
<title>University Bound Scholarship Program</title>
<meta name="description" content=""/>
<meta name="keywords" content=""/>
<meta name="author" content="Transhuman Creative"/>
<link rel="shortcut icon" href="/favicon.ico"/>
<link href='http://fonts.googleapis.com/css?family=Droid+Sans:regular,bold' rel='stylesheet' type='text/css'/>
<link rel="stylesheet" href="css/master.css"/>
<link rel="stylesheet" href="css/style.css?v=1.0"/>
<link rel="Stylesheet" href="css/validationEngine.jquery.css" type="text/css" />
<asp:Literal ID="jsonData" runat="server"></asp:Literal>
</head>
<!--[if lt IE 7 ]> <body class="ie6"> <![endif]-->
<!--[if IE 7 ]><body class="ie7"> <![endif]-->
<!--[if IE 8 ]><body class="ie8"> <![endif]-->
<!--[if IE 9 ]><body class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<body>
<!--<![endif]-->
<form runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div class="wrap">
<div id="header" class="clearfix">
<div id="ub-logo" class="ir">The University Bound Scholarship Program</div>
<div id="students-top"></div>
</div>
<!-- /#header -->
<div id="main" class="clearfix">
<div id="ribbon">
<h1>Tell us how online education would change your life&mdash;<br/>
<strong>Win a $2,500 Scholarship.</strong></h1>
</div>
<!-- /#ribbon -->
<div class="endcap left"></div>
<div class="endcap right"></div>
<div id="ribbon-bottom">
<div id="students-bottom"></div>
</div>
<div class="clearfix">
<div class="col left">
<div id="share"><span class="share-text">Share this offer with friends! </span>
<!-- AddThis Button BEGIN -->
<span class="addthis_toolbox addthis_default_style addthis_32x32_style">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<a class="addthis_button_compact"></a>
</span>
<!-- AddThis Button BEGIN -->
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4d962db5052e90bb"></script>
<!-- AddThis Button END -->
</div>
<div class="clearfix">&nbsp;</div>
<div id="intro-video">
<object id='player' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' name='player' width='440' height='270'>
<param name='movie' value='player-licensed.swf' />
<param name='allowfullscreen' value='false' />
<param name='allowscriptaccess" value='always' />
<param name="wmode" value="transparent">
<param name='flashvars' value="file=landingpage.flv&image=foo.jpg" />
<embed " + Environment.NewLine)
Type = 'application/x-shockwave-flash'
ID = 'player2'
name = 'player2'
src = 'player-licensed.swf'
width = '440'
height = '270'
allowscriptaccess = 'always'
allowfullscreen = 'false'
flashvars = "file=landingpage.flv&image=foo.jpg"
wmode = "transparent"
/>
</object>
<%--<object style="height: 262px; width: 430px">
<param name="movie" value="http://www.youtube.com/v/Gc4J1A3VeyE?version=3&autoplay=0">
<param name="allowFullScreen" value="true">
<param name="allowScriptAccess" value="always">
<embed src="http://www.youtube.com/v/Gc4J1A3VeyE?version=3&autoplay=0" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="430" height="262">
</object>--%>
</div>
<!-- /#intro-video -->
<p class="big oj">The University Bound Network supports those who embody the best of what can be achieved through online education.</p>
<p>We believe in the <strong>potential of online education</strong> as a flexible tool for busy and nontraditional students to empower themselves, advance their careers, and <strong>build the lives they want</strong>.</p>
<p>Because we believe that online education can <strong>change your life</strong>, we're awarding a <strong>$2500 scholarship</strong> to the current or future student who best expresses what the transformative <strong>power of education</strong> can do for them. </p>
<p class="blue"><strong>Tell us your story–we want to help you write the next chapter!</strong></p>
<div id="slider">
<div class="items">
<div class="item"> <img src="images/image-1.jpg" width="430" height="240" alt="Earn a degree online- from your own home, at your convenience. " />
<div class="caption">
<p>Earn a degree online- from your own home, at <strong>your</strong> convenience.</p>
</div>
</div>
<div class="item"> <img src="images/image-2.jpg" width="430" height="240" alt="Continue your education online without neglecting other responsibilities." />
<div class="caption">
<p>Continue your education online without neglecting other responsibilities.</p>
</div>
</div>
<div class="item"> <img src="images/image-3.jpg" width="430" height="240" alt="Advance your career and build a better life through online education." />
<div class="caption">
<p>Advance your career and build a better life through online education.</p>
</div>
</div>
</div>
<a class="prev browse left"></a> <a class="next browse right"></a> </div>
</div>
<!-- /.col .left -->
<div class="col right">
<div id="reg-form-wrapper" class="clearfix">
<div id="reg-form-header">
<h3>Register now to submit your video!</h3>
<p>It's as easy as putting a video on youtube.</p>
</div>
<p class="req">all fields are required </p>
<!-- /////// FORM ////////// -->
<ub:ScholarshipForm ID="ScholarshipForm" runat="server" />
<!-- ///// END FORM ////// -->
</div>
<p class="blue-arrow"><strong>Register now</strong> to submit your video and <strong>WIN</strong>!</p>
</div>
<!-- /.col .left -->
</div>
<%--<div id="video-submissions">
<div class="col left">
<h2>Video Submissions</h2>
<p>Vote now on your favorite video, and be sure to <a class="goto-form-link" href="#">submit your own</a>!</p>
</div>
<div class="col right">
<div id="video-search">--%>
<!-- this needs a refactor, with an ajax search result option -->
<%--<span class="video-search-wrap"><input class="video-search-input" type="text" name="video_search" /></span>
<input class="video-search-button" type="submit" value="Find" />--%>
<%-- </div>
</div>
--%>
<%--<div id="video-module" class="clearfix">
<div id="video-feature">
<h3>Featured Video</h3>
<div id="video-holder">
</div>
</div>
<div id="playlist-pages">
<div class="pages">
<ul class="video-playlist">
<li class="clearfix">
<a href="http://www.youtube.com/watch?v=ihA0bbN4C-8">French Fighter Jets Over Lybia</a>
<span class="vid-data">Submitter: RT</span>
<span class="vid-data">March 22, 2011</span>
</li>
<li class="clearfix"><a href="http://www.youtube.com/watch?v=zxAv-REH5ZA">Radiation Level 1,600 Times Above Normal</a>
<span class="vid-data">Submitter: RT</span>
<span class="vid-data">March 22, 2011</span>
</li>
<li class="clearfix"><a href="http://www.youtube.com/watch?v=aprycG9mlZc">Close-up Footage of Ruins at Fukushima</a>
<span class="vid-data">Submitter: RT</span>
<span class="vid-data">March 22, 2011</span>
</li>
<li class="clearfix"><a href="http://www.youtube.com/watch?v=jRYJSVYzNVk">Julian Assange: The Man Who Leaked The World</a>
<span class="vid-data">Submitter: RT</span>
<span class="vid-data">March 22, 2011</span>
</li>
</ul>
<ul class="video-playlist">
<li class="clearfix"><a href="http://www.youtube.com/watch?v=ihA0bbN4C-8">French Fighter Jets Over Lybia</a>
<span class="vid-data">Submitter: RT</span>
<span class="vid-data">March 22, 2011</span>
</li>
<li class="clearfix"><a href="http://www.youtube.com/watch?v=zxAv-REH5ZA">Radiation Level 1,600 Times Above Normal</a>
<span class="vid-data">Submitter: RT</span>
<span class="vid-data">March 22, 2011</span>
</li>
<li class="clearfix"><a href="http://www.youtube.com/watch?v=aprycG9mlZc">Close-up Footage of Ruins at Fukushima</a>
<span class="vid-data">Submitter: RT</span>
<span class="vid-data">March 22, 2011</span>
</li>
<li class="clearfix"><a href="http://www.youtube.com/watch?v=jRYJSVYzNVk">Julian Assange: The Man Who Leaked The World</a>
<span class="vid-data">Submitter: RT</span>
<span class="vid-data">March 22, 2011</span>
</li>
</ul>
</div>
</div>
</div>
<div class="navi"></div>--%>
<%-- <ub:VidBox ID="foo" runat="server" />--%>
<a class="goto-form-link goto-form-btn ir" href="#">Submit Your Video And Enter to Win a $2,500 Scholarship</a>
</div>
<!-- /#video-submissions -->
</div>
<!-- /#main -->
</div><!-- /.wrap -->
<div id="footer" class="clearfix">
<div class="wrap clearfix">
<p class="copyright">Copyright &copy; 2011 University Bound. All rights reserved.</p>
<ul class="nav nav-footer">
<li class="first"><a href="#">Privacy Policy</a></li>
<li><a href="#">Terms of Use</a></li>
<li><a href="#">Entry Rules</a></li>
</ul>
</div><!-- /.wrap -->
</div><!-- /#footer -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script> !window.jQuery && document.write('<script src="js/jquery-1.5.min.js"><\/script>')</script>
<script src="js/plugins.js?v=1"></script>
<script src="js/functions.js?v=1"></script>
<script src="js/jquery.maskedinput-1.2.2.min.js"></script>
<%--<script src="js/jquery.validationEngine.js"></script>
<script src="js/jquery.validationEngine-en.js"></script>--%>
<script src="js/scholarship-form.js"></script>
<!--[if lt IE 7 ]>
<script src="js/dd_belatedpng.js?v=1"></script>
<![endif]-->
<script>
/*
* UNCOMMENT AFTER ENTERING GA ACCOUNT CODE
*
var _gaq = [['_setAccount', 'UA-XXXXX-X'], ['_trackPageview']];
(function(d, t) {
var g = d.createElement(t), s = d.getElementsByTagName(t)[0];
g.async = true; g.src = '//www.google-analytics.com/ga.js'; s.parentNode.insertBefore(g, s);
})(document, 'script');
*/
</script>
</form>
</body>
</html>
/*
* jQuery Tools 1.2.5 - The missing UI library for the Web
*
* [tooltip, tooltip.slide, scrollable, scrollable.autoscroll, scrollable.navigator, overlay, overlay.apple, validator]
*
* NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
*
* http://flowplayer.org/tools/
*
* File generated: Mon Mar 21 14:41:24 GMT 2011
*/
(function(f){function p(a,b,c){var h=c.relative?a.position().top:a.offset().top,d=c.relative?a.position().left:a.offset().left,i=c.position[0];h-=b.outerHeight()-c.offset[0];d+=a.outerWidth()+c.offset[1];if(/iPad/i.test(navigator.userAgent))h-=f(window).scrollTop();var j=b.outerHeight()+a.outerHeight();if(i=="center")h+=j/2;if(i=="bottom")h+=j;i=c.position[1];a=b.outerWidth()+a.outerWidth();if(i=="center")d-=a/2;if(i=="left")d-=a;return{top:h,left:d}}function u(a,b){var c=this,h=a.add(c),d,i=0,j=
0,m=a.attr("title"),q=a.attr("data-tooltip"),r=o[b.effect],l,s=a.is(":input"),v=s&&a.is(":checkbox, :radio, select, :button, :submit"),t=a.attr("type"),k=b.events[t]||b.events[s?v?"widget":"input":"def"];if(!r)throw'Nonexistent effect "'+b.effect+'"';k=k.split(/,\s*/);if(k.length!=2)throw"Tooltip: bad events configuration for "+t;a.bind(k[0],function(e){clearTimeout(i);if(b.predelay)j=setTimeout(function(){c.show(e)},b.predelay);else c.show(e)}).bind(k[1],function(e){clearTimeout(j);if(b.delay)i=
setTimeout(function(){c.hide(e)},b.delay);else c.hide(e)});if(m&&b.cancelDefault){a.removeAttr("title");a.data("title",m)}f.extend(c,{show:function(e){if(!d){if(q)d=f(q);else if(b.tip)d=f(b.tip).eq(0);else if(m)d=f(b.layout).addClass(b.tipClass).appendTo(document.body).hide().append(m);else{d=a.next();d.length||(d=a.parent().next())}if(!d.length)throw"Cannot find tooltip for "+a;}if(c.isShown())return c;d.stop(true,true);var g=p(a,d,b);b.tip&&d.html(a.data("title"));e=e||f.Event();e.type="onBeforeShow";
h.trigger(e,[g]);if(e.isDefaultPrevented())return c;g=p(a,d,b);d.css({position:"absolute",top:g.top,left:g.left});l=true;r[0].call(c,function(){e.type="onShow";l="full";h.trigger(e)});g=b.events.tooltip.split(/,\s*/);if(!d.data("__set")){d.bind(g[0],function(){clearTimeout(i);clearTimeout(j)});g[1]&&!a.is("input:not(:checkbox, :radio), textarea")&&d.bind(g[1],function(n){n.relatedTarget!=a[0]&&a.trigger(k[1].split(" ")[0])});d.data("__set",true)}return c},hide:function(e){if(!d||!c.isShown())return c;
e=e||f.Event();e.type="onBeforeHide";h.trigger(e);if(!e.isDefaultPrevented()){l=false;o[b.effect][1].call(c,function(){e.type="onHide";h.trigger(e)});return c}},isShown:function(e){return e?l=="full":l},getConf:function(){return b},getTip:function(){return d},getTrigger:function(){return a}});f.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","),function(e,g){f.isFunction(b[g])&&f(c).bind(g,b[g]);c[g]=function(n){n&&f(c).bind(g,n);return c}})}f.tools=f.tools||{version:"1.2.5"};f.tools.tooltip=
{conf:{effect:"toggle",fadeOutSpeed:"fast",predelay:0,delay:30,opacity:1,tip:0,position:["top","center"],offset:[0,0],relative:false,cancelDefault:true,events:{def:"mouseenter,mouseleave",input:"focus,blur",widget:"focus mouseenter,blur mouseleave",tooltip:"mouseenter,mouseleave"},layout:"<div/>",tipClass:"tooltip"},addEffect:function(a,b,c){o[a]=[b,c]}};var o={toggle:[function(a){var b=this.getConf(),c=this.getTip();b=b.opacity;b<1&&c.css({opacity:b});c.show();a.call()},function(a){this.getTip().hide();
a.call()}],fade:[function(a){var b=this.getConf();this.getTip().fadeTo(b.fadeInSpeed,b.opacity,a)},function(a){this.getTip().fadeOut(this.getConf().fadeOutSpeed,a)}]};f.fn.tooltip=function(a){var b=this.data("tooltip");if(b)return b;a=f.extend(true,{},f.tools.tooltip.conf,a);if(typeof a.position=="string")a.position=a.position.split(/,?\s/);this.each(function(){b=new u(f(this),a);f(this).data("tooltip",b)});return a.api?b:this}})(jQuery);
(function(d){var i=d.tools.tooltip;d.extend(i.conf,{direction:"up",bounce:false,slideOffset:10,slideInSpeed:200,slideOutSpeed:200,slideFade:!d.browser.msie});var e={up:["-","top"],down:["+","top"],left:["-","left"],right:["+","left"]};i.addEffect("slide",function(g){var a=this.getConf(),f=this.getTip(),b=a.slideFade?{opacity:a.opacity}:{},c=e[a.direction]||e.up;b[c[1]]=c[0]+"="+a.slideOffset;a.slideFade&&f.css({opacity:0});f.show().animate(b,a.slideInSpeed,g)},function(g){var a=this.getConf(),f=a.slideOffset,
b=a.slideFade?{opacity:0}:{},c=e[a.direction]||e.up,h=""+c[0];if(a.bounce)h=h=="+"?"-":"+";b[c[1]]=h+"="+f;this.getTip().animate(b,a.slideOutSpeed,function(){d(this).hide();g.call()})})})(jQuery);
(function(e){function p(f,c){var b=e(c);return b.length<2?b:f.parent().find(c)}function u(f,c){var b=this,n=f.add(b),g=f.children(),l=0,j=c.vertical;k||(k=b);if(g.length>1)g=e(c.items,f);e.extend(b,{getConf:function(){return c},getIndex:function(){return l},getSize:function(){return b.getItems().size()},getNaviButtons:function(){return o.add(q)},getRoot:function(){return f},getItemWrap:function(){return g},getItems:function(){return g.children(c.item).not("."+c.clonedClass)},move:function(a,d){return b.seekTo(l+
a,d)},next:function(a){return b.move(1,a)},prev:function(a){return b.move(-1,a)},begin:function(a){return b.seekTo(0,a)},end:function(a){return b.seekTo(b.getSize()-1,a)},focus:function(){return k=b},addItem:function(a){a=e(a);if(c.circular){g.children("."+c.clonedClass+":last").before(a);g.children("."+c.clonedClass+":first").replaceWith(a.clone().addClass(c.clonedClass))}else g.append(a);n.trigger("onAddItem",[a]);return b},seekTo:function(a,d,h){a.jquery||(a*=1);if(c.circular&&a===0&&l==-1&&d!==
0)return b;if(!c.circular&&a<0||a>b.getSize()||a<-1)return b;var i=a;if(a.jquery)a=b.getItems().index(a);else i=b.getItems().eq(a);var r=e.Event("onBeforeSeek");if(!h){n.trigger(r,[a,d]);if(r.isDefaultPrevented()||!i.length)return b}i=j?{top:-i.position().top}:{left:-i.position().left};l=a;k=b;if(d===undefined)d=c.speed;g.animate(i,d,c.easing,h||function(){n.trigger("onSeek",[a])});return b}});e.each(["onBeforeSeek","onSeek","onAddItem"],function(a,d){e.isFunction(c[d])&&e(b).bind(d,c[d]);b[d]=function(h){h&&
e(b).bind(d,h);return b}});if(c.circular){var s=b.getItems().slice(-1).clone().prependTo(g),t=b.getItems().eq(1).clone().appendTo(g);s.add(t).addClass(c.clonedClass);b.onBeforeSeek(function(a,d,h){if(!a.isDefaultPrevented())if(d==-1){b.seekTo(s,h,function(){b.end(0)});return a.preventDefault()}else d==b.getSize()&&b.seekTo(t,h,function(){b.begin(0)})});b.seekTo(0,0,function(){})}var o=p(f,c.prev).click(function(){b.prev()}),q=p(f,c.next).click(function(){b.next()});if(!c.circular&&b.getSize()>1){b.onBeforeSeek(function(a,
d){setTimeout(function(){if(!a.isDefaultPrevented()){o.toggleClass(c.disabledClass,d<=0);q.toggleClass(c.disabledClass,d>=b.getSize()-1)}},1)});c.initialIndex||o.addClass(c.disabledClass)}c.mousewheel&&e.fn.mousewheel&&f.mousewheel(function(a,d){if(c.mousewheel){b.move(d<0?1:-1,c.wheelSpeed||50);return false}});if(c.touch){var m={};g[0].ontouchstart=function(a){a=a.touches[0];m.x=a.clientX;m.y=a.clientY};g[0].ontouchmove=function(a){if(a.touches.length==1&&!g.is(":animated")){var d=a.touches[0],h=
m.x-d.clientX;d=m.y-d.clientY;b[j&&d>0||!j&&h>0?"next":"prev"]();a.preventDefault()}}}c.keyboard&&e(document).bind("keydown.scrollable",function(a){if(!(!c.keyboard||a.altKey||a.ctrlKey||e(a.target).is(":input")))if(!(c.keyboard!="static"&&k!=b)){var d=a.keyCode;if(j&&(d==38||d==40)){b.move(d==38?-1:1);return a.preventDefault()}if(!j&&(d==37||d==39)){b.move(d==37?-1:1);return a.preventDefault()}}});c.initialIndex&&b.seekTo(c.initialIndex,0,function(){})}e.tools=e.tools||{version:"1.2.5"};e.tools.scrollable=
{conf:{activeClass:"active",circular:false,clonedClass:"cloned",disabledClass:"disabled",easing:"swing",initialIndex:0,item:null,items:".items",keyboard:true,mousewheel:false,next:".next",prev:".prev",speed:400,vertical:false,touch:true,wheelSpeed:0}};var k;e.fn.scrollable=function(f){var c=this.data("scrollable");if(c)return c;f=e.extend({},e.tools.scrollable.conf,f);this.each(function(){c=new u(e(this),f);e(this).data("scrollable",c)});return f.api?c:this}})(jQuery);
(function(b){var f=b.tools.scrollable;f.autoscroll={conf:{autoplay:true,interval:3E3,autopause:true}};b.fn.autoscroll=function(c){if(typeof c=="number")c={interval:c};var d=b.extend({},f.autoscroll.conf,c),g;this.each(function(){var a=b(this).data("scrollable");if(a)g=a;var e,h=true;a.play=function(){if(!e){h=false;e=setInterval(function(){a.next()},d.interval)}};a.pause=function(){e=clearInterval(e)};a.stop=function(){a.pause();h=true};d.autopause&&a.getRoot().add(a.getNaviButtons()).hover(a.pause,
a.play);d.autoplay&&a.play()});return d.api?g:this}})(jQuery);
(function(d){function p(b,g){var h=d(g);return h.length<2?h:b.parent().find(g)}var m=d.tools.scrollable;m.navigator={conf:{navi:".navi",naviItem:null,activeClass:"active",indexed:false,idPrefix:null,history:false}};d.fn.navigator=function(b){if(typeof b=="string")b={navi:b};b=d.extend({},m.navigator.conf,b);var g;this.each(function(){function h(a,c,i){e.seekTo(c);if(j){if(location.hash)location.hash=a.attr("href").replace("#","")}else return i.preventDefault()}function f(){return k.find(b.naviItem||
"> *")}function n(a){var c=d("<"+(b.naviItem||"a")+"/>").click(function(i){h(d(this),a,i)}).attr("href","#"+a);a===0&&c.addClass(l);b.indexed&&c.text(a+1);b.idPrefix&&c.attr("id",b.idPrefix+a);return c.appendTo(k)}function o(a,c){a=f().eq(c.replace("#",""));a.length||(a=f().filter("[href="+c+"]"));a.click()}var e=d(this).data("scrollable"),k=b.navi.jquery?b.navi:p(e.getRoot(),b.navi),q=e.getNaviButtons(),l=b.activeClass,j=b.history&&d.fn.history;if(e)g=e;e.getNaviButtons=function(){return q.add(k)};
f().length?f().each(function(a){d(this).click(function(c){h(d(this),a,c)})}):d.each(e.getItems(),function(a){n(a)});e.onBeforeSeek(function(a,c){setTimeout(function(){if(!a.isDefaultPrevented()){var i=f().eq(c);!a.isDefaultPrevented()&&i.length&&f().removeClass(l).eq(c).addClass(l)}},1)});e.onAddItem(function(a,c){c=n(e.getItems().index(c));j&&c.history(o)});j&&f().history(o)});return b.api?g:this}})(jQuery);
(function(a){function t(d,b){var c=this,j=d.add(c),o=a(window),k,f,m,g=a.tools.expose&&(b.mask||b.expose),n=Math.random().toString().slice(10);if(g){if(typeof g=="string")g={color:g};g.closeOnClick=g.closeOnEsc=false}var p=b.target||d.attr("rel");f=p?a(p):d;if(!f.length)throw"Could not find Overlay: "+p;d&&d.index(f)==-1&&d.click(function(e){c.load(e);return e.preventDefault()});a.extend(c,{load:function(e){if(c.isOpened())return c;var h=q[b.effect];if(!h)throw'Overlay: cannot find effect : "'+b.effect+
'"';b.oneInstance&&a.each(s,function(){this.close(e)});e=e||a.Event();e.type="onBeforeLoad";j.trigger(e);if(e.isDefaultPrevented())return c;m=true;g&&a(f).expose(g);var i=b.top,r=b.left,u=f.outerWidth({margin:true}),v=f.outerHeight({margin:true});if(typeof i=="string")i=i=="center"?Math.max((o.height()-v)/2,0):parseInt(i,10)/100*o.height();if(r=="center")r=Math.max((o.width()-u)/2,0);h[0].call(c,{top:i,left:r},function(){if(m){e.type="onLoad";j.trigger(e)}});g&&b.closeOnClick&&a.mask.getMask().one("click",
c.close);b.closeOnClick&&a(document).bind("click."+n,function(l){a(l.target).parents(f).length||c.close(l)});b.closeOnEsc&&a(document).bind("keydown."+n,function(l){l.keyCode==27&&c.close(l)});return c},close:function(e){if(!c.isOpened())return c;e=e||a.Event();e.type="onBeforeClose";j.trigger(e);if(!e.isDefaultPrevented()){m=false;q[b.effect][1].call(c,function(){e.type="onClose";j.trigger(e)});a(document).unbind("click."+n).unbind("keydown."+n);g&&a.mask.close();return c}},getOverlay:function(){return f},
getTrigger:function(){return d},getClosers:function(){return k},isOpened:function(){return m},getConf:function(){return b}});a.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","),function(e,h){a.isFunction(b[h])&&a(c).bind(h,b[h]);c[h]=function(i){i&&a(c).bind(h,i);return c}});k=f.find(b.close||".close");if(!k.length&&!b.close){k=a('<a class="close"></a>');f.prepend(k)}k.click(function(e){c.close(e)});b.load&&c.load()}a.tools=a.tools||{version:"1.2.5"};a.tools.overlay={addEffect:function(d,
b,c){q[d]=[b,c]},conf:{close:null,closeOnClick:true,closeOnEsc:true,closeSpeed:"fast",effect:"default",fixed:!a.browser.msie||a.browser.version>6,left:"center",load:false,mask:null,oneInstance:true,speed:"normal",target:null,top:"10%"}};var s=[],q={};a.tools.overlay.addEffect("default",function(d,b){var c=this.getConf(),j=a(window);if(!c.fixed){d.top+=j.scrollTop();d.left+=j.scrollLeft()}d.position=c.fixed?"fixed":"absolute";this.getOverlay().css(d).fadeIn(c.speed,b)},function(d){this.getOverlay().fadeOut(this.getConf().closeSpeed,
d)});a.fn.overlay=function(d){var b=this.data("overlay");if(b)return b;if(a.isFunction(d))d={onBeforeLoad:d};d=a.extend(true,{},a.tools.overlay.conf,d);this.each(function(){b=new t(a(this),d);s.push(b);a(this).data("overlay",b)});return d.api?b:this}})(jQuery);
(function(h){function k(d){var e=d.offset();return{top:e.top+d.height()/2,left:e.left+d.width()/2}}var l=h.tools.overlay,f=h(window);h.extend(l.conf,{start:{top:null,left:null},fadeInSpeed:"fast",zIndex:9999});function o(d,e){var a=this.getOverlay(),c=this.getConf(),g=this.getTrigger(),p=this,m=a.outerWidth({margin:true}),b=a.data("img"),n=c.fixed?"fixed":"absolute";if(!b){b=a.css("backgroundImage");if(!b)throw"background-image CSS property not set for overlay";b=b.slice(b.indexOf("(")+1,b.indexOf(")")).replace(/\"/g,
"");a.css("backgroundImage","none");b=h('<img src="'+b+'"/>');b.css({border:0,display:"none"}).width(m);h("body").append(b);a.data("img",b)}var i=c.start.top||Math.round(f.height()/2),j=c.start.left||Math.round(f.width()/2);if(g){g=k(g);i=g.top;j=g.left}if(c.fixed){i-=f.scrollTop();j-=f.scrollLeft()}else{d.top+=f.scrollTop();d.left+=f.scrollLeft()}b.css({position:"absolute",top:i,left:j,width:0,zIndex:c.zIndex}).show();d.position=n;a.css(d);b.animate({top:a.css("top"),left:a.css("left"),width:m},
c.speed,function(){a.css("zIndex",c.zIndex+1).fadeIn(c.fadeInSpeed,function(){p.isOpened()&&!h(this).index(a)?e.call():a.hide()})}).css("position",n)}function q(d){var e=this.getOverlay().hide(),a=this.getConf(),c=this.getTrigger();e=e.data("img");var g={top:a.start.top,left:a.start.left,width:0};c&&h.extend(g,k(c));a.fixed&&e.css({position:"absolute"}).animate({top:"+="+f.scrollTop(),left:"+="+f.scrollLeft()},0);e.animate(g,a.closeSpeed,d)}l.addEffect("apple",o,q)})(jQuery);
(function(e){function t(a,b,c){var k=a.offset().top,f=a.offset().left,l=c.position.split(/,?\s+/),p=l[0];l=l[1];k-=b.outerHeight()-c.offset[0];f+=a.outerWidth()+c.offset[1];if(/iPad/i.test(navigator.userAgent))k-=e(window).scrollTop();c=b.outerHeight()+a.outerHeight();if(p=="center")k+=c/2;if(p=="bottom")k+=c;a=a.outerWidth();if(l=="center")f-=(a+b.outerWidth())/2;if(l=="left")f-=a;return{top:k,left:f}}function y(a){function b(){return this.getAttribute("type")==a}b.key="[type="+a+"]";return b}function u(a,
b,c){function k(g,d,i){if(!(!c.grouped&&g.length)){var j;if(i===false||e.isArray(i)){j=h.messages[d.key||d]||h.messages["*"];j=j[c.lang]||h.messages["*"].en;(d=j.match(/\$\d/g))&&e.isArray(i)&&e.each(d,function(m){j=j.replace(this,i[m])})}else j=i[c.lang]||i;g.push(j)}}var f=this,l=b.add(f);a=a.not(":button, :image, :reset, :submit");e.extend(f,{getConf:function(){return c},getForm:function(){return b},getInputs:function(){return a},reflow:function(){a.each(function(){var g=e(this),d=g.data("msg.el");
if(d){g=t(g,d,c);d.css({top:g.top,left:g.left})}});return f},invalidate:function(g,d){if(!d){var i=[];e.each(g,function(j,m){j=a.filter("[name='"+j+"']");if(j.length){j.trigger("OI",[m]);i.push({input:j,messages:[m]})}});g=i;d=e.Event()}d.type="onFail";l.trigger(d,[g]);d.isDefaultPrevented()||q[c.effect][0].call(f,g,d);return f},reset:function(g){g=g||a;g.removeClass(c.errorClass).each(function(){var d=e(this).data("msg.el");if(d){d.remove();e(this).data("msg.el",null)}}).unbind(c.errorInputEvent||
"");return f},destroy:function(){b.unbind(c.formEvent+".V").unbind("reset.V");a.unbind(c.inputEvent+".V").unbind("change.V");return f.reset()},checkValidity:function(g,d){g=g||a;g=g.not(":disabled");if(!g.length)return true;d=d||e.Event();d.type="onBeforeValidate";l.trigger(d,[g]);if(d.isDefaultPrevented())return d.result;var i=[];g.not(":radio:not(:checked)").each(function(){var m=[],n=e(this).data("messages",m),v=r&&n.is(":date")?"onHide.v":c.errorInputEvent+".v";n.unbind(v);e.each(w,function(){var o=
this,s=o[0];if(n.filter(s).length){o=o[1].call(f,n,n.val());if(o!==true){d.type="onBeforeFail";l.trigger(d,[n,s]);if(d.isDefaultPrevented())return false;var x=n.attr(c.messageAttr);if(x){m=[x];return false}else k(m,s,o)}}});if(m.length){i.push({input:n,messages:m});n.trigger("OI",[m]);c.errorInputEvent&&n.bind(v,function(o){f.checkValidity(n,o)})}if(c.singleError&&i.length)return false});var j=q[c.effect];if(!j)throw'Validator: cannot find effect "'+c.effect+'"';if(i.length){f.invalidate(i,d);return false}else{j[1].call(f,
g,d);d.type="onSuccess";l.trigger(d,[g]);g.unbind(c.errorInputEvent+".v")}return true}});e.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","),function(g,d){e.isFunction(c[d])&&e(f).bind(d,c[d]);f[d]=function(i){i&&e(f).bind(d,i);return f}});c.formEvent&&b.bind(c.formEvent+".V",function(g){if(!f.checkValidity(null,g))return g.preventDefault()});b.bind("reset.V",function(){f.reset()});a[0]&&a[0].validity&&a.each(function(){this.oninvalid=function(){return false}});if(b[0])b[0].checkValidity=
f.checkValidity;c.inputEvent&&a.bind(c.inputEvent+".V",function(g){f.checkValidity(e(this),g)});a.filter(":checkbox, select").filter("[required]").bind("change.V",function(g){var d=e(this);if(this.checked||d.is("select")&&e(this).val())q[c.effect][1].call(f,d,g)});var p=a.filter(":radio").change(function(g){f.checkValidity(p,g)});e(window).resize(function(){f.reflow()})}e.tools=e.tools||{version:"1.2.5"};var z=/\[type=([a-z]+)\]/,A=/^-?[0-9]*(\.[0-9]+)?$/,r=e.tools.dateinput,B=/^([a-z0-9_\.\-\+]+)@([\da-z\.\-]+)\.([a-z\.]{2,6})$/i,
C=/^(https?:\/\/)?[\da-z\.\-]+\.[a-z\.]{2,6}[#&+_\?\/\w \.\-=]*$/i,h;h=e.tools.validator={conf:{grouped:false,effect:"default",errorClass:"invalid",inputEvent:null,errorInputEvent:"keyup",formEvent:"submit",lang:"en",message:"<div/>",messageAttr:"data-message",messageClass:"error",offset:[0,0],position:"center right",singleError:false,speed:"normal"},messages:{"*":{en:"Please correct this value"}},localize:function(a,b){e.each(b,function(c,k){h.messages[c]=h.messages[c]||{};h.messages[c][a]=k})},
localizeFn:function(a,b){h.messages[a]=h.messages[a]||{};e.extend(h.messages[a],b)},fn:function(a,b,c){if(e.isFunction(b))c=b;else{if(typeof b=="string")b={en:b};this.messages[a.key||a]=b}if(b=z.exec(a))a=y(b[1]);w.push([a,c])},addEffect:function(a,b,c){q[a]=[b,c]}};var w=[],q={"default":[function(a){var b=this.getConf();e.each(a,function(c,k){c=k.input;c.addClass(b.errorClass);var f=c.data("msg.el");if(!f){f=e(b.message).addClass(b.messageClass).appendTo(document.body);c.data("msg.el",f)}f.css({visibility:"hidden"}).find("p").remove();
e.each(k.messages,function(l,p){e("<p/>").html(p).appendTo(f)});f.outerWidth()==f.parent().width()&&f.add(f.find("p")).css({display:"inline"});k=t(c,f,b);f.css({visibility:"visible",position:"absolute",top:k.top,left:k.left}).fadeIn(b.speed)})},function(a){var b=this.getConf();a.removeClass(b.errorClass).each(function(){var c=e(this).data("msg.el");c&&c.css({visibility:"hidden"})})}]};e.each("email,url,number".split(","),function(a,b){e.expr[":"][b]=function(c){return c.getAttribute("type")===b}});
e.fn.oninvalid=function(a){return this[a?"bind":"trigger"]("OI",a)};h.fn(":email","Please enter a valid email address",function(a,b){return!b||B.test(b)});h.fn(":url","Please enter a valid URL",function(a,b){return!b||C.test(b)});h.fn(":number","Please enter a numeric value.",function(a,b){return A.test(b)});h.fn("[max]","Please enter a value smaller than $1",function(a,b){if(b===""||r&&a.is(":date"))return true;a=a.attr("max");return parseFloat(b)<=parseFloat(a)?true:[a]});h.fn("[min]","Please enter a value larger than $1",
function(a,b){if(b===""||r&&a.is(":date"))return true;a=a.attr("min");return parseFloat(b)>=parseFloat(a)?true:[a]});h.fn("[required]","Please complete this mandatory field.",function(a,b){if(a.is(":checkbox"))return a.is(":checked");return!!b});h.fn("[pattern]",function(a){var b=new RegExp("^"+a.attr("pattern")+"$");return b.test(a.val())});e.fn.validator=function(a){var b=this.data("validator");if(b){b.destroy();this.removeData("validator")}a=e.extend(true,{},h.conf,a);if(this.is("form"))return this.each(function(){var c=
e(this);b=new u(c.find(":input"),c,a);c.data("validator",b)});else{b=new u(this,this.eq(0).closest("form"),a);return this.data("validator",b)}}})(jQuery);
//-------------------------------------------------
// youtube playlist jquery plugin
// Created by [email protected]
// www.geckonewmedia.com
//
// v1.1 - updated to allow fullscreen
// - thanks Ashraf for the request
//-------------------------------------------------
//-------------------------------------------------
// youtube playlist jquery plugin
// Created by [email protected]
// www.geckonewmedia.com
//
// v1.1 - updated to allow fullscreen
// - thanks Ashraf for the request
//-------------------------------------------------
//jQuery.fn.ytplaylist = function (options) {
// // default settings
// var options = jQuery.extend({
// holderId: 'ytvideo',
// playerHeight: '300',
// playerWidth: '450',
// addThumbs: false,
// thumbSize: 'small',
// showInline: false,
// autoPlay: true,
// showRelated: true,
// allowFullScreen: false
// }, options);
// return this.each(function () {
// var selector = $(this);
// var autoPlay = "";
// var showRelated = "&rel=0";
// var fullScreen = "";
// if (options.autoPlay) autoPlay = "&autoplay=1";
// if (options.showRelated) showRelated = "&rel=1";
// if (options.allowFullScreen) fullScreen = "&fs=1";
// //throw a youtube player in
// function play(id) {
// var html = '';
// html += '<object height="' + options.playerHeight + '" width="' + options.playerWidth + '">';
// html += '<param name="movie" value="http://www.youtube.com/v/' + id + autoPlay + showRelated + fullScreen + '"> </param>';
// html += '<param name="wmode" value="transparent"> </param>';
// if (options.allowFullScreen) {
// html += '<param name="allowfullscreen" value="true"> </param>';
// }
// html += '<embed src="http://www.youtube.com/v/' + id + autoPlay + showRelated + fullScreen + '"';
// if (options.allowFullScreen) {
// html += ' allowfullscreen="true" ';
// }
// html += 'type="application/x-shockwave-flash" wmode="transparent" height="' + options.playerHeight + '" width="' + options.playerWidth + '"></embed>';
// html += '</object>';
// html += '<p>Vote for this video by pressing the "like" button below:</p>';
//
// html += '<iframe src="http://www.facebook.com/plugins/like.php?href=http://www.youtube.com/v/' + id +'&amp;layout=button_count&amp;show_faces=true&amp;width=430&amp;action=like&amp;font&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; color: #fff; width:450px; height:21px;" allowTransparency="true"></iframe>';
//
// html += '<!-- AddThis Button BEGIN -->'
// html += '<p class="addthis_toolbox addthis_default_style ">'
// html += '<a href="http://www.addthis.com/bookmark.php?v=250&amp;pubid=xa-4d89033227e362df" addthis:url="href=http://www.youtube.com/v/' + id + '" addthis:title="University Bound Scholarship Video Submission" class="addthis_button_compact">Share</a>'
// html += '<span class="addthis_separator">|</span>'
// html += '<a class="addthis_button_preferred_1" addthis:url="href=http://www.youtube.com/v/' + id + '"></a>'
// html += '<a class="addthis_button_preferred_2" addthis:url="href=http://www.youtube.com/v/' + id + '"></a>'
// html += '<a class="addthis_button_preferred_3" addthis:url="href=http://www.youtube.com/v/' + id + '"></a>'
// html += '</p><script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4d89033227e362df"></script>'
// html += '<!-- AddThis Button END -->'
// return html;
// };
// //grab a youtube id from a (clean, no querystring) url (thanks to http://jquery-howto.blogspot.com/2009/05/jyoutube-jquery-youtube-thumbnail.html)
// function youtubeid(url) {
// var ytid = url.match("[\\?&]v=([^&#]*)");
// ytid = ytid[1];
// return ytid;
// };
// //load inital video
// var firstVid = selector.children("li:first-child").addClass("currentvideo").children("a").attr("href");
// $("#" + options.holderId + "").html(play(youtubeid(firstVid)));
// //load video on request
// selector.children("li").children("a").click(function () {
// if (options.showInline) {
// $("li.currentvideo").removeClass("currentvideo");
// $(this).parent("li").addClass("currentvideo").html(play(youtubeid($(this).attr("href"))));
// } else {
// $("#" + options.holderId + "").html(play(youtubeid($(this).attr("href"))));
// $(this).parent().parent("ul").find("li.currentvideo").removeClass("currentvideo");
// $(this).parent("li").addClass("currentvideo");
// }
//
// return false;
// });
// //do we want thumns with that?
// if (options.addThumbs) {
// selector.children().each(function (i) {
// var replacedText = $(this).text();
// if (options.thumbSize == 'small') {
// var thumbUrl = "http://img.youtube.com/vi/" + youtubeid($(this).children("a").attr("href")) + "/2.jpg";
// } else {
// var thumbUrl = "http://img.youtube.com/vi/" + youtubeid($(this).children("a").attr("href")) + "/0.jpg";
// }
// $(this).children("a").empty().html("<img src='" + thumbUrl + "' alt='" + replacedText + "' />" + replacedText).attr("title", replacedText);
// });
// }
// });
//};
/**
* jQuery Validation Plugin 1.8.0
*
* http://bassistance.de/jquery-plugins/jquery-plugin-validation/
* http://docs.jquery.com/Plugins/Validation
*
* Copyright (c) 2006 - 2011 Jörn Zaefferer
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
(function (c) {
c.extend(c.fn, { validate: function (a) {
if (this.length) {
var b = c.data(this[0], "validator"); if (b) return b; b = new c.validator(a, this[0]); c.data(this[0], "validator", b); if (b.settings.onsubmit) {
this.find("input, button").filter(".cancel").click(function () { b.cancelSubmit = true }); b.settings.submitHandler && this.find("input, button").filter(":submit").click(function () { b.submitButton = this }); this.submit(function (d) {
function e() {
if (b.settings.submitHandler) {
if (b.submitButton) var f = c("<input type='hidden'/>").attr("name",
b.submitButton.name).val(b.submitButton.value).appendTo(b.currentForm); b.settings.submitHandler.call(b, b.currentForm); b.submitButton && f.remove(); return false
} return true
} b.settings.debug && d.preventDefault(); if (b.cancelSubmit) { b.cancelSubmit = false; return e() } if (b.form()) { if (b.pendingRequest) { b.formSubmitted = true; return false } return e() } else { b.focusInvalid(); return false }
})
} return b
} else a && a.debug && window.console && console.warn("nothing selected, can't validate, returning nothing")
}, valid: function () {
if (c(this[0]).is("form")) return this.validate().form();
else { var a = true, b = c(this[0].form).validate(); this.each(function () { a &= b.element(this) }); return a }
}, removeAttrs: function (a) { var b = {}, d = this; c.each(a.split(/\s/), function (e, f) { b[f] = d.attr(f); d.removeAttr(f) }); return b }, rules: function (a, b) {
var d = this[0]; if (a) {
var e = c.data(d.form, "validator").settings, f = e.rules, g = c.validator.staticRules(d); switch (a) {
case "add": c.extend(g, c.validator.normalizeRule(b)); f[d.name] = g; if (b.messages) e.messages[d.name] = c.extend(e.messages[d.name], b.messages); break; case "remove": if (!b) {
delete f[d.name];
return g
} var h = {}; c.each(b.split(/\s/), function (j, i) { h[i] = g[i]; delete g[i] }); return h
}
} d = c.validator.normalizeRules(c.extend({}, c.validator.metadataRules(d), c.validator.classRules(d), c.validator.attributeRules(d), c.validator.staticRules(d)), d); if (d.required) { e = d.required; delete d.required; d = c.extend({ required: e }, d) } return d
}
}); c.extend(c.expr[":"], { blank: function (a) { return !c.trim("" + a.value) }, filled: function (a) { return !!c.trim("" + a.value) }, unchecked: function (a) { return !a.checked } }); c.validator = function (a,
b) { this.settings = c.extend(true, {}, c.validator.defaults, a); this.currentForm = b; this.init() }; c.validator.format = function (a, b) { if (arguments.length == 1) return function () { var d = c.makeArray(arguments); d.unshift(a); return c.validator.format.apply(this, d) }; if (arguments.length > 2 && b.constructor != Array) b = c.makeArray(arguments).slice(1); if (b.constructor != Array) b = [b]; c.each(b, function (d, e) { a = a.replace(RegExp("\\{" + d + "\\}", "g"), e) }); return a }; c.extend(c.validator, { defaults: { messages: {}, groups: {}, rules: {}, errorClass: "error",
validClass: "valid", errorElement: "label", focusInvalid: true, errorContainer: c([]), errorLabelContainer: c([]), onsubmit: true, ignore: [], ignoreTitle: false, onfocusin: function (a) { this.lastActive = a; if (this.settings.focusCleanup && !this.blockFocusCleanup) { this.settings.unhighlight && this.settings.unhighlight.call(this, a, this.settings.errorClass, this.settings.validClass); this.addWrapper(this.errorsFor(a)).hide() } }, onfocusout: function (a) { if (!this.checkable(a) && (a.name in this.submitted || !this.optional(a))) this.element(a) },
onkeyup: function (a) { if (a.name in this.submitted || a == this.lastElement) this.element(a) }, onclick: function (a) { if (a.name in this.submitted) this.element(a); else a.parentNode.name in this.submitted && this.element(a.parentNode) }, highlight: function (a, b, d) { c(a).addClass(b).removeClass(d) }, unhighlight: function (a, b, d) { c(a).removeClass(b).addClass(d) }
}, setDefaults: function (a) { c.extend(c.validator.defaults, a) }, messages: { required: "This field is required.", remote: "Please fix this field.", email: "Please enter a valid email address.",
url: "Please enter a valid URL.", date: "Please enter a valid date.", dateISO: "Please enter a valid date (ISO).", number: "Please enter a valid number.", digits: "Please enter only digits.", creditcard: "Please enter a valid credit card number.", equalTo: "Please enter the same value again.", accept: "Please enter a value with a valid extension.", maxlength: c.validator.format("Please enter no more than {0} characters."), minlength: c.validator.format("Please enter at least {0} characters."), rangelength: c.validator.format("Please enter a value between {0} and {1} characters long."),
range: c.validator.format("Please enter a value between {0} and {1}."), max: c.validator.format("Please enter a value less than or equal to {0}."), min: c.validator.format("Please enter a value greater than or equal to {0}.")
}, autoCreateRanges: false, prototype: { init: function () {
function a(e) { var f = c.data(this[0].form, "validator"); e = "on" + e.type.replace(/^validate/, ""); f.settings[e] && f.settings[e].call(f, this[0]) } this.labelContainer = c(this.settings.errorLabelContainer); this.errorContext = this.labelContainer.length &&
this.labelContainer || c(this.currentForm); this.containers = c(this.settings.errorContainer).add(this.settings.errorLabelContainer); this.submitted = {}; this.valueCache = {}; this.pendingRequest = 0; this.pending = {}; this.invalid = {}; this.reset(); var b = this.groups = {}; c.each(this.settings.groups, function (e, f) { c.each(f.split(/\s/), function (g, h) { b[h] = e }) }); var d = this.settings.rules; c.each(d, function (e, f) { d[e] = c.validator.normalizeRule(f) }); c(this.currentForm).validateDelegate(":text, :password, :file, select, textarea",
"focusin focusout keyup", a).validateDelegate(":radio, :checkbox, select, option", "click", a); this.settings.invalidHandler && c(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler)
}, form: function () { this.checkForm(); c.extend(this.submitted, this.errorMap); this.invalid = c.extend({}, this.errorMap); this.valid() || c(this.currentForm).triggerHandler("invalid-form", [this]); this.showErrors(); return this.valid() }, checkForm: function () {
this.prepareForm(); for (var a = 0, b = this.currentElements = this.elements(); b[a]; a++) this.check(b[a]);
return this.valid()
}, element: function (a) { this.lastElement = a = this.clean(a); this.prepareElement(a); this.currentElements = c(a); var b = this.check(a); if (b) delete this.invalid[a.name]; else this.invalid[a.name] = true; if (!this.numberOfInvalids()) this.toHide = this.toHide.add(this.containers); this.showErrors(); return b }, showErrors: function (a) {
if (a) {
c.extend(this.errorMap, a); this.errorList = []; for (var b in a) this.errorList.push({ message: a[b], element: this.findByName(b)[0] }); this.successList = c.grep(this.successList,
function (d) { return !(d.name in a) })
} this.settings.showErrors ? this.settings.showErrors.call(this, this.errorMap, this.errorList) : this.defaultShowErrors()
}, resetForm: function () { c.fn.resetForm && c(this.currentForm).resetForm(); this.submitted = {}; this.prepareForm(); this.hideErrors(); this.elements().removeClass(this.settings.errorClass) }, numberOfInvalids: function () { return this.objectLength(this.invalid) }, objectLength: function (a) { var b = 0, d; for (d in a) b++; return b }, hideErrors: function () { this.addWrapper(this.toHide).hide() },
valid: function () { return this.size() == 0 }, size: function () { return this.errorList.length }, focusInvalid: function () { if (this.settings.focusInvalid) try { c(this.findLastActive() || this.errorList.length && this.errorList[0].element || []).filter(":visible").focus().trigger("focusin") } catch (a) { } }, findLastActive: function () { var a = this.lastActive; return a && c.grep(this.errorList, function (b) { return b.element.name == a.name }).length == 1 && a }, elements: function () {
var a = this, b = {}; return c([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function () {
!this.name &&
a.settings.debug && window.console && console.error("%o has no name assigned", this); if (this.name in b || !a.objectLength(c(this).rules())) return false; return b[this.name] = true
})
}, clean: function (a) { return c(a)[0] }, errors: function () { return c(this.settings.errorElement + "." + this.settings.errorClass, this.errorContext) }, reset: function () { this.successList = []; this.errorList = []; this.errorMap = {}; this.toShow = c([]); this.toHide = c([]); this.currentElements = c([]) }, prepareForm: function () { this.reset(); this.toHide = this.errors().add(this.containers) },
prepareElement: function (a) { this.reset(); this.toHide = this.errorsFor(a) }, check: function (a) {
a = this.clean(a); if (this.checkable(a)) a = this.findByName(a.name).not(this.settings.ignore)[0]; var b = c(a).rules(), d = false, e; for (e in b) {
var f = { method: e, parameters: b[e] }; try { var g = c.validator.methods[e].call(this, a.value.replace(/\r/g, ""), a, f.parameters); if (g == "dependency-mismatch") d = true; else { d = false; if (g == "pending") { this.toHide = this.toHide.not(this.errorsFor(a)); return } if (!g) { this.formatAndAdd(a, f); return false } } } catch (h) {
this.settings.debug &&
window.console && console.log("exception occured when checking element " + a.id + ", check the '" + f.method + "' method", h); throw h;
}
} if (!d) { this.objectLength(b) && this.successList.push(a); return true }
}, customMetaMessage: function (a, b) { if (c.metadata) { var d = this.settings.meta ? c(a).metadata()[this.settings.meta] : c(a).metadata(); return d && d.messages && d.messages[b] } }, customMessage: function (a, b) { var d = this.settings.messages[a]; return d && (d.constructor == String ? d : d[b]) }, findDefined: function () {
for (var a = 0; a < arguments.length; a++) if (arguments[a] !==
undefined) return arguments[a]
}, defaultMessage: function (a, b) { return this.findDefined(this.customMessage(a.name, b), this.customMetaMessage(a, b), !this.settings.ignoreTitle && a.title || undefined, c.validator.messages[b], "<strong>Warning: No message defined for " + a.name + "</strong>") }, formatAndAdd: function (a, b) {
var d = this.defaultMessage(a, b.method), e = /\$?\{(\d+)\}/g; if (typeof d == "function") d = d.call(this, b.parameters, a); else if (e.test(d)) d = jQuery.format(d.replace(e, "{$1}"), b.parameters); this.errorList.push({ message: d,
element: a
}); this.errorMap[a.name] = d; this.submitted[a.name] = d
}, addWrapper: function (a) { if (this.settings.wrapper) a = a.add(a.parent(this.settings.wrapper)); return a }, defaultShowErrors: function () {
for (var a = 0; this.errorList[a]; a++) { var b = this.errorList[a]; this.settings.highlight && this.settings.highlight.call(this, b.element, this.settings.errorClass, this.settings.validClass); this.showLabel(b.element, b.message) } if (this.errorList.length) this.toShow = this.toShow.add(this.containers); if (this.settings.success) for (a =
0; this.successList[a]; a++) this.showLabel(this.successList[a]); if (this.settings.unhighlight) { a = 0; for (b = this.validElements(); b[a]; a++) this.settings.unhighlight.call(this, b[a], this.settings.errorClass, this.settings.validClass) } this.toHide = this.toHide.not(this.toShow); this.hideErrors(); this.addWrapper(this.toShow).show()
}, validElements: function () { return this.currentElements.not(this.invalidElements()) }, invalidElements: function () { return c(this.errorList).map(function () { return this.element }) }, showLabel: function (a,
b) {
var d = this.errorsFor(a); if (d.length) { d.removeClass().addClass(this.settings.errorClass); d.attr("generated") && d.html(b) } else { d = c("<" + this.settings.errorElement + "/>").attr({ "for": this.idOrName(a), generated: true }).addClass(this.settings.errorClass).html(b || ""); if (this.settings.wrapper) d = d.hide().show().wrap("<" + this.settings.wrapper + "/>").parent(); this.labelContainer.append(d).length || (this.settings.errorPlacement ? this.settings.errorPlacement(d, c(a)) : d.insertAfter(a)) } if (!b && this.settings.success) {
d.text("");
typeof this.settings.success == "string" ? d.addClass(this.settings.success) : this.settings.success(d)
} this.toShow = this.toShow.add(d)
}, errorsFor: function (a) { var b = this.idOrName(a); return this.errors().filter(function () { return c(this).attr("for") == b }) }, idOrName: function (a) { return this.groups[a.name] || (this.checkable(a) ? a.name : a.id || a.name) }, checkable: function (a) { return /radio|checkbox/i.test(a.type) }, findByName: function (a) {
var b = this.currentForm; return c(document.getElementsByName(a)).map(function (d, e) {
return e.form ==
b && e.name == a && e || null
})
}, getLength: function (a, b) { switch (b.nodeName.toLowerCase()) { case "select": return c("option:selected", b).length; case "input": if (this.checkable(b)) return this.findByName(b.name).filter(":checked").length } return a.length }, depend: function (a, b) { return this.dependTypes[typeof a] ? this.dependTypes[typeof a](a, b) : true }, dependTypes: { "boolean": function (a) { return a }, string: function (a, b) { return !!c(a, b.form).length }, "function": function (a, b) { return a(b) } }, optional: function (a) {
return !c.validator.methods.required.call(this,
c.trim(a.value), a) && "dependency-mismatch"
}, startRequest: function (a) { if (!this.pending[a.name]) { this.pendingRequest++; this.pending[a.name] = true } }, stopRequest: function (a, b) {
this.pendingRequest--; if (this.pendingRequest < 0) this.pendingRequest = 0; delete this.pending[a.name]; if (b && this.pendingRequest == 0 && this.formSubmitted && this.form()) { c(this.currentForm).submit(); this.formSubmitted = false } else if (!b && this.pendingRequest == 0 && this.formSubmitted) {
c(this.currentForm).triggerHandler("invalid-form", [this]); this.formSubmitted =
false
}
}, previousValue: function (a) { return c.data(a, "previousValue") || c.data(a, "previousValue", { old: null, valid: true, message: this.defaultMessage(a, "remote") }) }
}, classRuleSettings: { required: { required: true }, email: { email: true }, url: { url: true }, date: { date: true }, dateISO: { dateISO: true }, dateDE: { dateDE: true }, number: { number: true }, numberDE: { numberDE: true }, digits: { digits: true }, creditcard: { creditcard: true} }, addClassRules: function (a, b) {
a.constructor == String ? this.classRuleSettings[a] = b : c.extend(this.classRuleSettings,
a)
}, classRules: function (a) { var b = {}; (a = c(a).attr("class")) && c.each(a.split(" "), function () { this in c.validator.classRuleSettings && c.extend(b, c.validator.classRuleSettings[this]) }); return b }, attributeRules: function (a) { var b = {}; a = c(a); for (var d in c.validator.methods) { var e = a.attr(d); if (e) b[d] = e } b.maxlength && /-1|2147483647|524288/.test(b.maxlength) && delete b.maxlength; return b }, metadataRules: function (a) {
if (!c.metadata) return {}; var b = c.data(a.form, "validator").settings.meta; return b ? c(a).metadata()[b] :
c(a).metadata()
}, staticRules: function (a) { var b = {}, d = c.data(a.form, "validator"); if (d.settings.rules) b = c.validator.normalizeRule(d.settings.rules[a.name]) || {}; return b }, normalizeRules: function (a, b) {
c.each(a, function (d, e) { if (e === false) delete a[d]; else if (e.param || e.depends) { var f = true; switch (typeof e.depends) { case "string": f = !!c(e.depends, b.form).length; break; case "function": f = e.depends.call(b, b) } if (f) a[d] = e.param !== undefined ? e.param : true; else delete a[d] } }); c.each(a, function (d, e) {
a[d] = c.isFunction(e) ?
e(b) : e
}); c.each(["minlength", "maxlength", "min", "max"], function () { if (a[this]) a[this] = Number(a[this]) }); c.each(["rangelength", "range"], function () { if (a[this]) a[this] = [Number(a[this][0]), Number(a[this][1])] }); if (c.validator.autoCreateRanges) { if (a.min && a.max) { a.range = [a.min, a.max]; delete a.min; delete a.max } if (a.minlength && a.maxlength) { a.rangelength = [a.minlength, a.maxlength]; delete a.minlength; delete a.maxlength } } a.messages && delete a.messages; return a
}, normalizeRule: function (a) {
if (typeof a == "string") {
var b =
{}; c.each(a.split(/\s/), function () { b[this] = true }); a = b
} return a
}, addMethod: function (a, b, d) { c.validator.methods[a] = b; c.validator.messages[a] = d != undefined ? d : c.validator.messages[a]; b.length < 3 && c.validator.addClassRules(a, c.validator.normalizeRule(a)) }, methods: { required: function (a, b, d) {
if (!this.depend(d, b)) return "dependency-mismatch"; switch (b.nodeName.toLowerCase()) {
case "select": return (a = c(b).val()) && a.length > 0; case "input": if (this.checkable(b)) return this.getLength(a, b) > 0; default: return c.trim(a).length >
0
}
}, remote: function (a, b, d) {
if (this.optional(b)) return "dependency-mismatch"; var e = this.previousValue(b); this.settings.messages[b.name] || (this.settings.messages[b.name] = {}); e.originalMessage = this.settings.messages[b.name].remote; this.settings.messages[b.name].remote = e.message; d = typeof d == "string" && { url: d} || d; if (this.pending[b.name]) return "pending"; if (e.old === a) return e.valid; e.old = a; var f = this; this.startRequest(b); var g = {}; g[b.name] = a; c.ajax(c.extend(true, { url: d, mode: "abort", port: "validate" + b.name,
dataType: "json", data: g, success: function (h) { f.settings.messages[b.name].remote = e.originalMessage; var j = h === true; if (j) { var i = f.formSubmitted; f.prepareElement(b); f.formSubmitted = i; f.successList.push(b); f.showErrors() } else { i = {}; h = h || f.defaultMessage(b, "remote"); i[b.name] = e.message = c.isFunction(h) ? h(a) : h; f.showErrors(i) } e.valid = j; f.stopRequest(b, j) }
}, d)); return "pending"
}, minlength: function (a, b, d) { return this.optional(b) || this.getLength(c.trim(a), b) >= d }, maxlength: function (a, b, d) {
return this.optional(b) ||
this.getLength(c.trim(a), b) <= d
}, rangelength: function (a, b, d) { a = this.getLength(c.trim(a), b); return this.optional(b) || a >= d[0] && a <= d[1] }, min: function (a, b, d) { return this.optional(b) || a >= d }, max: function (a, b, d) { return this.optional(b) || a <= d }, range: function (a, b, d) { return this.optional(b) || a >= d[0] && a <= d[1] }, email: function (a, b) { return this.optional(b) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(a) },
url: function (a, b) { return this.optional(b) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a) },
date: function (a, b) { return this.optional(b) || !/Invalid|NaN/.test(new Date(a)) }, dateISO: function (a, b) { return this.optional(b) || /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(a) }, number: function (a, b) { return this.optional(b) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(a) }, digits: function (a, b) { return this.optional(b) || /^\d+$/.test(a) }, creditcard: function (a, b) {
if (this.optional(b)) return "dependency-mismatch"; if (/[^0-9-]+/.test(a)) return false; var d = 0, e = 0, f = false; a = a.replace(/\D/g, ""); for (var g = a.length - 1; g >=
0; g--) { e = a.charAt(g); e = parseInt(e, 10); if (f) if ((e *= 2) > 9) e -= 9; d += e; f = !f } return d % 10 == 0
}, accept: function (a, b, d) { d = typeof d == "string" ? d.replace(/,/g, "|") : "png|jpe?g|gif"; return this.optional(b) || a.match(RegExp(".(" + d + ")$", "i")) }, equalTo: function (a, b, d) { d = c(d).unbind(".validate-equalTo").bind("blur.validate-equalTo", function () { c(b).valid() }); return a == d.val() }
}
}); c.format = c.validator.format
})(jQuery);
(function (c) { var a = {}; if (c.ajaxPrefilter) c.ajaxPrefilter(function (d, e, f) { e = d.port; if (d.mode == "abort") { a[e] && a[e].abort(); a[e] = f } }); else { var b = c.ajax; c.ajax = function (d) { var e = ("port" in d ? d : c.ajaxSettings).port; if (("mode" in d ? d : c.ajaxSettings).mode == "abort") { a[e] && a[e].abort(); return a[e] = b.apply(this, arguments) } return b.apply(this, arguments) } } })(jQuery);
(function (c) {
!jQuery.event.special.focusin && !jQuery.event.special.focusout && document.addEventListener && c.each({ focus: "focusin", blur: "focusout" }, function (a, b) { function d(e) { e = c.event.fix(e); e.type = b; return c.event.handle.call(this, e) } c.event.special[b] = { setup: function () { this.addEventListener(a, d, true) }, teardown: function () { this.removeEventListener(a, d, true) }, handler: function (e) { arguments[0] = c.event.fix(e); arguments[0].type = b; return c.event.handle.apply(this, arguments) } } }); c.extend(c.fn, { validateDelegate: function (a,
b, d) { return this.bind(b, function (e) { var f = c(e.target); if (f.is(a)) return d.apply(f, arguments) }) }
})
})(jQuery);
$(document).ready(function () {
//Stop form submission with the enter key
$("form").bind("keypress", function (e) {
var c = e.which ? e.which : e.keyCode;
if (c == 13) {
return false;
}
});
var v = $("form").validate({
errorClass: "warning",
onkeyup: false,
onblur: false,
focusInvalid: true
});
$(".submit").click(function () {
if (v.form())
return true;
else
return false
});
// setup the form masking
$(".Phone").mask("(999) 999-9999");
$('.Zip').mask("99999");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment