
function resetzoom(e)
{
	   var mobile_timer = false;
	   var ua = navigator.userAgent;
	   var checker = {  apple: ua.match(/(iPhone|iPod|iPad)/),
						macintosh: ua.match(/Macintosh/),
						android: ua.match(/Android 3.2|Android 3.1|Android 3.0/)
		};
	if (checker.apple || checker.macintosh)
	{
        var viewportmeta = document.querySelector('meta[name="viewport"]');
        if (viewportmeta) 
		{            
			viewportmeta.content = 'width=device-width, minimum-scale=0.25,maximum-scale=1.0, initial-scale=1.0';
            document.body.addEventListener('gesturestart', function () {
                clearTimeout(mobile_timer);
               viewportmeta.content = 'width=device-width,minimum-scale=0.25, maximum-scale=1.6';
            }, false);
            
            window.addEventListener('touchend',function () 
            {
				mobile_timer = setTimeout(function () {
					clearTimeout(mobile_timer);
					viewportmeta.setAttribute('content','width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0');
				},1000);
			},false);     
        }
	}
}


$(document).ready(function () 
{
    document.ontouchmove = function(event) 
	{
		event.preventDefault();
	}
});
    
	$(window).bind('orientationchange', allignAndriod).trigger('orientationchange'); 
if(navigator.userAgent.match(/Android/i)!= null)
           {  
  $(window).bind('load', allignAndriod); 
  }
    var ipadfirstrotation=true;
function allignAndriod()
{
       if(navigator.userAgent.match(/Android/i)!= null)
           {
			 if (window.orientation % 180 != 0){
	             if(screen.availWidth==600 && screen.availHeight==1024 )
					{
						if(typeof kind_of_screen!="onlycenterwithsmalldim")
						{
							if(typeof kind_of_screen !="undefined")
							{
								$(document.body).css("-webkit-transform-origin", "-40px")
								.css("-webkit-transform", "scale(0.6,0.6)");
							}
							else
							{
								$(document.body).css("-webkit-transform-origin", "-15px")
								.css("-webkit-transform", "scale(0.6,0.6)");
							}
						}
						else
						{
							
						$(document.body).css("-webkit-transform-origin", "-10px")
						.css("-webkit-transform", "scale(0.58,0.58)");
						}
						$("#gameover").css("left","70%");	
					}else
					{
					    $(document.body).css("-webkit-transform-origin", "-250px")
						  .css("-webkit-transform", "scale(0.72,0.72)");
						$("#gameover").css("left","71%");						  
                    } 
                      			   
               } 
               else { 
                     if(screen.availWidth==1024 && screen.availHeight==600)
						{
						
							$(document.body).css("-webkit-transform-origin", "420px").css("-webkit-transform","scale(0.75,0.75)");
						}else
					    {					
						 $(document.body).css("-webkit-transform","scale(1,1)"); 
					    }
						$("#gameover").css("left","44%");				   
					}
		    }
			   
		if(navigator.userAgent.match(/ipad/i)!= null)
           { 
		   if (window.orientation % 180 == 0){
		   
		   if(typeof kind_of_screen !="undefined")
			{
			 if(kind_of_screen =="onlycenterwithsmalldim")
		  {  
		  if(ipadfirstrotation)
		  {
		 $(document.body).css("-webkit-transform-origin", "320px");
		 ipadfirstrotation=false;
           }else
           {
		   $(document.body).css("-webkit-transform-origin", "550px");
           }		   
		   }else
		   {
		    $(document.body).css("-webkit-transform-origin", "50px");	
		   }
           }else
             {
	         $(document.body).css("-webkit-transform-origin", "50px");
              }
			  
            $("#gameover").css({"left":"490px"});			  
			}
			else
			{
			$("#gameover").css("left","45%");
			}
            
           }

}
