$(document).ready(function() {
	
	var demoReqState = false;
	
	
	$('.fb').fancybox();
	$('.fbi').fancybox({type:'iframe',width:600,height:460,padding:0,overlayOpacity:0.9});
	
	$('#slider').cycle({
		fx: 'fade',
		cleartypeNoBg: true,
		pager:'#intro-nav',
		pause:true,
		pagerAnchorBuilder: function(idx, slide) {
		return '<a href="javascript:;" title="'+ $(slide).attr('title') +'">'+(idx + 1)+'</a>';
		}

	});
	
	

	$('table tr td').each(function(){
			var ind = $(this).index();
			$(this).hover(
					function() {
						$("table th:eq("+ind+")").css({'background-color':'#00FFFF'});
					},
					function() {
						$("table th:eq("+ind+")").css({'background-color':''});
					}
			);
		});
		
		
		
		
		
	$('#frmc').submit(function() {
		$('#frm-layer').fadeIn();
		
		var data = $(this).serialize();
		
		$.ajax({
			type:'POST',
			url:'mail.php',
			data:data,
			success:function(res) {
				
				if(res.status==0) {
				alert(res.msg);
				$('#frm-layer').fadeOut();
				} else if(res.status==1) {
					$('#frm-layer').fadeOut(function() {
						alert(res.msg);
						window.location.reload();
						});
					
					
				} else {
					alert(res.msg);
					$('#frm-layer').fadeOut();
				}
			}
		});
			
		return false;
	});
	
	
	
	
	
	
	
	
	
	
	
	$('#btnDownload').click(function() {
		var uid = $(this).attr('rel');	
		$.fancybox({href:'download-request.php?id='+uid});
	});
	
	$('.download').click(function() {
		var uid = $(this).attr('title');	
		$.fancybox({href:'download-request.php?id='+uid});
	});
	
	$('#btnDemoReqRight').click(function() {
		var uid = $(this).attr('rel');	
		$.fancybox({href:'demo-request.php?id='+uid});
	});
	
	$('#intro-nav a').tipsy({gravity: 's'});
	
	
});
