/*
 * stc_menu_spin.js
 */

var gsRT_ARROW = '&#9658;';
var gsLT_ARROW = '&#9668;';
var gsUP_ARROW = '&#9650;';

var gsCSSVers = BrowserDetect.version.toString();
var gsCSSVers = gsCSSVers.substring(0,1);
var gnCSSWidth = document.getElementsByTagName('body')[0].clientWidth;
var gnCSSHeight = document.getElementsByTagName('body')[0].clientHeight;

stc_Menu={p:0,x:0,y:0,w:0,h:0,r:0,v:0,s:0,isVertical:0,a1:0,a2:0,a3:0,color:'#ffffff',colorover:'#ffffff',backgroundcolor:'#0099ff',backgroundcolorover:'#000000',bordercolor:'#000000',fontsize:12,fontfamily:'Arial',pas:0,spinmenu:function(){this.p=this.r/this.s;this.a1=this.a2=this.isVertical?0:Math.PI/2},spinmenuitem:function(a7,a6,a5){a4=" onclick='window.open(\""+a6+"\""+(a5?(",\""+a5+"\""):",\"_self\"")+")'";document.write("<div id='spinmenu"+this.a3+"' style='cursor:expression(\"hand\");cursor:pointer;position:absolute;width:"+this.w+"px;left:"+this.h+"px;"+"background-color:"+this.backgroundcolor+";color:"+this.color+";border:"+this.bordersize+"px solid "+this.bordercolor+";font:normal "+this.fontsize+"px "+this.fontfamily+";font-weight:"+this.fontweight+";text-align:center;cursor:default;z-Index:1000; -moz-border-radius: 11px; -webkit-border-radius: 11px; border-radius: 11px; behavior:url(/include/border-radius.htc);cursor:pointer;' onmouseover='this.style.color=\""+this.colorover+"\";this.style.backgroundColor=\"#FFFFFF "+this.backgroundcolorover+"\"'"+	"onmouseout='this.style.color=\""+this.color+"\";this.style.backgroundColor=\""+this.backgroundcolor+"\"'"+a4+">"+a7+"</div>");this.a3++},muta:function(){a8=document.getElementById("controale");for(i=0;i<this.a3;i++){a9=document.getElementById("spinmenu"+i+"");a9s=a9.style;if(this.isVertical){xi=parseInt(this.r*Math.cos(this.a1+i*this.pas))/this.s;yi=parseInt(this.r*Math.sin(this.a1+i*this.pas));a10=(this.p+xi)/(2*this.p);a11=this.fontsize*(this.p+xi)/(2*this.p)+2;a12=parseInt(100*(this.p+xi)/(2*this.p))}else{xi=parseInt(this.r*Math.cos(this.a1+i*this.pas));yi=parseInt(this.r*Math.sin(this.a1+i*this.pas))/this.s;a10=(this.p+yi)/(2*this.p);a11=this.fontsize*(this.p+yi)/(2*this.p)+2;a12=parseInt(100*(this.p+yi)/(2*this.p))};a13=(this.w-20)*a10+20;a14=(this.h-20)*a10+10;a9s.top=(yi+this.y-a14/2)+"px";a9s.left=(xi+this.x-a13/2)+"px";a9s.width=a13+"px";a9s.fontSize=a11+"px";a9s.zIndex=a12};a8.style.top=this.y+(this.isVertical?this.r:this.p)+this.h/2+6;a8.style.left=this.x-a8.offsetWidth/2;if(this.a1!=this.a2){this.a1=(this.a1>this.a2)?(this.a1-this.pas/this.v):(this.a1+this.pas/this.v);if(Math.abs(this.a1-this.a2)<this.pas/this.v)
this.a1=this.a2;setTimeout("stc_Menu.muta()",10)}},spinmenuclose:function(){this.pas=2*Math.PI/this.a3;

var gnMarginLeft = 0;
    if (BrowserDetect.browser != "Safari")
    {
	document.write ('<BR>');
    }
    if (BrowserDetect.browser != "Explorer")
    {
	gnMarginLeft = -20;
    }
    if (BrowserDetect.browser == "Chrome")
    {
    }
    if (BrowserDetect.browser == "Explorer")
    {
    }
    document.write('<div id="controale" style="color: #000088; border: 0px solid yellow; height: 10px; position:static; margin-left: ' + gnMarginLeft + 'px; margin-top: 20px;"><BUTTON type="" onclick="stc_Menu.a2+=stc_Menu.pas;stc_Menu.muta()" onfocus="this.blur()" style="cursor: hand; cursor: pointer; width: 30px; border: solid 3px #C0C0C0; -moz-border-radius: 08px; -webkit-border-radius: 08px; border-radius: 08px; behavior:url(/include/border-radius.htc); font-family: arial; font-size: 8pt; color:'+stc_Menu.color+';color: #000088; text-align: center;">'+gsLT_ARROW+gsLT_ARROW+'&nbsp;&nbsp;</BUTTON>&nbsp;&nbsp;&nbsp;&nbsp;<BUTTON type="" style="width: 30px; border: solid 3px #C0C0C0; -moz-border-radius: 08px; -webkit-border-radius: 08px; border-radius: 08px; behavior:url(/include/border-radius.htc); cursor: hand; cursor: pointer; font-family: arial; font-size: 8pt;color: #000088; " onclick="stc_Menu.a2-=stc_Menu.pas;stc_Menu.muta()" onfocus="this.blur()">'+gsRT_ARROW+gsRT_ARROW+'</BUTTON></div>');
    document.write('<div id="controale" style="color: #000088; border: 0px solid yellow; height: 10px; position:static; margin-left: ' + gnMarginLeft + 'px; margin-top: 20px;"><BUTTON type="" onclick="stc_Menu.a2+=stc_Menu.pas;stc_Menu.muta()" onfocus="this.blur()" style="cursor: hand; cursor: pointer; width: 30px; border: solid 3px #C0C0C0; -moz-border-radius: 08px; -webkit-border-radius: 08px; border-radius: 08px; behavior:url(/include/border-radius.htc); font-family: arial; font-size: 8pt; color:'+stc_Menu.color+';color: #000088; text-align: center;">'+gsLT_ARROW+gsLT_ARROW+'&nbsp;&nbsp;</BUTTON>&nbsp;&nbsp;&nbsp;&nbsp;<BUTTON type="" style="width: 30px; border: solid 3px #C0C0C0; -moz-border-radius: 08px; -webkit-border-radius: 08px; border-radius: 08px; behavior:url(/include/border-radius.htc); cursor: hand; cursor: pointer; font-family: arial; font-size: 8pt;color: #000088; " onclick="stc_Menu.a2-=stc_Menu.pas;stc_Menu.muta()" onfocus="this.blur()">'+gsRT_ARROW+gsRT_ARROW+'</BUTTON></div>');
    stc_Menu.muta()}};

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

//if (gbDebugMode == "T")
{
    document.write ('<CENTER>');
    document.write ('<TABLE border=1 style="color: #FFFFFF; background-color: #C0C0C0;font-size: 8pt;">');
    document.write ('<TR>');
    document.write ('<TD>');
    document.write ("Browser: " + BrowserDetect.browser);
    document.write ('</TD>');
    document.write ('<TD>');
    document.write ("Version: " + gsCSSVers);
    document.write ('</TD>');
    document.write ('<TD>');
    document.write ("Release: " + BrowserDetect.version.toString());
    document.write ('</TD>');
    document.write ('<TD>');
    document.write ("Width: " + gnCSSWidth);
    document.write ('</TD>');
    document.write ('<TD>');
    document.write ("Height: " + gnCSSHeight);
    document.write ('</TD>');
    document.write ('</TR>');
    document.write ('</TABLE>');
    document.write ('</CENTER>');
}

function spinMenu()
{
    stc_Menu.x = 380; // X - HORIZONTAL OFFSET FROM POINT OF INSERTION ON PAGE
    stc_Menu.y = 0; // Y - VERTICAL OFFSET FROM POINT OF INSERTION ON PAGE
    if (BrowserDetect.browser == "Opera")
    {
	stc_Menu.y = -180; // Y - VERTICAL OFFSET FROM POINT OF INSERTION ON PAGE
	stc_Menu.x = gnCSSWidth / 3 + 20; // X - HORIZONTAL OFFSET FROM POINT OF INSERTION
    }
    if (BrowserDetect.browser == "Chrome")
    {
	stc_Menu.y = -180; // Y - VERTICAL OFFSET FROM POINT OF INSERTION ON PAGE
	stc_Menu.x = gnCSSWidth / 3 + 20; // X - HORIZONTAL OFFSET FROM POINT OF INSERTION
    }
    if (BrowserDetect.browser == "Safari")
    {
	stc_Menu.y = -180; // Y - VERTICAL OFFSET FROM POINT OF INSERTION ON PAGE
	stc_Menu.x = gnCSSWidth / 3 + 20; // X - HORIZONTAL OFFSET FROM POINT OF INSERTION
    }
    if (BrowserDetect.browser == "Explorer")
    {
	gsCSSVers = BrowserDetect.version.toString();
	gsCSSVers = gsCSSVers.substring(0,1);
	if (gsCSSVers == "9")
	{
	    stc_Menu.y += 000; // Y - VERTICAL OFFSET FROM POINT OF INSERTION
	    stc_Menu.x = gnCSSWidth / 3; // X - HORIZONTAL OFFSET FROM POINT OF INSERTION
	}
	if (gsCSSVers == "8")
	{
	    stc_Menu.y += 000; // Y - VERTICAL OFFSET FROM POINT OF INSERTION
	    stc_Menu.x = gnCSSWidth / 3; // X - HORIZONTAL OFFSET FROM POINT OF INSERTION
	}
	if (gsCSSVers == "6")
	{
	    stc_Menu.y += 222; // Y - VERTICAL OFFSET FROM POINT OF INSERTION
	    stc_Menu.x = gnCSSWidth / 2; // X - HORIZONTAL OFFSET FROM POINT OF INSERTION
	}
        stc_Menu.y += 022; // Y - VERTICAL OFFSET FROM POINT OF INSERTION
    }
    stc_Menu.w = 200; // ITEM WIDTHS
    stc_Menu.h = 30; // HEIGHT
    stc_Menu.r = 200; // MENU'S RADIUS
    stc_Menu.v = 20; // VELOCITY
    stc_Menu.s = 8; // SCALE IN SPACE (FOR 3D EFFECT)

    stc_Menu.isVertical = 0; // VERTICAL=0 HORIZONTAL=1
    stc_Menu.fontweight = 'bold'; // BOLD=bold
    stc_Menu.textdecoration = 'none'; // ITALIC=italic
    stc_Menu.fontsize = 12; // FONT SIZE
    stc_Menu.fontfamily = 'Arial'; //font family
    stc_Menu.color = '#000088'; // NORMAL TEXT COLOR
    stc_Menu.backgroundcolor = '#D1C8B1'; // NORMAL BACKGROUND COLOR 
    stc_Menu.bordercolor = '#000088'; // BORDER COLOR
    stc_Menu.bordersize = 3; // BORDER WIDTH IN PX

    stc_Menu.colorover = '#0000FF'; // MOUSEOVER TEXT COLOR
    stc_Menu.backgroundcolorover = '#DFD8C6'; // MOUSEOVER BACKGROUND COLOR

    if (document.getElementById)
    {
	document.write('<div id="spinanchor" style="height:'+eval(stc_Menu.h+20)+'"></div>')
	stc_Menu.anchor=document.getElementById('spinanchor')
	stc_Menu.spinmenu();
	stc_Menu.x+=getposOffset(stc_Menu.anchor, "left") // RELATIVELY POSITION IT
	stc_Menu.y+=getposOffset(stc_Menu.anchor, "top")  // RELATIVELY POSITION IT

	// MENUITEM:   stc_Menu.spinmenuitem(text, link, target)
	stc_Menu.spinmenuitem("Web Hosting & Support","/services.php");
	stc_Menu.spinmenuitem("Photo Galleries & Videos","/gallery");
	stc_Menu.spinmenuitem("Web Site Development","/webdev.php");
	stc_Menu.spinmenuitem("E-mail & Webmail Services","stc_mail_help.php");
	stc_Menu.spinmenuitem("ECRS (EDI &amp; ETL) Support","/support.php");
	stc_Menu.spinmenuitem("News, Weblogs, Documents","news.html");
	stc_Menu.spinmenuclose();
    }
}

setInterval ("spinAuto()", 5000);

function spinAuto()
{
    stc_Menu.a2 += stc_Menu.pas;
    stc_Menu.muta();
}

