//	Author: Kyle Reguero
// 	Created Date: 01.10.2010

/* Start Rotating Fading text */
var DivID = "attentioncopyid";
var Speed = 40;
var Content = new Array();

/* Modify links and text for banner below */
Content[0] = "<a href=\"http://dentalcarefremont.wordpress.com\" onClick=\"navTrack('ocom','en','newsroom','news1');\">Dental Care of Fremont website updated to enhance our client experience</a>";
Content[1] = "<a href=\"http://dentalcarefremont.wordpress.com\" onClick=\"navTrack('ocom','en','newsroom','news2');\">View our new blog for expert advice and information from Dr. Weisman</a>";
Content[2] = "<a href=\"http://www.facebook.com/dental-care-of-fremont#!/pages/Dental-Care-of-Fremont/196209447086269\" onClick=\"navTrack('ocom','en','newsroom','news3');\">Dental Care of Fremont is now on Facebook! Join us and our clients</a>";

var MaskColors = new Array;
MaskColors[0] = "#000000";
var ContentTop = Content.length - 1;
var MaskTop = MaskColors.length - 1;
var DigitList = "0123456789ABCDEF".split("");
var DigitPointer = 15;
var active = 0;
var ContentPointer = ContentTop;
var ColorPointer = MaskTop;
var CurrentDirection = 'up';
function FadeFunction() {
if( DigitPointer == 15 ) {
	ContentPointer++; if( ContentPointer > ContentTop ) { ContentPointer = 0; }
	ColorPointer++;   if( ColorPointer   > MaskTop    ) { ColorPointer   = 0; }
	if(document.getElementById) {
		var container = document.getElementById(DivID);
		container.innerHTML = '';
		container.innerHTML = Content[ContentPointer];
		}
	else if(document.all) {
		var divx = document.all[DivID];
		divx.innerHTML = Content[ContentPointer];
		}
	CurrentDirection = 'down';
	}
else if( DigitPointer == 0 ) { CurrentDirection = 'up'; }
if( CurrentDirection == 'up' ) { DigitPointer++; }
else { DigitPointer--; }
re = /0/g;
var thiscolor = MaskColors[ColorPointer].replace(re,DigitList[DigitPointer]);
document.getElementById(DivID).getElementsByTagName("a")[0].style.color = thiscolor;
if(thiscolor=="#000000")
{
	fadeingTimer = clearInterval(fadeingTimer);
	setTimeout("resumefader()", 10000);
}
}
function resumefader()
{
	fadeingTimer =	setInterval("FadeFunction()",Speed);
}
/* End Rotating Fading text */


//	Author: Kyle Reguero
// 	Created Date: 01.10.2010






/* Start Accordian code */
var accordion=function(){
	var tm=sp=10;
	function slider(n){this.nm=n; this.arr=[]}
	slider.prototype.init=function(t,c,k){
		var a,h,s,l,i; a=document.getElementById(t); this.sl=k?k:'';
		h=a.getElementsByTagName('span'); s=a.getElementsByTagName('div'); this.l=h.length;
		for(i=0;i<this.l;i++){var d=h[i]; this.arr[i]=d; d.onmouseover=new Function(this.nm+'.pro(this)'); if(c==i){d.className=this.sl}}
		l=s.length;
		for(i=0;i<l;i++){var d=s[i]; d.mh=d.offsetHeight; if(c!=i){d.style.height=0; d.style.display='none'}}
	}
	slider.prototype.pro=function(d){
		for(var i=0;i<this.l;i++){
			var h=this.arr[i], s=h.nextSibling; s=s.nodeType!=1?s.nextSibling:s; clearInterval(s.tm);
			if(h==d){s.style.display=''; su(s,1); h.className=this.sl}
			else if(s.style.display==''){su(s,-1); h.className=''}
		}
	}
	function su(c,f){c.tm=setInterval(function(){sl(c,f)},tm)}
	function sl(c,f){
		var h=c.offsetHeight, m=c.mh, d=f==1?m-h:h; c.style.height=h+(Math.ceil(d/sp)*f)+'px';
		c.style.opacity=h/m; c.style.filter='alpha(opacity='+h*100/m+')';
		if(f==1&&h>=m){clearInterval(c.tm)}else if(f!=1&&h==1){c.style.display='none'; clearInterval(c.tm)}
	}
	return{slider:slider}
}();

function change()
{
	if(navigator.appName == 'Microsoft Internet Explorer')
	{
		document.searchForm.group.style.visibility='hidden';

	}
	document.getElementById("light").style.display="block";
	document.getElementById("fade").style.display="block";
	document.getElementById("light").innerHTML = "<div id='load' style='margin-right:250px; margin-top:50px;'><img src='http://www.oracleimg.com/ocom/groups/systemobject/@mktg_admin/documents/digitalasset/sitefinder_loader.gif' width='32' height='32' /></div><iframe src='/ocom/groups/public/@ocom/documents/webcontent/sitefinder.htm' frameborder='0' width='624' height='455' scrolling='no' allowtransparency='true' id='siteid' style='visibility:hidden'></iframe>";
}


/* End Accordian code */

function bubbleEvent(e)
{
	if (!e) var e = window.event;
	e.cancelBubble = true;
	if (e.stopPropagation) e.stopPropagation();
}


