/*function TabNavi(currentIndex) {
  
  var htmlOutput ='<ul class="pagetabs">'+"\n\r";
          <li class="pagetabs_large">
            <a href="/A4164325">Main</a></li>
          <li class="pagetabs_normal" >
            <a href="">How to</a></li>
          <li class="pagetabs_normal">
            <a href="/A4164326">Demos</a></li>
          <li class="pagetabs_normal" id="active_pagetab">
            <a href="allsoftware_n93.html">Software</a></li>
          <li class="pagetabs_normal">
            <a href="accessories_n93.html">Search and solve</a></li>
          <li class="pagetabs_active">
     <a href="tips_n93.html">Tips &amp; tricks</a></li>
          <li class="pagetabs_active" >
            <a href="techspecn93.html" id="last_tab">Specifications</a></li>
    
        </ul>

}*/

function ArrowToggle(toggleButton, itemBoxId) {

  var itemBox = document.getElementById(itemBoxId);
  
  if(typeof toggleButton == 'object' &&  itemBox != null ) {

  var buttonClasses = new Array();
  buttonClasses = toggleButton.className.split(" ");
  var classNum = buttonClasses.length;
    if(itemBox.style.display == 'none' ) {
      itemBox.style.display = 'block';
      for(i = 0; i< classNum; i++) {
        if(buttonClasses[i] == 'arrowbullet-side' ) 
          { buttonClasses[i] = 'arrowbullet-down' }
      }
      
    } else {
        itemBox.style.display = 'none';
        for(i = 0; i< classNum; i++) {
        if(buttonClasses[i] == 'arrowbullet-down' ) 
          { buttonClasses[i] = 'arrowbullet-side' }
      }
      
    }
  toggleButton.className = buttonClasses.join(' ');
  
  }
}


/*
function FauxMenu(toggleButton, itemBoxId) {
//toggleButton should be "this" if function is used on the actual button.
  var itemBox = document.getElementById(itemBoxId);
  if(typeof toggleButton == 'object' && typeof itemBox == 'object') {
  
    if(itemBox.style.display == 'none' ) {
      itemBox.style.display = 'block';
      toggleButton.className = 'arrowbullet-down';
      
    } else {
        itemBox.style.display = 'none';
      toggleButton.className = 'arrowbullet-side';
    }
  }

}
*/
function GetCleanID() {
     return ( location.hash.substr(1,location.hash.length) );
}

function ToggleAllTechSpecs() {
  //get all divs with the id 'tobblebox'
  var allDivs = document.getElementsByTagName('div');
  var allBoxes = '';
  for(i = 0; i<allDivs.length; i++) {
  
    if(allDivs[i].className == 'togglebox') {
      //alert(allDivs[i].id);
  //and put their id's to one string
      allBoxes = allBoxes +','+allDivs[i].id;
    }
  }
  
  //allBoxes = allBoxes.substr(1, allBoxes.length); //remove extra , from the beginning
   
  //MultiBoxToggle(allBoxes,'',1);
  }

function MultiBoxToggle(idlist,  exceptionList, dirNum ) {

//hides the elements defined in "idlist" string list;
//exceptions defined in exceptionList
// example: HideBox('me,oh,my','me') would hide id's 'oh' and 'my' and show id 'me'
// no spaces are allowed in the id list ('id1, id2, id3 , id4 ') will not work
// if an id is requested using has url hash (www.blaah.net/index.html#myid)
//that id is included in th exceptionlist

var dispValues = new Array('none', 'block');
var requestID = GetCleanID();
var exceptions = exceptionList.split(',')

//if an id was requested, add it to the exception list
if(requestID.length > 0 ) {
var temp = exceptions.join(',');
temp = temp + ',' + requestID;
exceptions = temp.split(',');
}

  var allBoxes = idlist.split(',')
  var box = '';
  var numOfBoxes = allBoxes.length;
  for (i = 0; i < numOfBoxes; i++) { //lets loop throught all the boxes we want to hide
      //alert(allBoxes[i])
      var showthis = false; //exception marker is reset for each iteration
          for( x in exceptions) { //lets see if this id is in the exception list
          if(exceptions[x] == allBoxes[i]) {
            
            if(exceptions[x] == requestID && requestID.length > 0) { //double check the requestID (otherwise errors occur) 
              var rqbox = document.getElementById(exceptions[x]);
              if(rqbox != null) {
              rqbox.previousSibling.previousSibling.className ='arrowbullet-down arrowbullet';
              }
              //alert(rqbox.innerHTML);
              //alert(rqbox.previousSibling.previousSibling.innerHTML);
            }
            
            var showthis = true;//if this id is in exception list exception marker becomes true;
            break; // and we can quit the inner loop since ID's are unique.
            
          } 
        }
      if(showthis !== true) {
        //if this id was not in exception list, lets hide it...
        var box = document.getElementById(allBoxes[i]);
        if(box !== null ) {
        //error resistance check, in case given id does not exist in the document;
          box.style.display = dispValues[dirNum];
        }
      }
  }
  
}


function BoxToggle(toggleButton, itemBoxId) {
//toggleButton should be "this" if function is used on the actual button.
  var itemBox = document.getElementById(itemBoxId);
  if(typeof toggleButton == 'object' && typeof itemBox == 'object') {
    
    if(itemBox.style.display == 'none' ) {
      itemBox.style.display = 'block';
      toggleButton.className = 'boxOpen';
      toggleButton.innerHTML = 'Close'
      
    } else {
      itemBox.style.display = 'none';
      toggleButton.className = 'boxClosed';
      toggleButton.innerHTML = 'View'
  
    }
  }

}


function ScrollUp() {
  window.scrollBy(0,-150);
}

/*
function ToggleAllBoxes(button, dir ) {
//hard coded function that hides or shows all boxes in techspecs
dir = String(dir);
var funcCall = 'javascript:ToggleAllBoxes(this,';
var hide = 'Hide All';
var show = 'View All';
var allBoxes = new Array('voice','frequencies','imaging','display','messaging','games','ringtones','multimedia','browsing','pushtotalk','other','sportmusic','standard_edition','power','data','java', 'memfunc','connectivity','reldocs');
var numOfBoxes = allBoxes.length;
  switch ( dir ) {
  case '1':
  //alert (dir); //(debugger) 
  for (i = 0; i < numOfBoxes; i++) {
    var box = document.getElementById(allBoxes[i]); 
    box.style.display = 'block';
  }
    button.innerHTML = hide;
    button.onclick = funcCall + "'0')";
  break;
  
  case '0' :
  //alert (dir); //(debugger)
  for (i = 0; i < numOfBoxes; i++) {      
    var box = document.getElementById(allBoxes[i]);
    box.style.display = 'none';
   } 
    button.innerHTML = show;
    button.onclick = funcCall + "'1')";
  break;

  default:
  }
  //alert ( button.onclick );
}


function FlashBox() {

    var flashVar = '&NSSviewallphones=1';  
    var flashBox = document.getElementById('flashContainer');
    var flashObjectArray = new Array(); 
    flashObjectArray[0] = '<object type="application/x-shockwave-flash" data="flashmovies/ss/sshome.swf" width="756" height="500">';
    flashObjectArray[1] ='<param name="movie" value="flashmovies/ss/sshome.swf" />';
    flashObjectArray[2] ='<param id="flashvars" name="flashvars" value="configPath=data/ssconfig.xml" />';
    flashObjectArray[3] ='</object>';
    
    if(window.location.hash == '#all') {
    //alert(window.location.hash );
    flashObjectArray[2] ='<param id="flashvars" name="flashvars" value="configPath=data/ssconfig.xml'+ flashVar +'" />';
    
    }
  
    flashBox.innerHTML = flashObjectArray.join(" "); 
   
}
*/

function windowOpener_custom(url,name,toolbar,width,height,status,scrolls,resizeable) {
	browserName = navigator.appName;
	browserVer = navigator.appVersion.substring(0,1);
	if (width==null) {width=450;}
	if (height==null) {height=400;}
	if (name==null) {name="globaltPopup"}
	if (browserName != "Netscape" || browserVer != 2) { 
	    window.open(url,name,"toolbar="+toolbar+",height="+height+",width="+width+",location=no,directories=no,status="+status+",menubar=no,scrollbars="+scrolls+",resizable="+resizeable);
	}
}

