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').addClass('success');
\r
120 $('.top-msg .error').parents('.top-msg').addClass('error');
\r
121 $('.top-msg .warning').parents('.top-msg').addClass('warning');
\r
122 $('.top-msg .info').parents('.top-msg').addClass('info');
\r
124 // clouds homepage animation
\r
125 $('#animation a').hover(
\r
130 }, 600, function() {
\r
131 if ($(this).find('img').attr('src').indexOf("_top") == -1) {
\r
132 var src = $(this).find('img').attr('src').replace('.png', '_top.png')
\r
133 $(this).find('img').attr("src", src);
\r
137 $(this).siblings('p').find('img').animate({
\r
143 $(this).animate({top: '0'}, 600, function() {
\r
144 var src = $(this).find('img').attr('src').replace('_top.png', '.png')
\r
145 $(this).find('img').attr("src", src);
\r
147 $(this).siblings('p').find('img').animate({
\r
157 if ($('.widjets'.length > 0)) {
\r
158 $('.widjets li div').equalHeights();
\r
162 if($("#id_issue_date").length > 0 ){
\r
163 $( "#id_issue_date" ).datepicker({
\r
164 defaultDate: "+0",
\r
165 dateFormat: "yy-mm-dd",
\r
166 onSelect: function( selectedDate ) {
\r
167 $( "#id_expiration_date" ).datepicker( "option", "minDate", selectedDate );
\r
170 $( "#id_expiration_date" ).datepicker({
\r
171 defaultDate: "+1w",
\r
172 dateFormat: "yy-mm-dd",
\r
173 onSelect: function( selectedDate ) {
\r
174 $( "#id_issue_date" ).datepicker( "option", "maxDate", selectedDate );
\r
178 $( "#id_start_date" ).datepicker({
\r
179 dateFormat: "yy-mm-dd",
\r
180 onSelect: function( selectedDate ) {
\r
181 $( "#id_start_date" ).datepicker( "option", "maxDate", selectedDate );
\r
185 $( "#id_end_date" ).datepicker({
\r
186 dateFormat: "yy-mm-dd",
\r
187 onSelect: function( selectedDate ) {
\r
188 $( "#id_end_date" ).datepicker( "option", "maxDate", selectedDate );
\r
194 $(".table_sorting").tablesorter();
\r
196 $('table .more-info').click(function(e){
\r
197 e.preventDefault();
\r
198 $(this).toggleClass('open');
\r
199 $(this).parents('tr').next('tr').toggle();
\r
203 $('.projects .details .edit').click( function(e){
\r
204 e.preventDefault();
\r
205 $(this).parents('.details').children('.data').hide();
\r
206 $(this).parents('.details').children('.editable').show();
\r
212 $(window).resize(function() {
\r
214 setContainerMinHeight('.container .wrapper');
\r
215 if ($('.widjets').length > 0) {
\r
216 $('.widjets li div').equalHeights();
\r