/*----------Cufon----*/
Cufon.replace('.TopNav ul li, .footerLinks ul li, #header .counter p, .frmMidcurve h1,.fconnect p, .daycount, .frmElm .elm h2 ',{fontFamily : "StRydePro-Regular"});
Cufon.replace('.inner_footer .text h2, .inner_footer .text p, .inner_footer .box1 p, .tooltip .midcurve .tptxt p, .tooltip .midcurve .tptxt h1, p.bigtxt',{fontFamily : "StRyde-Bold" , hover:true});
Cufon.replace('.records, .result, .leftcol p, .headerTxt p, .qubox p, p.bigfont',{fontFamily : "CALIBRI"});
Cufon.replace('.leftcol h1, .theshowleft h1, .headerTxt h1 ,',{fontFamily : "CALIBRIBold"});

function fnajax_counter()
{			
		reqst_url = "ajax_counter.php";
		$.ajax({
			url:reqst_url,			
			success:function(response){	
						$('#counterdigit').html(response);			
				    }			
		});

 }


$(function(){
	window.setInterval("fnajax_counter()",10000);
});

/* BELOW CODES ARE FOR FB SHARE */
function postToFeed()
{
	var obj = {
		method: 'feed',
		link: 'http://sachkasamna.in/',
		picture: 'http://sachkasamna.in/images/fb_feed.jpg',
		name: 'Sach Ka Saamna',
		caption: 'Click here to take the pledge and join the ranks yourself.',
		description: 'has taken a shapath to fight corruption along with one million Indians!'
	};

	function callback(response)
	{
		if(response)
		{
			$('#post_msg').html('Your shapath has been posted on your wall. Thank you for your support!');
			$('#post_msg').show('slow');			
		}
		setInterval('redirectPage()', 3000);
	}

	FB.ui(obj, callback);
}

function redirectPage()
{
	FB.logout(function(response) {
		window.location="http://sachkasamna.in/curruptionwall.php";
	});	
}

function FConnectOut()
{
	FB.logout(function(response)
	{
	});
}

/* BELOW CODES ARE FOR SHARING EK SAWAAL POST TO FB*/
function sachToFeed()
{
	var quest = $('#post_question').val();
	var obj = {
		method: 'feed',
		link: 'http://sachkasamna.in/eksawal.php',
		picture: 'http://sachkasamna.in/images/fb_feed.jpg',
		name: 'Sach Ka Saamna',
		caption: quest,
		description: "Has just revealed a truth. Now it's your turn!"
	};

	function callback(response)
	{
		if(response)
		{
			$('#post_msg').html('Thank you for telling the truth. Your answer has been posted on your wall!');
			$('#post_msg').show('slow');			
		}

		setInterval('redirectSachPage()', 3000);
	}

	FB.ui(obj, callback);
}

function redirectSachPage()
{
	FB.logout(function(response) {
		//window.location="http://sachkasamna.in/index.php";
	});	
}

/* ABOVE CODES ARE FOR FB SHARE */
