﻿
var ZoomImage =
{
   Zoom : function(img)
    {
    
        $('#divBackground').css({height:$(document).height()+"px",width:$(document).width()+"px"})
                           .show();
        $('a:not(#divPreview a)').css({visibility:'hidden'});
        $("#previewimg").attr('src',$('#'+img).attr('src'))
        .css({height:$('#'+img).height()+'px',width:$('#'+img).width()+'px'});
        $("#divPreview").css({top:($(window).height()/6)+"px",left:($(window).width()/5)+"px"})
                        .fadeIn(1500);   

    },
    ZoomEvents : function()
    {
         $("#aZoomIn").click(function(){
            var currentImageHeight = $('#previewimg').height();
            var currentImageWidth  = $('#previewimg').width();
            var newImageHeight = currentImageHeight + 50;
            var newImageWidth = currentImageWidth + 50;
            if(currentImageHeight < 650)
            {

                $('#previewimg').css({height:newImageHeight+'px',width:newImageWidth+'px'})
                .css({top:($(document).height()/2)+"px",left:($(document).width()/2)+"px"})
                .show();
                $('#divBackground').css({height:$(document).height()+"px",width:$(document).width()+"px"})
                .show();
            }
        });
        
        $("#aZoomout").click(function(){
            var currentImageHeight = $('#previewimg').height();
            var currentImageWidth  = $('#previewimg').width();
            var newImageHeight = currentImageHeight - 50;
            var newImageWidth = currentImageWidth - 50;
            if(currentImageHeight > 200)
            {
                $('#previewimg').css({height:newImageHeight+'px',width:newImageWidth+'px'})
                .css({top:($(window).height()/3)+"px",left:($(window).width()/3)+"px"})
                .show();
                $('#divBackground').css({height:$(document).height()+"px",width:$(document).width()+"px"})
                .show();
            }
        });
        
        $('#aClose').click(function(){
            $('#divPreview').fadeOut(1500);
            $('#divBackground').fadeOut(1500);
            
            $('a').css({visibility:'visible'});
           
        });
    },
    clearing : function()
    {
        $('#ctl00_Run_NameTxt').val('');
        document.getElementById('ctl00$Run$txtAddress').value = "";
       
        $('#ctl00_Run_drpProject').val('');
        $('#ctl00_Run_drpType').val('')
        $('#ctl00_Run_drpName').val('')
        
        $('#ctl00_Run_NameTxt').val('');
        $('#ctl00_Run_EmailTxt').val('');
        $('#ctl00_Run_txtMobile').val('');
        $('#ctl00_Run_txtFax').val('');
        $('#ctl00_Run_PhoneTxt').val('');
        document.getElementById('ctl00$Run$MessageTxt').value = "";
    }
}




