var img_ratio,sliding_margin,product_img=".product .csc-textpic-imagewrap img";jQuery(document).ready(function(){img_ratio=jQuery("#background_img").width()/jQuery("#background_img").height();sliding_margin=jQuery("#sliding-contact").css("right");jQuery(window).resize(resize_bg);jQuery(window).resize(resize_product);resize_bg();if(jQuery.browser.msie)jQuery(product_img).show();resize_product();var header_height=jQuery(".product .csc-header").height(),text_height=jQuery(".product .csc-textpic-text").height();jQuery(product_img).css("margin-top","-"+(header_height+text_height)+"px");if(!jQuery.browser.msie)jQuery(product_img).delay(500).fadeIn();if(!(jQuery.browser.msie&&jQuery.browser.version<7)){jQuery("#curtain").fadeTo(1,0).hide();jQuery("#sliding-button-link").click(function(event){event.preventDefault();var left=jQuery('#sliding-contact').offset().left,outerWidth=jQuery('#sliding-contact').outerWidth();if(left+outerWidth>jQuery(document).width()){jQuery('#sliding-contact').animate({right:"0px"},"fast");jQuery("#curtain").show().fadeTo("fast",0.55)}else closeContactForm()});jQuery("#curtain").click(function(event){closeContactForm()});jQuery("#close-button-link").click(function(event){closeContactForm();event.preventDefault()})};jQuery("#sliding-form-load").click(function(event){event.preventDefault();jQuery("#contact-info").slideUp("normal",function(){jQuery("#contact-form").slideDown("normal");jQuery("#sliding-form-load").fadeOut("fast")})});jQuery("#contact-form input[type='text']").focus(function(event){jQuery(this).val("")}).blur(function(event){jQuery(this).unbind()});jQuery("#contact-form textarea").focus(function(event){jQuery(this).text("")}).blur(function(event){jQuery(this).unbind()});jQuery("#news-marquee").each(function(){jQuery(this).marquee({yScroll:"bottom",showSpeed:1,pauseSpeed:1,scrollSpeed:20})});jQuery(".scroll-pane, .scroll-pane-vacancies").each(function(){jQuery(this).css("height",(jQuery(document).height()*0.70)+"px");jQuery(this).jScrollPane({showArrows:true});var api=jQuery(this).data('jsp'),throttleTimeout;jQuery(window).bind("resize",function(){if(jQuery.browser.msie){if(!throttleTimeout)throttleTimeout=setTimeout(function(){api.reinitialise();throttleTimeout=null},50)}else api.reinitialise()})})});var closeContactForm=function(event){jQuery("#contact-form").slideUp("fast",function(){jQuery("#contact-info").slideDown("fast");jQuery('#sliding-contact').animate({right:sliding_margin},"fast");jQuery("#curtain").fadeTo("fast",0).hide();jQuery("#sliding-form-load").fadeIn("fast")})},resize_product=function(event){jQuery(product_img).each(function(){var doc_width=jQuery(document).width(),doc_height=jQuery(document).height(),max_width=doc_width-300-250,max_height=doc_height-125-150;jQuery(this).aeImageResize({height:max_height,width:max_width})})},resize_bg=function(event){var img_width=jQuery("#background_img").width(),img_height=jQuery("#background_img").height(),doc_width=jQuery(document).width(),doc_height=jQuery(document).height(),doc_ratio=doc_width/doc_height;if(img_ratio>doc_ratio){jQuery("#background_img").css("height",doc_height);jQuery("#background_img").css("width",doc_height*img_ratio)}else{jQuery("#background_img").css("width",doc_width);jQuery("#background_img").css("height",doc_width/img_ratio)}};
