<!--

//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');
	
	topic = 'What\'s Zozoc?';
	content = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Zozoc is mobile phone application through which you can send free SMS to your friends. It uses GPRS for sending and receiving SMS';
	date = '2007-02-08';
	addFaq(faqList, topic, content, date, false);
	
	topic = 'What is the benefit of using Zozoc?';
	content = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Zozoc provides a very cost effective way of sending SMS. A regular international SMS costs $0.15 but with Zozoc you can send it at $0.07';
	date = '2007-02-08';
	addFaq(faqList, topic, content, date, false);
	
	topic = 'What\'s the difference between Zozoc and traditional SMS?';
	content = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Zozoc is a cost effective way of sending SMS and thus costs much less. It uses GPRS and you can experience the same convenience as traditional SMS';
	date = '2007-02-08';
	addFaq(faqList, topic, content, date, false);
	
	topic = 'Does Zozoc charge?';
	content = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Zozoc is free SMS application. The only cost you bear is what you pay the service provider for GRPS usage';
	date = '2007-02-08';
	addFaq(faqList, topic, content, date, false);
	
	topic = 'How do I start to use Zozoc?';
	content = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If you have a GRPS enabled phone, you can access http://wap.zozoc.com to use our WAP page to send sms or download a client on your mobile. You also can use our WEB page as a PC client, and enjoy free sms!!! Download or not, Mobile Phone or PC, that\'s your choice!!!';
	date = '2007-02-08';
	addFaq(faqList, topic, content, date, false);
	
	topic = 'How do I activate GPRS?';
	content = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Please make calls to your mobile operator, and ask them to activate GPRS for you!';
	date = '2007-02-08';
	addFaq(faqList, topic, content, date, false);
	
	topic = 'On what kind of mobile phones does Zozoc run?';
	content = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Any phone that supports Java applications can run Zozoc. You can also use the web version';
	date = '2007-02-08';
	addFaq(faqList, topic, content, date, false);
	
	topic = 'How can I download and install Zozoc?';
	content = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;You can directly download Zozoc on your mobile by visiting (<a href="http://wap.zozoc.com" >http://wap.zozoc.com </a>) on your mobile, or you can download Zozoc from (<a href="http://www.zozoc.com" >http://www.zozoc.com </a>) and transfer it to your mobile phone';
	date = '2007-02-08';
	addFaq(faqList, topic, content, date, false);
	
	topic = 'How do I start sending free SMS once I have downloaded Zozoc?';
	content = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;After successfully downloading Zozoc, launch the application and register by providing your name and phone number. You will receive a password and login tip. In the Zozoc menu you should select write message, then type the message, then type mobile no. you wish to send it to (or select from phonebook) and send it';
	date = '2007-02-08';
	addFaq(faqList, topic, content, date, false);
	
	topic = 'Can I send SMS to friends who don\'t have Zozoc on their mobiles?';
	content = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Yes, you can do it through the mobile application, wap site and web version';
	date = '2007-02-08';
	addFaq(faqList, topic, content, date, false);
	
	topic = 'How can I update or uninstall Zozoc application on the mobile phone?';
	content = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;We will keep you updated with newer versions of Zozoc and send instructions accordingly. If you wish to un-install Zozoc, please follow the standard instructions on your phone to remove any Java application';
	date = '2007-02-08';
	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){
	var faqTopic = document.createElement('div');
	faqTopic.id = 'faqTopic'+faqInitPointer;
	faqTopic.className = 'dtPc_topic';
	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;
var currentFooterPageLink;
function initPageSwitch(){
	onClickPageSwitch('home');
}

function onClickPageSwitch(name){
	if(currentPage){
		currentPage.style.display = 'none';
	}
	if(currentPageLink){
		currentPageLink.className = '';
		currentFooterPageLink.className='';
	}
	currentPage = $(name + 'Panel');
	if(name == 'chat'){
		currentPageLink = null;
		currentFooterPageLink='';
	} else if(name=='home'){
		currentPageLink = $(name + 'Link');
		currentFooterPageLink='';
	}else{
		currentPageLink = $(name + 'Link');
		currentFooterPageLink=$('footer'+name+'Link');
	}
	if(currentPage){
		currentPage.style.display = 'block';
	}
	if(currentPageLink){
		currentPageLink.className = 'active';
	}
	if(currentFooterPageLink){
		currentFooterPageLink.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;
	}
}
//--------------------------------------------------

//For version

window._stopMouseOver=function(e){(window.event||e).cancelBubble=true;}
			var javaVersionPanel;
			var v2VersionPanel;
			var v3VersionPanel;
			var windowsVersionPanel;
			var windows2VersionPanel;
			var windows3VersionPanel;
			document.onmouseover=function(){
				javaVersionPanel=document.getElementById("javaVersionPanel");
				v2VersionPanel=document.getElementById("v2VersionPanel");
				v3VersionPanel=document.getElementById("v3VersionPanel");
				windowsVersionPanel=document.getElementById("windowsVersionPanel");
				windows2VersionPanel=document.getElementById("windows2VersionPanel");
				windows3VersionPanel=document.getElementById("windows3VersionPanel");
				if(javaVersionPanel)
					javaVersionPanel.style.display='none';
				if(v2VersionPanel)
					v2VersionPanel.style.display='none';
				if(v3VersionPanel)
					v3VersionPanel.style.display='none';
				if(windowsVersionPanel)
					windowsVersionPanel.style.display='none';
				if(windows2VersionPanel)
					windows2VersionPanel.style.display='none';
				if(windows3VersionPanel)
					windows3VersionPanel.style.display='none';
				
			}
			

			function showjavaMenu(event){
				_stopMouseOver(event);
				javaVersionPanel=document.getElementById("javaVersionPanel");
				javaVersionPanel.style.display="block";
			}
		
			function showv2Menu(event){
				_stopMouseOver(event);
				v2VersionPanel=document.getElementById("v2VersionPanel");
				v2VersionPanel.style.display="block";
			}
			function showv3Menu(event){
				_stopMouseOver(event);
				v3VersionPanel=document.getElementById("v3VersionPanel");
				v3VersionPanel.style.display="block";
			}
			function showwindowsMenu(event){
				_stopMouseOver(event);
				windowsVersionPanel=document.getElementById("windowsVersionPanel");
				windowsVersionPanel.style.display="block";
			}
			function showwindows2Menu(event){
				_stopMouseOver(event);
				windowsVersionPanel=document.getElementById("windows2VersionPanel");
				windowsVersionPanel.style.display="block";
			}
			function showwindows3Menu(event){
				_stopMouseOver(event);
				windowsVersionPanel=document.getElementById("windows3VersionPanel");
				windowsVersionPanel.style.display="block";
			}

//--------------------------

-->