<!--

//For download
function initDownload(){
	var topic;
	var link;
	var date;
	
	topic = 'Zozoc 1.4.6 Java English version (US Server)';
	link = 'wap/lite-en-z3c.zip';
	date = '2007-08-22';
	addDownload(topic, link, date, true);
	
	topic = 'Zozoc 1.4.6 Java Chinese version (China server)';
	link = 'wap/lite-ch-z0c.zip';
	date = '2007-08-22';
	addDownload(topic, link, date, true);
	
	topic = 'Zozoc 1.4.6 Palm English version (US Server)';
	link = 'wap/lite-en-z3c-palm.zip';
	date = '2007-08-22';
	addDownload(topic, link, date, true);
	
	topic = 'Zozoc 1.4.6 all versions';
	link = 'wap/zozoc_all.zip';
	date = '2007-08-22';
	addDownload(topic, link, date, true);
	
	topic = 'Palm Java Platform Chinese Ver.';
	link = 'wap/kvm4palm-ch.zip';
	date = '2007-08-22';
	addDownload(topic, link, date, true);
	
	topic = 'Palm Java Platform English Ver.';
	link = 'wap/kvm4palm-en.zip';
	date = '2007-08-22';
	addDownload(topic, link, date, true);	
}

function addDownload(name, link, date, isNew){
	var downloadList = $('downloadList');
	
	var downloadTopic = document.createElement('div');
	downloadTopic.className = 'dtPc_topic';
	var downloadTopic_a = document.createElement('a');
	downloadTopic_a.innerHTML = name;
	downloadTopic_a.href = link;
	downloadTopic.appendChild(downloadTopic_a);
	if(isNew){
		var downloadTopic_new = document.createElement('span');
		downloadTopic_new.className = 'new';
		downloadTopic_new.innerHTML = 'New';
		downloadTopic.appendChild(downloadTopic_new);
	}
	if(date){
		var downloadTopic_date = document.createElement('span');
		downloadTopic_date.innerHTML = date;
		downloadTopic.appendChild(downloadTopic_date);
	}
	
	downloadList.appendChild(downloadTopic);
}
//---------------------------------------------------------------

//For FAQ
var faqInitPointer = 0;

function initFaq(){
	var topic;
	var content;
	var date;
	var faqList = $('faqList');
	
	//Introduction
	topic = 'Introduction';
	content = 'header';
	addFaq(faqList, topic, content);
	
	topic = 'What is Zozoc?';
	content = 'Zozoc is a simple to use mobile phone application through which you can exchange free SMS among your friends. Zozoc uses GPRS for sending and receiving SMS.';
	date = '2008-12-21';
	addFaq(faqList, topic, content, date, false);
	
	topic = 'What is the benefit of using Zozoc?';
	content = '- Free Zozoc messaging - invite your friends for unlimited texting <br /> - Better than SMS - unlimited word count, instantly delivered <br /> - Save Money - National and Group SMSes are considered as single Local SMS!';
	date = '2008-12-21';
	addFaq(faqList, topic, content, date, false);
	
	topic = 'Is zozoc Free?';
	content = 'Zozoc is a free SMS application which uses GPRS for exchanging text messages. You only have to pay for data charges to your regular service provider.';
	date = '2008-12-21';
	addFaq(faqList, topic, content, date, false);

	//Download
	topic = 'Download';
	content = 'header';
	addFaq(faqList, topic, content);
	
	topic = 'How can I download zozoc?';
	content = 'You can directly download Zozoc on your mobile by visiting http://wap.zozoc.in on your mobile web browser, or check our  <a href="JavaScript:onClickPageSwitch(\'download\');">Download</a> section for more details.';
	date = '2008-12-21';
	addFaq(faqList, topic, content, date, false);
	
	topic = 'What do I require for using Zozoc?';
	content = 'For using this first version of zozoc, you will require:<br/>1) Java/Symbian/Windows Mobile handset depending upon the version you choose.<br/>2) Activated GPRS for your mobile connection';
	date = '2008-12-21';
	addFaq(faqList, topic, content, date, false);
	
	topic = 'Which Version should I download?';
	content = 'Bring your mouse over the download link (without clicking it) to see the list of supported phones for that version. For Symbian and Windows Mobile version, it is advisable to subscribe to a GPRS data plan like Airtel Net on Phone/Mobile Office, Vodafone Mobile Connect etc.';
	date = '2008-12-21';
	addFaq(faqList, topic, content, date, false);

	topic = 'My Mobile is not listed on your website for Download. What should I do?';
	content = 'Zozoc is currently available for the listed handsets and availability for the rest of the models will come very soon. Just drop in a mail at <a href="mailto:support@zozoc.in">support@zozoc.in</a> with your phone brand and model or you can leave a message in <a href="http://zozocindia.ning.com/forum/topic/show?id=2334755:Topic:151">this thread</a> on our forum.';
	date = '2008-12-21';
	addFaq(faqList, topic, content, date, false);

	//Installation
	topic = 'Installation';
	content = 'header';
	addFaq(faqList, topic, content);
	
	topic = 'Where would you recommend installing Zozoc - on my external memory or phone memory?';
	content = 'Java version can be installed anywhere where there is sufficient memory. Symbian and Windows mobile versions need to be installed in the Phone memory.';
	date = '2008-12-21';
	addFaq(faqList, topic, content, date, false);

	//GPRS
	topic = 'GPRS';
	content = 'header';
	addFaq(faqList, topic, content);
	
	topic = 'What is GPRS?';
	content = 'GPRS (General Packet Radio Service) is a non-voice value added service with which you can enjoy a continuous wireless connection to Internet and access your favorite web sites, entertainment services and other web applications on your Mobile Phone.';
	date = '2008-12-21';
	addFaq(faqList, topic, content, date, false);
	
	topic = 'How do I know my handset is GPRS/JAVA capable (or compatible)?';
	content = 'Check your Mobile Company\'s website or search your phone model at <a href="http://www.gsmarena.com">www.gsmarena.com</a> and look under DATA and FEATURES headings for detail.';
	date = '2008-12-21';
	addFaq(faqList, topic, content, date, false);

	topic = 'How can I configure my GPRS settings?';
	content = '<a href="http://zozocindia.ning.com/page/page/show?id=2334755:Page:67">Click here</a> page for detailed information on activating GPRS for your carrier.';
	date = '2008-12-21';
	addFaq(faqList, topic, content, date, false);

	topic = 'What are the GPRS charges for my connection?';
	content = 'GPRS charges are generally based on data usage and vary from carrier to carrier. Contact your Mobile operator for exact details.';
	date = '2008-12-21';
	addFaq(faqList, topic, content, date, false);

	//Usage
	topic = 'Usage';
	content = 'header';
	addFaq(faqList, topic, content);
	
	topic = 'How do I start sending free SMS once I have downloaded Zozoc?';
	content = 'Zozoc works exactly like your default SMS. After successfully downloading Zozoc,<br/>1) Launch the application and select appropriate GPRS access point (your default access point is automatically highlighted)<br/>2) Register by providing your name and phone number. You will receive your password by SMS.<br/>3) Login by entering your phone number and password<br/>4) Once you reach your inbox page, all the functionality is the same as your default SMS!';
	date = '2008-12-21';
	addFaq(faqList, topic, content, date, false);
	
	topic = 'I did not receive my password by SMS. What should I do?';
	content = 'Try registering again with your number. If you do not get the password by SMS, go to the \'Resend password\' option in the application and enter your mobile number to resend password to your mobile. If both these methods do not work, try registering your account on the website or contact us at <a href="mailto:support@zozoc.in">support@zozoc.in</a>.';
	date = '2008-12-21';
	addFaq(faqList, topic, content, date, false);
	
	topic = 'I am getting an error message saying \'Network Error\'. What should I do?';
	content = 'You can sometimes get this message due to spikes in your network connection. Try going back and login again. If the problem persists, contact us at <a href="mailto:support@zozoc.in">support@zozoc.in</a> or type in a short message at our forums.';
	date = '2008-12-21';
	addFaq(faqList, topic, content, date, false);

	topic = 'Can I send SMS to friends who don\'t have Zozoc on their mobiles?';
	content = 'Yes, for a promotional period you can send SMS to anybody in India FREE of cost, paying only towards your GPRS charges to your mobile operator. If you want to continue sending FREE SMS to your friends after the promotional period, invite them to Zozoc.';
	date = '2008-12-21';
	addFaq(faqList, topic, content, date, false);

	topic = 'Can I send national SMSes from Zozoc?';
	content = 'Yes, you can send text messages to anyone in India having the zozoc application.';
	date = '2008-12-21';
	addFaq(faqList, topic, content, date, false);

}

function onClickFaqTopic(faqTopic){
	if(faqTopic.className == 'dtPc_topic'){
		faqTopic.className = 'dtPc_topic active';
		faqTopic.content.style.display = 'block';
	} else {
		faqTopic.className = 'dtPc_topic';
		faqTopic.content.style.display = 'none';
	}
}

function addFaq(faqList, topic, content, date, isNew, isEnableDate){
	if(content == "header"){
		var faqTopic = document.createElement('div');
		faqTopic.className = 'dtPc_topicb';
		var faqTopic_b = document.createElement('b');
		faqTopic_b.innerHTML = topic;
		faqTopic.appendChild(faqTopic_b);
		faqList.appendChild(faqTopic);
		faqInitPointer++;
		return;
	}
	
	var faqTopic = document.createElement('div');
	faqTopic.id = 'faqTopic'+faqInitPointer;	
	faqTopic.className = 'dtPc_topic';	
	if(topic == 'Where would you recommend installing Zozoc - on my external memory or phone memory?'){
		faqTopic.style.height = "42px";
	}else{
		faqTopic.style.height = "21px";
	}
	var faqTopic_a = document.createElement('a');
	faqTopic_a.innerHTML = topic;
	faqTopic_a.href = 'JavaScript:onClickFaqTopic($(\''+faqTopic.id+'\'));';
	faqTopic.appendChild(faqTopic_a);
	if(isNew){
		var faqTopic_new = document.createElement('span');
		faqTopic_new.className = 'new';
		faqTopic_new.innerHTML = 'New';
		faqTopic.appendChild(faqTopic_new);
	}
	if(isEnableDate){
		if(date){
			var faqTopic_date = document.createElement('span');
			faqTopic_date.innerHTML = date;
			faqTopic.appendChild(faqTopic_date);
		}
	}
	
	var faqContent = document.createElement('div');
	faqContent.className = 'dtPc_content';
	faqContent.style.display = 'none';
	var faqContent_div = document.createElement('div');
	faqContent.appendChild(faqContent_div);
	faqContent_div.className = 'dtPc_content_m';
	faqContent_div.innerHTML = content;
	
	faqTopic.content = faqContent;
	
	faqList.appendChild(faqTopic);
	faqList.appendChild(faqContent);
	
	faqInitPointer ++;
}
//---------------------------------------------------------------

//For Announcement 
function initAnnouncement(){
	var topic;
	var content;
	var date;
	var announceList = $('announceList');
	
//	topic = 'What\'s Zozoc?';
//	content = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Zozoc client now is a J2ME application. It only be used in your mobile phone, and can be shared with international users. The product, based on the GPRS technology, provides us the function of sending and receiving Short Message. ';
//	date = '2007-02-08';
//	addFaq(announceList, topic, content, date, false);
}
//------------------------------------------------------------------------------------

//For page switch
var currentPage;
var currentPageLink;
function initPageSwitch(){
	onClickPageSwitch('home');
}

function onClickPageSwitch(name){
	if(currentPage){
		currentPage.style.display = 'none';
	}
	if(currentPageLink){
		currentPageLink.className = '';
	}
	currentPage = $(name + 'Panel');
	if(name == 'chat'){
		currentPageLink = null;
	} else {
		currentPageLink = $(name + 'Link');
	}
	if(currentPage){
		currentPage.style.display = 'block';
	}
	if(currentPageLink){
		currentPageLink.className = 'active';
	}
}
//------------------------------------------------------------------------

//For login, register and download tab
function onClickTab(tab, tabName, loginPanel, registerPanel, downloadPanel){
	switch(tabName){
		case 'login':
			tab.className = 'login_tab clearFloat tab_l';
			loginPanel.style.display = 'block';
			registerPanel.style.display = 'none';
			downloadPanel.style.display = 'none';
			break;
		case 'register':
			tab.className = 'login_tab clearFloat tab_r';
			loginPanel.style.display = 'none';
			registerPanel.style.display = 'block';
			downloadPanel.style.display = 'none';
			break;
		case 'download':
			tab.className = 'login_tab clearFloat tab_d';
			loginPanel.style.display = 'none';
			registerPanel.style.display = 'none';
			downloadPanel.style.display = 'block';
			break;
		default:
			break;
	}
}
//--------------------------------------------------

//For introduction
var introductionLinks;
var introductionContent;
var currentIntroductionLink = null;
var introductionLinkInitPointer = 0;

function initIntroductions(){
	introductionLinks = $('introductionLinks');
	introductionContent = $('introductionContent');
	var link;
	var title;
	var content;
	
	link = 'Wanna try 3G?';
	title = 'Want to experience 3G?';
	content = 'A quick and cheap way to get in touch with friends instantly when they\'re not online on the PC, unavailable or simply on the move.';
	addIntroduction(link, title, content);
	
	link = 'Cost less!';
	title = 'Cost less!';
	content = 'Zozoc delivers free or the cheapest national and international SMS from your mobile and from your computer to anywhere in the world.';
	addIntroduction(link, title, content);
	
	link = 'SMS Group!';
	title = 'Group Talk';
	content = 'With Zozoc create your own groups by inviting friends and SMS all of them at the same time';
	addIntroduction(link, title, content);
	
	link = 'No SPAM!';
	title = 'Zozoc can keep your mobile phone clean!';
	content = 'With Zozoc you are free from spam SMS. Just receive SMS from your friends';
	addIntroduction(link, title, content);
	
	onSelectIntroduction($('introductionLink0'));
}

function onSelectIntroduction(link){
	link.className = 'onSelect';
	if(currentIntroductionLink){
		currentIntroductionLink.className = '';
	}
	currentIntroductionLink = link;
	introductionContent.innerHTML = link.describe;
}

function addIntroduction(link, title, content){
	var describe = '<h3>'+title+'</h3>';
	describe = describe + content;
	var li = document.createElement('li');
	var li_a = document.createElement('a');
	li.id = 'introductionLink' + introductionLinkInitPointer;
	li.describe = describe;
	li.appendChild(li_a);
	li_a.href='JavaScript:onSelectIntroduction($(\''+li.id+'\'))';
	li_a.title=link;
	li_a.innerHTML = '<strong>'+link+'</strong>';
	introductionLinks.appendChild(li);
	introductionLinkInitPointer ++;
}
//--------------------------------------------------

//Get elements by id(For firefox)
function $(id){
	return document.getElementById(id);
}
//----------------------------------------------

//For rolling tags
var lengthForRolling;
var threadForRolling;
var stepForRolling = 5;
var defaultLengthForRolling;
var intervalForRolling = 1;

var scrollForTags;
var tags;

var offsetLeftForRolling;
var clientWidthForRolling;

function onClickRollLeft(tempForScroll, tempForTags){
	scrollForTags = tempForScroll;
	tags = tempForTags;
	defaultLengthForRolling = scrollForTags.clientWidth/2;
	offsetLeftForRolling = tags.childNodes[tags.childNodes.length-1].offsetLeft;
	clientWidthForRolling = tags.childNodes[tags.childNodes.length-1].clientWidth;
	if(!document.all){
		offsetLeftForRolling -= 545;
	}
	if(threadForRolling == null){
		lengthForRolling = 0;
		threadForRolling = setInterval('rollTags(-stepForRolling,defaultLengthForRolling)',intervalForRolling);
	}
}
function onClickRollRight(tempForScroll, tempForTags){
	scrollForTags = tempForScroll;
	tags = tempForTags;
	defaultLengthForRolling = scrollForTags.clientWidth/2;
	offsetLeftForRolling = tags.childNodes[tags.childNodes.length-1].offsetLeft;
	clientWidthForRolling = tags.childNodes[tags.childNodes.length-1].clientWidth;
	if(!document.all){
		offsetLeftForRolling -= 545;
	}
	if(threadForRolling == null){
		lengthForRolling = 0;
		threadForRolling = setInterval('rollTags(stepForRolling,defaultLengthForRolling)',intervalForRolling);
	}
}

function onDisplayTargetTag(tempForScroll, tempForTags, tag){
	scrollForTags = tempForScroll;
	tags = tempForTags;
	var tempForClientWidth = tag.clientWidth;
	var tempForOffsetLeft = tag.offsetLeft;
	if(!document.all){
		tempForOffsetLeft -= 545;
	}
	if(tempForOffsetLeft < tempForScroll.scrollLeft){
		if(threadForRolling == null){
			lengthForRolling = 0;
			threadForRolling = setInterval('rollTags(-stepForRolling,'+(tempForScroll.scrollLeft-tempForOffsetLeft)+')',intervalForRolling);
		}
	} else if(tempForOffsetLeft + tempForClientWidth > tempForScroll.scrollLeft + tempForScroll.clientWidth){
		if(threadForRolling == null){
			lengthForRolling = 0;
			threadForRolling = setInterval('rollTags(+stepForRolling,'+(tempForOffsetLeft + tempForClientWidth-tempForScroll.scrollLeft-tempForScroll.clientWidth)+')',intervalForRolling);
		}
	}
}

function rollTags(step,length){
	scrollForTags.scrollLeft += step;
	if(step > 0){
		lengthForRolling += step;
	} else {
		lengthForRolling -= step;
	}
	if(scrollForTags.scrollLeft < 0){
		scrollForTags.scrollLeft = 0;
		clearInterval(threadForRolling);
		threadForRolling = null;
		return;
	} else if(scrollForTags.scrollLeft > offsetLeftForRolling + clientWidthForRolling-scrollForTags.clientWidth){
		scrollForTags.scrollLeft = offsetLeftForRolling+clientWidthForRolling-scrollForTags.clientWidth;
		clearInterval(threadForRolling);
		threadForRolling = null;
		return;
	}
	if(lengthForRolling > length){
		clearInterval(threadForRolling);
		threadForRolling = null;
		return;
	}
}
//--------------------------------------------------

-->