
$(document).ready(function() {
	

$('iframe').hide();

/*key=0;
 $(document).keyup(function(e) {
       if(e.keyCode == 53 || e.keyCode == 101) { //number 5
         key++;
		 if (key==5) {$("body, html").css({"background": "url(images/russia88.png)"}); key=0;}
       } 
   });*/

if ($(window).height()<555) {$("#leftmenu").css("position","relative")}
$(window).resize(function() {
if ($(window).height()<555) {$("#leftmenu").css("position","relative")} else  {$("#leftmenu").css("position","fixed")}
});


$("#try-button a span").css({opacity:0});
 	$("#platforms").css({opacity:0.7});
	$("#platforms").hover(
  function () {
    $(this).stop().animate({opacity:1});
  }, 
  function () {
    $(this).stop().animate({opacity:0.7});
  }
);







//-------------------slide

$("#slider li").css({opacity:0.4});
$("#slider li.active").css({opacity:1});	
	
newpic="../images/big-browser.jpg"
$("#big-slide img").css({opacity:0});	
$("#big-slide img").attr({src:newpic});
$("#big-slide img").load(function() {
$("#big-slide img").stop().animate({opacity:1}, 300)	
});

	
	
$("#slider li").click(function () {
	$("#slider li").css({opacity:0.4})
	$(this).css({opacity:1})

if (newpic=="../images/big-"+$(this).attr("id")+".jpg") {return false; exit;}
newpic="../images/big-"+$(this).attr("id")+".jpg";

    $("#big-slide img").animate({opacity:0},300, function(){
		
	$("#big-slide img").attr({src:newpic});
	
	$("#big-slide img").load(function() {
            var imageHeight = $(this).height();
			
            $("#big-slide").stop().animate({height:imageHeight+"px"}, 300, function () {
			$("#big-slide img").stop().animate({opacity:1}, 500)	
			});
			
        });

	});


return false;
});

//**********slide-

$("#try-button a").hover(
  function () {
    $(this).find("span").stop().animate({opacity:1},300);
  }, 
  function () {
    $(this).find("span").stop().animate({opacity:0},300);
  }
);

//Screenshots ---------------

$("a[rel]").overlay({

	});
	
	
	
	

//Device--------------------
$(".device-in").hide();
$("#device a.dev-link").click(function() {
	
	$(this).next(".device-in").slideToggle("fast");
	return false;
	});


//Support--------------------
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
var error="";
$("#contact-submit").click(function(){
	error="";
	$('#supp-mess').hide();
	
	if($.trim($("#inp-name").val())=="") {
				error="Please enter your name. <br />";
			}
	if(reg.test($("#inp-mail").val())==false) {	error+="Please enter a valid email.<br />";}
	if ($.trim($("#inp-message").val())=="")
			{error+="Please enter your message.";}
	
if (error!="") {
$("#supp-mess").addClass("error-msg");
$("#supp-mess").html(error);
$("#supp-mess").fadeIn();
error="";
} else {
	
			var dataString = 
			'name='+	  $("#inp-name").val()+
			'&email='+ 	  $("#inp-mail").val() + 
			'&message=' + $("#inp-message").val();  
			
				$.ajax({  
					type: "POST",  
					url: "../mailer.php",  
					data: dataString,  
					cache:false,
					error: function(data) {
						alert("Try again later");},
					success: function(data) { 
					$("#supp-mess").removeClass("error-msg");
					$("#supp-mess").html("Thanks! Message was sent.");
					$("#supp-mess").fadeIn();													
					}
				});

			}		
		return false;
		});
  });




