//-----------------------------------------------------------------------------
// file: spinmenu.js
// lib:
// desc: spin menu functions heavily modified for IE7, menu customization and multiple calls
// date: 2008/25/05
// auth: Rob Straughn <webmaster@omnisoft.net> inital concept: Irina, thanks! :)
// copy: (c) Copyright 2008 OmniSoft.

//EYEspin_dhtml (c) Petre Stefan
//email: eyecon@eyecon.ro
//website: www.eyecon.ro
//Modified by JavaScriptKit.com for relative positioning of menu
//please leave this copyright notice intact


//offsetWidth
//http://www.javascriptkit.com/domref/elementproperties.shtml
//offsetWidth * -1); /* Fix for IE7 */
//-----------------------------------------------------------------------------

<!--   


eye={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:pointer;cursor:expression(\"hand\");position:absolute;width:"+this.w+"px;left:"+this.h+"px;"+"background-color:"+this.backgroundcolor+";color:"+this.color+";border-right:"+this.borderright+";font:normal "+this.fontsize+"px "+this.fontfamily+";text-align:center;cursor:default;z-Index:1000;' onmouseover='this.style.color=\""+this.colorover+"\";this.style.backgroundColor=\""+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("eye.muta()",10)}},spinmenuclose:function(){this.pas=2*Math.PI/this.a3;document.write('<div id="controale" style="position:absolute"><button type="" onclick="eye.a2+=eye.pas;eye.muta()" onfocus="this.blur()">&lt;&lt;</button> <button type="" onclick="eye.a2-=eye.pas;eye.muta()" onfocus="this.blur()">&gt;&gt;</button></div>');eye.muta()}};

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 spin(menu)
//spin it
{

var searchUrl ="http://www.acidmerch.com/mm5/merchant.mvc?Store_Code=N&Screen=SRCH&Search=";
var linksArr = new Array(
			'A','B','C','D','E','F','G','H',
			'I','J','K','L','M','N','O','P',
			'Q','R','S','T','U','V','W','X',
			'Y','Z' 
			);
var linksNum  = 10 ;  //Number of links 
var direction = 0;   //if it's vertical or horizontal [0|1]
var styles    =  "border-right: solid #999933 5px; " +
                 "height:'+eval(eye.h+20)+'";




eye.isVertical = direction;   //if it's vertical or horizontal [0|1]
eye.x = 175;         // x offset from point of insertion on page 150
eye.y = 375;           // y offset from point of insertion on page
eye.w = 50;         // item's width
eye.h = 40;          // height
eye.r = 150;          // menu's radius
eye.v = 20;          // velocity, smaller is faster
eye.s = 8;           // scale in space (for 3D effect)
eye.color               = '#303030';  // normal text color
eye.colorover           = '#ffffff';  // mouseover text color
eye.backgroundcolor     = '#808000';  // normal background color 
eye.backgroundcolorover = '#990000';  // mouseover background color
//eye.bordercolor       = '#000000';  // border color
eye.borderright         = 'solid #999933 5px';
eye.fontsize            = 16;         // font size
eye.fontfamily          = 'Arial';    // font family


//Make changes based on which style
if (menu == "1"){       //this is a-z menu changes
  //alert('a-z');
  eye.w         = 70;   // item's width
  eye.v         = 5;    // velocity, smaller is faster
  linksNum = 26 ;
}



if (window.XMLHttpRequest) {
  // IE 7, mozilla, safari, opera 9
   //alert('IE 7, mozilla, safari, opera 9');
   //return false;
} else {
  //alert('IE6, older browsers');
  // IE6, older browsers
}

if (document.getElementById){
  document.write('<div id="spinanchor" style='+styles+'></div>')
  eye.anchor=document.getElementById('spinanchor')
  eye.spinmenu();
  eye.x+=getposOffset(eye.anchor, "left") //relatively position it
  eye.y+=getposOffset(eye.anchor, "top")  //relatively position it
  //menuitem:   eye.spinmenuitem(text, link, target)

  //2 menus for now
  if (menu == "1" ){                                                  //A-Z
    for (var i =0; i < linksNum; i++){
      eye.spinmenuitem(linksArr[i],searchUrl+linksArr[i]);
    } 
  }
  else {                                                              //categories
    eye.spinmenuitem("T-Shirts","/c/TEESHIRTS0001A/T-Shirts.html");
    eye.spinmenuitem("Girly Tops","/c/WOMTO0002A/Womens+Shirts.html");
    eye.spinmenuitem("Hoodies","/c/Hood0001A/Hoodies.html");
    eye.spinmenuitem("Long Sleeves","/c/LONSLEEV/Longsleeves.html");
    eye.spinmenuitem("New Releases","/c/New0001A/New+Products.html");
    eye.spinmenuitem("Accessories","/c/New0001A/New+Products.html");
  }

  eye.spinmenuclose();

}

} //end function


//-->    

//-----------------------------------------------------------------------------
// end of spinmenu.js
//-----------------------------------------------------------------------------
