
var h=0;var w=0;var left_one=0;var clients_top_min=0;var clients_green_light=0;$(document).ready(function(){h=$(window).height();w=$(window).width();show_stuff();$("#clients_up").hover(function(){clients_green_light=1;move_clients_up();},function(){clients_green_light=0;});$("#clients_down").hover(function(){clients_green_light=1;move_clients_down();},function(){clients_green_light=0;});$("#clients").hover(function(){},function(){$(".client_description").hide();});$("#dimension_width").html(w);$("#dimension_height").html(h);$(window).resize(function(){h=$(window).height();w=$(window).width();layout_stuff();setTimeout("last_calculations()",50);$("#dimension_width").html(w);$("#dimension_height").html(h);});});function log_stuff(str){$("#log_stuff").prepend("<br>"+str);}function move_clients_up(){if(clients_green_light==0){return;}$(".client_description").hide();if(parseInt($("#clients").css("top"))<=clients_top_min){$("#clients_up").hide();return;}else{$("#clients_down").show();}$("#clients").animate({top:'-=1'},1,function(){move_clients_up();});}function move_clients_down(){if(clients_green_light==0){return;}$(".client_description").hide();if(parseInt($("#clients").css("top"))>=0){$("#clients_down").hide();return;}else{$("#clients_up").show();}$("#clients").animate({top:'+=1'},1,function(){move_clients_down();});}function show_stuff(){nav_set_hover();setTimeout("layout_stuff()",200);setTimeout("show_all()",300);setTimeout("last_calculations()",350);}function last_calculations(){var images_h=0;$("#clients").children("img").each(function(){images_h+=parseInt($(this).attr("height"));});clients_top_min=h-images_h;}function nav_set_hover(){$("#menu").children().hover(function(){if($(this).hasClass("is_selected")){return;}$(this).addClass("h1_selected");},function(){if($(this).hasClass("is_selected")){return;}$(this).removeClass("h1_selected");});}function layout_stuff(){var top=0;var left=0;var right=0;var bottom=0;left_one=Math.round(0.1*w);left=left_one;$("#col_1").height(h).css('left',left_one+"px");$("#menu").css('left',left_one+"px");$("#photo_jcroux").css('left',left_one+"px");$("#contact_a").css('left',left_one+"px");$("#contact_b").css('left',left_one+"px");$("#contact_c").css('left',left_one+"px");right=Math.round(0.1*w);$(".col_2_position").height(h).css('right',right+"px");$(".clients_arrows").css('right',right+"px");var right_col_2_text=right+20;$(".col_2_content_text").css('right',right_col_2_text+"px");var right_copyright=right+310+2;$("#copyright").css('right',right_copyright+"px");left=Math.round(0.5*(w-$("#logo_a").width()));top=Math.round(0.3*(h-$("#logo_a").height()));$("#logo_a").css('left',left+"px").css('top',top+"px");var target_width=Math.round(0.7*(w-$("#col_1").width()-$("#col_2").width()-parseInt($("#col_2").css("right"))-parseInt($("#col_1").css("left"))));var font_size=resize_text("#logo_a",target_width);left=Math.round(0.5*(w-$("#logo_a").width()));top=Math.round(0.3*(h-$("#logo_a").height()));$("#logo_a").css('left',left+"px").css('top',top+"px");var font_size_=Math.round(0.42*font_size);$("#logo_b").css("font-size",font_size_+"px");left=Math.round(0.5*(w-$("#logo_b").width()));top=Math.round(0.65*(h-$("#logo_b").height()));$("#logo_b").css('left',left+"px").css('top',top+"px");top=Math.round(0.95*h-$("#contact_c").height());$("#contact_c").css("top",top+"px");left=left_one+40;$("#contact_c").css('left',left+"px");top=parseInt($("#contact_c").css("top"))-30;$("#contact_b").css("top",top+"px");left=left_one+40;$("#contact_b").css('left',left+"px");top=parseInt($("#contact_b").css("top"))-30;$("#contact_a").css("top",top+"px");left=left_one+40;$("#contact_a").css('left',left+"px");top=parseInt($("#contact_a").css("top"))-50-$("#photo_jcroux").height();$("#photo_jcroux").css("top",top+"px");left=left_one+40;$("#photo_jcroux").css('left',left+"px");}function resize_text(element,target_width){var size=parseInt($(element).css("font-size"));var it=0;if($(element).width()<target_width){while(it<300){if($(element).width()>target_width){break;}++size;$(element).css("font-size",size+"px");++it;}}else if($(""+element).width()>target_width){while(it<300){if($(""+element).width()<target_width){break;}--size;$(""+element).css("font-size",size+"px");++it;}}return size;}function show_all(){$(".basic").show();$(".col_2_content_text").hide();}function show_right_col(section){$(".is_selected").removeClass("is_selected").removeClass("h1_selected");$("#nav_"+section).addClass("is_selected");$(".col_2_content").hide();$(".col_2_content_text").hide();$("#"+section).show();}function clients_show(client_id){$(".client_description").hide();var img_h=parseInt($("#img_"+client_id).attr("height"));var pos=$("#img_"+client_id).offset();$("#client_description_bg").height(img_h).css("top",pos.top+"px").css("left",pos.left+"px").show();$("#client_description_text").height(img_h).css("top",pos.top+"px").css("left",pos.left+"px");$("#client_description_text_tt").html($("#client_description_"+client_id).html());$("#client_description_text").show();}function clients_show_popup(client_id,url){$("#popup_content").html("<iframe id='popup_frame' marginheight='0' marginwidth='0' frameborder='0' width='100%' height='100%' src='"+url+"'></iframe>");position_popup();$('#overlay_background').show();$("#popup_frame").height(Math.round(1*$(window).height()));$("#popup_comment").html($("#client_description_"+client_id).html());$('#popup').show();$('#popup_bar').show();}function position_popup(){return;var w_screen=$(window).width();var h_screen=$(window).height();var left=Math.round(0.5*(w_screen-$('#popup').width()));$('#popup').css('top',top+'px').css('left',left+'px');}function popup_close(){$('#overlay_background').hide();$('#popup').hide();$('#popup_content').html('');$('#popup_bar').hide();}function clients_popup(gallery_id,url){alert(gallery_id);}
