
//For news refresh on home page - Type 1
var newsItem;
var newsCount = 0;

function news_refresh(){
	if(newsCount>=news.length){
		newsCount=0;
	}
	newsItem=news[newsCount++];
	parseMessages();
}
var last='';
function parseMessages(){
	if(last==''){
		setTimeout("news_refresh()",0);
	}else{
		setTimeout("news_refresh()",5000);
	}
	var place=document.getElementById("news_container");
	if(place&&(last==''||last=='place2')){
		place.innerHTML=newsItem;
		last="place";
	}else{   
		var place2=document.getElementById("news_container2");
		if(place2&&(last==''||last=='place')){
			place2.innerHTML = newsItem;
			last="place2";
		}
	}
}


//For opening pop up for tour
var newWin;
//url, target, w, h are required.
function popWin(url,target,w,h,left,top,scroll,menu,toolBar,locBar,dir){
	var args='';
	//left status and resizable out, they are not fully supported.
	if(left=='all'){
		left=top=200;
		scroll=menu=toolBar=locBar=dir=1;
	}
	args+=left?',left='+left:',left=120';
	args+=top?',top='+top:',top=80';
	args+=scroll?',scrollbars=1':',scrollbars=0';
	args+=menu?',menubar=1':',menubar=0';
	args+=toolBar?',toolbar=1':',toolbar=0';
	args+=locBar?',location=1':',location=0';
	args+=dir?',directories=1':',directories=0';
	newWin=window.open(url,target,'width='+w+',height='+h+args);
	if(window.focus&&newWin)newWin.focus();
}

//For news- events refresh on home page - Type 2
	var displayInSeconds=5;
	var newsN=rN=0,newsT;
	function startReel(){
		var e;
		do{newsN++;e=document.getElementById('news'+newsN);}while(e);
		newsN--;
		if(newsN>1){
			if(!rN)
				rN=Math.round((new Date().getSeconds()/60*(newsN-1))+1);
			newsReel(rN);
		}else newsReel(0);
	}
	function newsReel(n){
		var shutItRE=eval('/shutIt/i'),openItRE=eval('/openIt/i');
		if(n){
			var eOff=document.getElementById('news'+n);
			if(eOff)
				eOff.className=eOff.className.replace(openItRE,'shutIt');//'openIt'=>'shutIt'
			n=n<newsN?n+1:1;
			newsT=setTimeout('newsReel('+n+')',displayInSeconds*1000);
		}else n=1;
		var eOn=document.getElementById('news'+n);
		if(eOn)
			eOn.className=eOn.className.replace(shutItRE,'openIt');//'shutIt'=>'openIt'
	}

//JavaScript for Drop-Down Menu Start

//Contents for menu Products
var menuProducts=new Array()
menuProducts[0]='<a href="/products/collaboration/index.html">SamePage</a>'
menuProducts[1]='<a href="/products/contentmanagement/index.html">eTouch CMS</a>'
menuProducts[2]='<a href="/products/contentintegration/index.html">eTouch Integration</a>'
menuProducts[3]='<a href="/products/contentserver/index.html">eTouch Platform</a>'

//Contents for menu Services, 
var menuServices=new Array()
menuServices[0]='<a href="/services/support.html">Support Services</a>'
menuServices[1]='<a href="/services/professional.html">Professional Services</a>'
menuServices[2]='<a href="/services/implementation.html">Implementation Services</a>'
menuServices[3]='<a href="/services/solutions.html">Solutions</a>'

//Contents for menu Company, 
var menuCompany=new Array()
menuCompany[0]='<a href="/company/news.html">News & Events</a>'
menuCompany[1]='<a href="/company/partners.html">Partners</a>'
menuCompany[2]='<a href="/company/careers.html">Careers</a>'
menuCompany[3]='<a href="/company/contact.html">Contact Us</a>'

//Contents for menu Support, 
var menuSupport=new Array()
menuSupport[0]='<a href="http://support.etouch.net/cm/wiki/FAQ.wiki/home/home.html" target="supportWindow">FAQ</a>'
menuSupport[1]='<a href="http://support.etouch.net/cm/newui/wiki/issuelisting.jsp?projectname=Knowledgebase" target="supportWindow">Knowledgebase</a>'
menuSupport[2]='<a href="http://support.etouch.net/cm/newui/wiki/forumlisting.jsp?projectname=Discussion%20Forum" target="supportWindow">Discussion Forum</a>'
menuSupport[3]='<a href="http://support.etouch.net/cm/wiki/support.Workshops%20and%20Webinars.wiki/home/home.html" target="supportWindow">Workshops & Webinars</a>'
menuSupport[4]='<a href="http://support.etouch.net/cm/newui/wiki/issuelisting.jsp?projectname=Feedback%20and%20Feature%20Requests" target="supportWindow">Feature Requests</a>'
menuSupport[5]='<a href="http://support.etouch.net/cm/wiki/Downloads.wiki/home/home.html" target="supportWindow">Downloads</a>'
menuSupport[6]='<a href="http://support.etouch.net/cm/wiki/support.Plugins.wiki/home/home.html" target="supportWindow">Plugins Support</a>'

		
var menuwidth='165px' //default menu width
var menubgcolor='#EFEFEF'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu

//JavaScript for Drop-Down Menu End