var sourceText = new Array (
"Classics, action, romance, Bollywood,Hollywood - you love it all! Now you can discuss your favourite movies, film stars and share the latest gossip- all on your own <b>movie blog</b>.So what are you waiting for?Set up your blog and shiftthe action online!",

"Do you have an unusual hobby like sewing or knitting? Why not exchange links and tips, discuss common interests others who share your hobby. All you need to do is set up your own <b>hobby blog</b> and you're ready to go!",

"Getting married soon and suffering from pre-wedding jitters? Trying to find the right hall,  organise your wedding trousseau and find the best <i>mehendi walla</i>? Start a <b>wedding blog</b> and share your joy and excitement with friends and family!",

"You're most comfortable talking about Linux, discussing knowledge management and peer-to-peer technologies. So, why not set up your own <b>technology blog</b>? Share links, news and developments in the tech world. You'll find many others sharing in your news and views!"
);

function SetCookie (name, value) {
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = null;
	var path = (argc > 3) ? argv[3] : null;
	var domain = (argc > 4) ? argv[4] : null;
	var secure = (argc > 5) ? argv[5] : false;
	document.cookie = name + "=" + escape (value) ;
}

function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
	endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
		return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0)
		break;
	}
	return null;
}


function getIdeaText()
{
	var largeExpDate = "";	
	var pathname = location.pathname;
	var myDomain = pathname.substring(0,pathname.lastIndexOf('/')) +'/';

	var ideaNumber = GetCookie("RidNum");

	if (ideaNumber == null) {
		ideaNumber = Math.floor(Math.random()*sourceText.length);
	}
	else
	{
		if(ideaNumber >= sourceText.length)
			ideaNumber=0;
	}

	with(document)
	{
		write(sourceText[ideaNumber])
	}
	ideaNumber++;

	SetCookie('RidNum',ideaNumber,largeExpDate,myDomain);
}
