1 function setContainerMinHeight( applicableDiv){
\r
3 if ( $(applicableDiv).length > 0 ) {
\r
4 //var h = $('.header').height(); div.header is not found
\r
5 var f = $('.footer').height();
\r
6 var w = $(window).height();
\r
7 var pTop = parseInt (($(applicableDiv).css('padding-top').replace("px", "")) );
\r
8 var pBottom = parseInt (($(applicableDiv).css('padding-bottom').replace("px", "")));
\r
10 var c = w - ( f+pTop+pBottom+36);//36 is header's height.
\r
11 $(applicableDiv).css('min-height', c);
\r
20 $.fn.equalHeights = function(minHeight, maxHeight) {
\r
21 tallest = (minHeight) ? minHeight : 0;
\r
22 this.each(function() {
\r
23 if($(this).height() > tallest) {
\r
24 tallest = $(this).height();
\r
27 if((maxHeight) && tallest > maxHeight) tallest = maxHeight;
\r
28 return this.each(function() {
\r
29 $(this).height(tallest);
\r
36 // fix for iPhone - iPad orientation bug
\r
37 var metas = document.getElementsByTagName('meta');
\r
38 function resetViewport() {
\r
40 if (navigator.userAgent.match(/iPhone/i)) {
\r
41 for (i=0; i<metas.length; i++) {
\r
42 if (metas[i].name == "viewport") {
\r
43 metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
\r
50 window.onorientationchange = function() {
\r
54 function gestureStart() {
\r
55 for (i=0; i<metas.length; i++) {
\r
56 if (metas[i].name == "viewport") {
\r
57 metas[i].content = "width=device-width, minimum-scale=0.25, maximum-scale=1.6";
\r
62 if (navigator.userAgent.match(/iPhone/i)) {
\r
63 document.addEventListener("gesturestart", gestureStart, false);
\r
67 $(document).ready(function() {
\r
70 setContainerMinHeight('.container .wrapper');
\r
73 $('.show-extra').click(function(e) {
\r
75 $(this).parents('.bg-wrap').find('.extra').slideToggle(600);
\r
77 $('.hide-extra').click(function(e) {
\r
79 $(this).parents('.bg-wrap').find('.extra').slideUp(600);
\r
82 $('.box-more p').click(function(e) {
\r
83 $(this).siblings('.clearfix').toggle('slow');
\r
84 $(this).parents('.box-more').toggleClass('border');
\r
87 var fixTopMessageHeight = function() {
\r
88 var topMargin = parseInt($('.mainlogo img').height())+parseInt($('.top-msg').css('marginBottom'));
\r
89 $('.mainlogo').css('marginTop','-'+topMargin+'px');
\r
92 if ($('.mainlogo img').length > 0) {
\r
93 $('.mainlogo img').bind('load', fixTopMessageHeight)
\r
95 fixTopMessageHeight();
\r
98 $('.top-msg a.close').click(function(e) {
\r
100 $('.top-msg').animate({
\r
104 }, 1000, function (){
\r
105 $('.top-msg').removeClass('active')
\r
107 $('.mainlogo').animate({
\r
109 }, 1000, function (){
\r
116 $('select').dropkick();
\r
119 $('.top-msg .success').parents('.top-msg').css(
\r
121 backgroundColor: '#77C596',
\r
126 $('.top-msg .error').parents('.top-msg').css(
\r
128 backgroundColor: '#EF4F54',
\r
134 $('.top-msg .warning').parents('.top-msg').css(
\r
136 backgroundColor: '#F6921E',
\r
141 $('.top-msg .info').parents('.top-msg').css(
\r
143 backgroundColor: '#C3C3B9',
\r
148 // clouds homepage animation
\r
149 $('#animation a').hover(
\r
154 }, 600, function() {
\r
155 if ($(this).find('img').attr('src').indexOf("_top") == -1) {
\r
156 var src = $(this).find('img').attr('src').replace('.png', '_top.png')
\r
157 $(this).find('img').attr("src", src);
\r
161 $(this).siblings('p').find('img').animate({
\r
167 $(this).animate({top: '0'}, 600, function() {
\r
168 var src = $(this).find('img').attr('src').replace('_top.png', '.png')
\r
169 $(this).find('img').attr("src", src);
\r
171 $(this).siblings('p').find('img').animate({
\r
181 if ($('.widjets'.length > 0)) {
\r
182 $('.widjets li div').equalHeights();
\r
186 if($("#id_issue_date").length > 0 ){
\r
187 $( "#id_issue_date" ).datepicker({
\r
188 defaultDate: "+0",
\r
189 dateFormat: "yy-mm-dd",
\r
190 onSelect: function( selectedDate ) {
\r
191 $( "#id_expiration_date" ).datepicker( "option", "minDate", selectedDate );
\r
194 $( "#id_expiration_date" ).datepicker({
\r
195 defaultDate: "+1w",
\r
196 dateFormat: "yy-mm-dd",
\r
197 onSelect: function( selectedDate ) {
\r
198 $( "#id_issue_date" ).datepicker( "option", "maxDate", selectedDate );
\r
205 $(".table_sorting").tablesorter();
\r
207 // Billing functionality
\r
208 $('.billing table.complex tr:nth-child(4n+1), .billing table.complex tr:nth-child(4n+2)').addClass('zebra');
\r
209 $('.billing table.complex table tr').removeClass('zebra');
\r
210 $('.billing table a').click(function(e){
\r
211 e.preventDefault();
\r
212 $(this).parents('tr').next('tr').toggle();
\r
221 $(window).resize(function() {
\r
223 setContainerMinHeight('.container .wrapper');
\r
224 if ($('.widjets').length > 0) {
\r
225 $('.widjets li div').equalHeights();
\r