function emailHide(email, domain, display) {
 document.write('<a href=' + 'mail' + 'to:' + email + '@' + domain + '>' + display + '</a>');
}

function emailHideDisp(email, domain) {
 document.write('<a href=' + 'mail' + 'to:' + email + '@' + domain + '>' + email + '@' + domain + '</a>');
}


function openHelp(theURL){
	var help=window.open(theURL,'help','width=275,height=125,toolbar=no,location=no,directories=no,status=no,scrollbars=no,menubar=no,resizable=no,');
	help.focus();
}

function setSelected(row,id)
{
  if (row.className=="selected")
  {
    setRowAsUnSelected(row,id);
  }
  else {
    setRowAsSelected(row,id);
  }
}


function setRowAsSelected(row,id)
{
  strSnippetId="snippet-focused"
  strRowClass="selected";
  setRowStyles(row, strSnippetId, strRowClass,id);
}


function setRowAsUnSelected(row,id)
{
  strSnippetId=""
  strRowClass="";
  setRowStyles(row, strSnippetId, strRowClass,id);
}


function setRowStyles(row,strId,strClass,id)
{
  var table = d("products" + id);
  var x = getIndex(row,table);
  var snippet = table.getElementsByTagName("tr")[x+1];
  row.className= strClass;
  snippet.id= strId;
}


function getIndex(obj,container)
{
  for (var i=0;i<container.getElementsByTagName(obj.nodeName).length;i++)
  {
    if (container.getElementsByTagName(obj.nodeName)[i]==obj)
    {
      return i;
    }
  }
}

function d(s) {return document.getElementById(s);}



function toggle ( targetId ) {
	if (document.getElementById) {
		target = document.getElementById( targetId );
				if (target.style.display == 'none') {
						target.style.display = '';
				} else {
					target.style.display = 'none';
				}
	}
}

function toggleclass ( targetId ) {
	if (document.getElementById) {
		target = document.getElementById( targetId );
				if (target.className == 'plus') {
						target.className = 'minus';
				} else {
					target.className = 'plus';
				}
	}
}

function openExternal(theURL, width, height){
	var external=window.open(theURL,'external','width='+ width +',height='+ height +'');
	external.focus();
}

function P7_swapClass(){ //v1.4 by PVII
 var i,x,tB,j=0,tA=new Array(),arg=P7_swapClass.arguments;
 if(document.getElementsByTagName){for(i=4;i<arg.length;i++){tB=document.getElementsByTagName(arg[i]);
  for(x=0;x<tB.length;x++){tA[j]=tB[x];j++;}}for(i=0;i<tA.length;i++){
  if(tA[i].className){if(tA[i].id==arg[1]){if(arg[0]==1){
  tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];}else{tA[i].className=arg[2];}
  }else if(arg[0]==1 && arg[1]=='none'){if(tA[i].className==arg[2] || tA[i].className==arg[3]){
  tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];}
  }else if(tA[i].className==arg[2]){tA[i].className=arg[3];}}}}
}

