var mycarousel_itemList = [
	{link: 'http://www.arraynetworks.net/', url: 'images/logos/array_networks.jpg', title: 'array networks'},
	{link: 'http://www.hp.com/', url: 'images/logos/hp_logo.jpg', title: 'hp logo'},
	{link: 'https://partner.microsoft.com/40013031', url: 'images/logos/ms_gold_logo.jpg', title: 'Microsoft Gold Partners'},
	{link: 'http://www.cisco.com/', url: 'images/logos/cisco_logo.jpg', title: 'cisco systems'},
	{link: 'http://www.lexmark.com/', url: 'images/logos/lexmark_logo.jpg', title: 'lexmark dealer'},
	{link: 'http://www.apple.com', url: 'images/logos/apple_logo.jpg', title: 'apple dealer'},
	{link: 'http://us.trendmicro.com/us/home/index.html', url: 'images/logos/trend_micro.jpg', title: 'trend micro dealer'},
	{link: 'http://www.dell.com/', url: 'images/logos/dell_logo.jpg', title: 'dell dealer'},
	{link: 'http://www.apc.com/', url: 'images/logos/apc_logo.jpg', title: 'apc dealer'},
	{link: 'https://partner.microsoft.com/40021525', url: 'images/logos/ms_small_business.jpg', title: 'microsoft small business'},
	{link: 'http://www.avg.com/us-en/homepage', url: 'images/logos/avg_logo.jpg', title: 'AVG Security Software'},
	{link: 'http://www.wdc.com/en/', url: 'images/logos/western_digital_logo.jpg', title: 'western digital dealer'},
	{link: 'http://www.sonicwall.com/', url: 'images/logos/sonicwall_logo.jpg', title: 'sonic wall dealer'}
];

function mycarousel_itemVisibleInCallback(carousel, item, i, state, evt) {
	// The index() method calculates the index from a
	// given index who is out of the actual item range.
	var idx = carousel.index(i, mycarousel_itemList.length);
	carousel.add(i, mycarousel_getItemHTML(mycarousel_itemList[idx - 1]));
};

function mycarousel_itemVisibleOutCallback(carousel, item, i, state, evt) {
	carousel.remove(i);
};

/*
  Item html creation helper.
 */
function mycarousel_getItemHTML(item) {
	return '<a style="text-decoration: none;" href="' + item.link + '" target="_blank"><img src="' + item.url + '" width="95" height="95" alt="' + item.title + '" border="none" /></a>';
};

$(document).ready(function() {
	jQuery('#mycarousel').jcarousel({
		auto: 5,
		wrap: 'circular',
		itemVisibleInCallback: {onBeforeAnimation: mycarousel_itemVisibleInCallback},
		itemVisibleOutCallback: {onAfterAnimation: mycarousel_itemVisibleOutCallback}
	});
});
    

// rollovers
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


/* for new window
window.onload = initWindows;

function initWindows() {
    if (document.getElementById("resultsV")) {
        document.getElementById("resultsV").onchange = updateParent;
    } else {
        newWindow = window.open("child.html", "newWin", "status=yes, width=450, height=450");
    }
}

function updateParent() {
    opener.document.getElementById("msgline").value = "You have selected " + this.value + "options. Please fill out the form and let an Ananke professional consoult with you.";
}

// for checkboxes
function chkResultsV(){
            v=0
            myForm=document.cust_info
            for(var i=0;i<myForm.length;i++){
                if(myForm.elements[i].type=="checkbox"&&myForm.elements[i].checked){
                    v++
                }
            }
            myForm["resultsV"].value=v
        }
*/


//for dreamweaver form validation
<!--
    function MM_validateForm() { //v4.0
      if (document.getElementById){
        var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
        for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
          if (val) { nm=val.name; if ((val=val.value)!="") {
            if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
              if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
            } else if (test!='R') { num = parseFloat(val);
              if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
              if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
                min=test.substring(8,p); max=test.substring(p+1);
                if (num<min || max<num) errors+='- '+nm+' must conatin a valid phone number.\n';
          } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
        } if (errors) alert('The following error(s) occurred:\n'+errors);
        document.MM_returnValue = (errors == '');
    } }
//-->  

/*
Copyright Justin Whitford 2006.
  http://www.whitford.id.au/
Perpetual, non-exclusive license to use this code is granted
on the condition that this notice is left in tact.
*/
var delim = '|';
var trailLength = 5;
var chunks;
var DAY = 24 * 60 * 60 * 1000;

function doCrumbs(){
  if(cookieTest('xxx')){
    crumbList = new CrumbList();
    if(getCookie('trailLinks')){
      var staleLinkCrumbs = getCookie('trailLinks').split(delim);
      var staleTextCrumbs = getCookie('trailText').split(delim);
      var startPos=
        (staleTextCrumbs.length<trailLength ||
        document.location==staleLinkCrumbs[staleLinkCrumbs.length-1])
        ?0:1;
      for(i=startPos;i<staleLinkCrumbs.length;i++){
        crumbList.add(staleLinkCrumbs[i],staleTextCrumbs[i]);
      }
    }
    if(document.location!=crumbList.links[crumbList.links.length-1]){
      crumbList.add(document.location,document.title);
    }
    setCookie('trailLinks',crumbList.links.join(delim),1);
    setCookie('trailText',crumbList.text.join(delim),1);
    crumbList.output();
  }
}


function CrumbList(){
  this.links=new Array();
  this.text=new Array();
  this.add = crumbListAdd;
  this.output = crumbListShow;
}
  function crumbListAdd(href,text){
    this.links[this.links.length]=href;
    this.text[this.text.length]=text;
  }
  function crumbListShow(){
    for(var i in this.links){
      if(i==this.links.length-1){
        document.write( ((i==0)?"":" | ") + this.text[i] );
      }else{
        document.write(
          ((i==0)?"":" | ")
          +"<a href='" + this.links[i] + "'>"
          + this.text[i] + "</a>"
        );
      }
    }
  }


function cookieTest(name){
  try{
    setCookie(name,'true',1);
    chunks = document.cookie.split("; ");
    return (getCookie(name)=='true');
  }catch(e){
    return false;
  }
}

function getCookie(name) {
  var returnVal = null;
  for (var i in chunks) {
    var chunk = chunks[i].split("=");
    returnVal = (chunk[0] == name)
      ?unescape(chunk[1])
      :returnVal;
  }
  return returnVal;
}

function setCookie(name, value, days) {
  if (value != null && value != "" && days > 0){
    var expiry=
      new Date(new Date().getTime() + days * DAY);
    document.cookie=
      name +"="+ escape(value) +"; expires="
      + expiry.toGMTString();
    chunks = document.cookie.split("; ");
  }
}