function startLead(sender,navigate) {window.open(navigate,'_blank');$("#wait").css("display","block");$("#choose").css("display","none");} function stopLead() {$("#wait").css("display","none");$("#choose").css("display","block");} var intervalId,intervalId2;function checkState(hash) {$.ajax({url:"/ajaxGate/checkTicket",type:'POST',data:'hash='+hash,context:document.body,cache:false,success:function(html){var res=eval('('+html+')');if(res.hashStatus==2) {$.fancybox.close();stopChecking();location.href=res.fileLink;} if(res.hashStatus=='error') {clearInterval(intervalId);}}});} function ongo() {if($('#ongoing').html()=='...') {$('#ongoing').html('.');} else if($('#ongoing').html()=='.') {$('#ongoing').html('..');} else if($('#ongoing').html()=='..') {$('#ongoing').html('...');}} function startChecking(hash) {intervalId=setInterval(function(){checkState(hash);},3000);intervalId2=setInterval(ongo,300);} function stopChecking() {clearInterval(intervalId);clearInterval(intervalId2);} function openWindow(fileId) {$.fancybox.showActivity();$.ajax({url:"/ajaxGate/offers",type:'POST',data:'fileId='+fileId,context:document.body,cache:false,success:function(html){var res=eval('('+html+')');$.fancybox(res.result,{padding:0,margin:0,onClosed:stopChecking,scrolling:'no',showCloseButton:false,overlayShow:true,overlayOpacity:0.7,onComplete:function(){$(".description").tipTip({defaultPosition:"top",delay:100,fadeIn:70,fadeOut:70});$(".help").tipTip({defaultPosition:"bottom",delay:100,fadeIn:70,fadeOut:70,content:'
To download this file you have to fill short survey.
This will only take a while and when you are done the file will automatically unlock.

If the file does not unlock after completing the task, please try another one.
'});}});if(res.hash) startChecking(res.hash);}});} (function($){$.fn.textfill=function(maxFontSize){maxFontSize=parseInt(maxFontSize,10);return this.each(function(){var ourText=$("span",this),parent=ourText.parent(),maxHeight=parent.height(),maxWidth=parent.width(),fontSize=parseInt(ourText.css("fontSize"),10),multiplier=maxWidth/ourText.width(),newSize=(fontSize*(multiplier-0.1));ourText.css("fontSize",(maxFontSize>0&&newSize>maxFontSize)?maxFontSize:newSize);});};})(jQuery);
Template by RajaChord Responsive (c) 2012 RajaChord.com