function allcat(){
	
	 /** Edit by Hi-Tech Solutions */
  var br = getBrowser();
  if ($('allcats').visible()){
    $('allcats').hide();
    $('tnpath').show()
	if(br!='ff')
	{
		
		if(document.getElementById('flashMovie'))
		{
			$('flashMovie').show();
			$('tnfind_f').show();
			$('tnhome').show();
			$('tnbright').show();
		}
		
	}
  } else 
  {
    $('allcats').show();
    $('tnpath').hide();
	if(br!='ff' )
	{	
		if(document.getElementById('flashMovie')!=null)
		{
			$('flashMovie').hide();
			$('tnfind_f').hide();
			$('tnhome').hide();
			$('tnbright').hide();
		}
		
	}
  }
  
  /** End of Edit */
  $('tnmore').toggleClassName('tnsel');
  
  
}
 /** Edit by Hi-Tech Solutions */
function getBrowser()
{
 	var navig_agt=navigator.userAgent.toLowerCase();
	
	var navig_fox=(navig_agt.indexOf("firefox")!=-1);
	var navig_ie=((navig_agt.indexOf("msie")!=-1) && (navig_agt.indexOf("opera")==-1));
	var navig_ie5=(navig_ie && (navig_agt.indexOf("msie 5.")!=-1));
	var navig_ie6=(navig_ie && (navig_agt.indexOf("msie 6.")!=-1));

	if(navig_fox)
	{
		return 'ff';
	}else if(navig_ie6 || navig_ie5)
	{ 
		return 'ie6';
	}else
	{
		return 'ie6';
	}
}

 /** End of Edit */


function Highlight(el){
  new Effect.Highlight(el, {duration: 2});
  new Effect.Highlight('cartc', {duration: 2});
}

function addtocart($qtyel, $id, $enote, $eport){
  if ($enote != ''){
    $note = $($enote).value;
  } else {
    $note = '';
  }
  if ($eport != ''){
    $port = $($eport).value;
  } else {
    $port = '';
  }
  if ($($qtyel).value == '0' || $($qtyel).value == ''){
    new Ajax.Updater('cartc', 'rpc/cart.php', {
      parameters: { 'qty': $F($qtyel), 'pid': $id, 'note':$note, 'port':$port}
    });
  } else {
    new Ajax.Updater('cartc', 'rpc/cart.php', {
      parameters: { 'qty': $F($qtyel), 'pid': $id, 'note':$note, 'port':$port},
      onComlete: Highlight($qtyel)
    });
  }
}

function sudo($uid){
  document.location.href = '?suid='+$uid;
}

function tb(t, trg){
  t = $(t);
  ul = t.parentNode.parentNode;
  childs = $(ul.id).childElements()
  childs.each(function(item){
    item.removeClassName('ptsel');
  });
  t.parentNode.addClassName('ptsel');
  tp = t.parentNode.parentNode.parentNode.parentNode;
  childs = $(tp).childElements();
  childs.each(function(item){
    if (item.hasClassName('tcnt')){
      if (item.id == trg){
        item.show();
      } else {
        item.hide();
      }
    }
  });
}
function compare(form, cont1, cont2){
  frm = $(form);
  chb = frm.getInputs('checkbox');
  new Ajax.Updater(cont2, 'rpc/comp.php', {
    parameters: frm.serialize()
  });
  $(cont2).innerHtml = '';
  $(cont1).hide();
  $(cont2).show();
}

function cback(cont1, cont2){
  $(cont1).show();
  $(cont2).hide();
}
function newmsg(frm, divid, valid){
  new Ajax.Updater(divid, 'rpc/newmsg.php', {
    parameters: $(frm).serialize()+'&ajax=1'
  });
  return false;
}
/** AIP Solution code starts */
/*MSS - added and not used
function newfile(frm, divid, valid){
  new Ajax.Updater(divid, 'rpc/newfile.php', {
    parameters: $(frm).serialize()+'&ajax=1'
  });
  return false;
}
*/
function openPage(phpPage,w,h){
	var pageW=(w)?w:825;
	var pageH=(h)?h:525;
	myWin = window.open (phpPage,'myWin','location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+pageW+',height='+pageH);
	if (window.focus) {myWin.focus()};
}
/** AIP Solution code ends */

