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
16 // fix for iPhone - iPad orientation bug
\r
17 var metas = document.getElementsByTagName('meta');
\r
18 function resetViewport() {
\r
20 if (navigator.userAgent.match(/iPhone/i)) {
\r
21 for (i=0; i<metas.length; i++) {
\r
22 if (metas[i].name == "viewport") {
\r
23 metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
\r
30 window.onorientationchange = function() {
\r
34 function gestureStart() {
\r
35 for (i=0; i<metas.length; i++) {
\r
36 if (metas[i].name == "viewport") {
\r
37 metas[i].content = "width=device-width, minimum-scale=0.25, maximum-scale=1.6";
\r
41 document.addEventListener("gesturestart", gestureStart, false);
\r
45 $(document).ready(function() {
\r
48 setContainerMinHeight('.container .wrapper');
\r
51 $('.show-extra').click(function(e) {
\r
53 $(this).parents('.bg-wrap').find('.extra').slideToggle(600);
\r
55 $('.hide-extra').click(function(e) {
\r
57 $(this).parents('.bg-wrap').find('.extra').slideUp(600);
\r
60 $('.box-more p').click(function(e) {
\r
61 $(this).siblings('.clearfix').toggle('slow');
\r
62 $(this).parents('.box-more').toggleClass('border');
\r
65 var fixTopMessageHeight = function() {
\r
66 var topMargin = parseInt($('.mainlogo img').height())+parseInt($('.top-msg').css('marginBottom'));
\r
67 $('.mainlogo').css('marginTop','-'+topMargin+'px');
\r
70 if ($('.mainlogo img').length > 0) {
\r
71 $('.mainlogo img').bind('load', fixTopMessageHeight)
\r
73 fixTopMessageHeight();
\r
76 $('.top-msg a.close').click(function(e) {
\r
78 $('.top-msg').animate({
\r
82 }, 1000, function (){
\r
83 $('.top-msg').removeClass('active')
\r
85 $('.mainlogo').animate({
\r
87 }, 1000, function (){
\r
91 //$('select').dropkick();
\r
95 $('.top-msg .success').parents('.top-msg').css(
\r
97 backgroundColor: '#77C596',
\r
102 $('.top-msg .error').parents('.top-msg').css(
\r
104 backgroundColor: '#EF4F54',
\r
110 $('.top-msg .warning').parents('.top-msg').css(
\r
112 backgroundColor: '#F6921E',
\r
117 $('.top-msg .info').parents('.top-msg').css(
\r
119 backgroundColor: '#C3C3B9',
\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
154 /*$('#animation a').hover(
\r
156 var src = $(this).find('img').attr('src').replace('.png', '_top.png')
\r
157 $(this).find('img').attr("src", src);
\r
160 }, 600, function() {
\r
161 // action to do when animation is finished
\r
163 $(this).siblings('p').find('img').animate({
\r
172 }, 600, function() {
\r
173 var src = $(this).find('img').attr('src').replace('_top.png', '.png')
\r
174 $(this).find('img').attr("src", src);
\r
176 $(this).siblings('p').find('img').animate({
\r
185 $(window).resize(function() {
\r
187 setContainerMinHeight('.container .wrapper');
\r