var extForm;var extQuoteWindow;function submitForm(){extForm.getForm().submit({method:'POST',waitTitle:'Connecting',waitMsg:'Sending data...',success:function(){Ext.Msg.alert('Requesting Query Succeed!','Thank you for requesting a quote, we will contact you soon.');extQuoteWindow.close();},failure:function(form,action){if(action.failureType=='server'){obj=Ext.util.JSON.decode(action.response.responseText);Ext.Msg.alert('Requesting Query Failed!',obj.errors.reason);}}});}function resetForm(){extForm.getForm().reset();}function showQuote(){var form=new Ext.form.FormPanel({baseCls:'x-plain',layout:'absolute',url:'quick-quote.html',items:[{x:0,y:5,xtype:'label',text:'*Name:'},{x:60,y:0,name:'userName',xtype:'textfield',allowBlank:false,anchor:'100%'},{x:0,y:35,xtype:'label',text:'*Email:'},{x:60,y:30,name:'userEmail',allowBlank:false,xtype:'textfield',vtype:'email',anchor:'100%'},{x:0,y:65,xtype:'label',text:'*Question:'},{x:60,y:60,xtype:'botfield',name:'userSQ',anchor:'100%'},{x:0,y:90,xtype:'textarea',name:'userMessage',allowBlank:false,anchor:'100% 87%'},{x:160,y:225,style:'margin-top:8px;',border:false,bodyStyle:'background-color:#E4E6E8',html:'<img src="images/submit_button.jpg" style="cursor:pointer;" border="0" onClick="javascript: submitForm();">&nbsp;<img src="images/reset_button.jpg" border="0" style="cursor:pointer;" onClick="javascript: resetForm();">'}]});extForm=form;var quoteWindow=new Ext.Window({title:'Request a quote for the project',width:500,height:300,minWidth:300,minHeight:200,modal:true,layout:'fit',resizable:false,plain:false,bodyStyle:'padding:5px;',buttonAlign:'center',items:form});extQuoteWindow=quoteWindow;quoteWindow.show('btnStartNow');}var activeImage=false;var imageGalleryLeftPos=false;var imageGalleryWidth=false;var imageGalleryObj=false;var maxGalleryXPos=false;var slideSpeed=0;function startSlide(e){if(document.all)e=event;var id=this.id;if(this.id=='arrow_right'){slideSpeedMultiply=Math.floor((e.clientX-this.offsetLeft)/2);slideSpeed=-1*slideSpeedMultiply;slideSpeed=Math.max(-4,slideSpeed);}else{slideSpeedMultiply=4-Math.floor((e.clientX-this.offsetLeft)/2);slideSpeed=1*slideSpeedMultiply;slideSpeed=Math.min(4,slideSpeed);if(slideSpeed<0)slideSpeed=4;}}function releaseSlide(){var id=this.id;slideSpeed=0;}function gallerySlide(){if(slideSpeed!=0){var leftPos=imageGalleryObj.offsetLeft;leftPos=leftPos/1+slideSpeed;if(leftPos>maxGalleryXPos){leftPos=maxGalleryXPos;slideSpeed=0;}if(leftPos<minGalleryXPos){leftPos=minGalleryXPos;slideSpeed=0;}imageGalleryObj.style.left=leftPos+'px';}setTimeout('gallerySlide()',20);}function showImage(){if(activeImage){activeImage.style.filter='alpha(opacity=50)';activeImage.style.opacity=0.5;}this.style.filter='alpha(opacity=100)';this.style.opacity=1;activeImage=this;}function initCatSlideShow(sliderMainDiv,sliderObjDiv,silderEndDiv,gallerySize){releaseSlide();document.getElementById('arrow_left').onmousemove=startSlide;document.getElementById('arrow_left').onmouseout=releaseSlide;document.getElementById('arrow_right').onmousemove=startSlide;document.getElementById('arrow_right').onmouseout=releaseSlide;imageGalleryObj=document.getElementById(sliderObjDiv);imageGalleryLeftPos=imageGalleryObj.offsetLeft;imageGalleryWidth=document.getElementById(sliderMainDiv).offsetWidth-gallerySize;maxGalleryXPos=imageGalleryObj.offsetLeft;minGalleryXPos=imageGalleryWidth-document.getElementById(silderEndDiv).offsetLeft;var slideshowImages=imageGalleryObj.getElementsByTagName('IMG');for(var no=0;no<slideshowImages.length;no++){slideshowImages[no].onmouseover=showImage;}gallerySlide();}var imageIndex=0;function getNextProject(){document.getElementById('loaderFeatured').style.display="inline";imageIndex=imageIndex+1;var img=document.getElementById('imgFeatured');if(projectsImages[imageIndex]!=null){img.onload=function(){document.getElementById('loaderFeatured').style.display="none";};img.src=projectsImages[imageIndex];document.getElementById('imgFeatured').alt=projectsTitles[imageIndex];document.getElementById('imgFeatured').title=projectsTitles[imageIndex];}else{imageIndex=imageIndex-1;removeLoader();}}function getPreviousProject(){document.getElementById('loaderFeatured').style.display="inline";imageIndex=imageIndex-1;var img=document.getElementById('imgFeatured');if(projectsImages[imageIndex]!=null){img.onload=function(){document.getElementById('loaderFeatured').style.display="none";};img.src=projectsImages[imageIndex];document.getElementById('imgFeatured').alt=projectsTitles[imageIndex];document.getElementById('imgFeatured').title=projectsTitles[imageIndex];}else{imageIndex=imageIndex+1;removeLoader();}}function hideLoader(){document.getElementById('loaderFeatured').style.display="none";}function removeLoader(){hideLoader();}