/* MISC. UTILITY SCRIPTS */

/* Function to open popup window */
/*
  USAGE IN PHP:
  onclick="openBrWindow(\'somepage.php\',\'somefWin\',\'left=20,top=20,width=620,height=390,toolbar=0,resizable=0,scrollbars=0,status=0\');"
*/

function openBrWindow(theURL,winName,features) { //v2.0
      	winContent = window.open(theURL,winName,features);
	winContent.focus();
}
	
/* 
================================================================================ 
 */

/* Another function to open popup window */
function popup_window( url, id, width, height )
   {
       //extract the url parameters if any, and pass them to the called html
       var tempvar=document.location.toString(); // fetch the URL string
       var passedparams = tempvar.lastIndexOf("?");
       if(passedparams > -1)
          url += tempvar.substring(passedparams);
      popup = window.open( url, id, 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,left=5,top=0,width=' + width + ',height=' + height + '' );
      popup.focus();
    }
/*
================================================================================
*/
/* Function to Show-Hide Content in page  */
function showHide(shID) {
    if (document.getElementById(shID))
        {
            if (document.getElementById(shID+'-show').style.display != 'none')
                {
                    document.getElementById(shID+'-show').style.display = 'none';
                    document.getElementById(shID).style.display = 'block';
        	    }
            else
                {
                    document.getElementById(shID+'-show').style.display = 'inline';
            	    document.getElementById(shID).style.display = 'none';
        	    }
    	    }
	    }
/* 
================================================================================
*/

function muddleAdr() {
      var blockString = "!iTs-noTNIcE2ssSSsPpPaaMm!";
      var dmn = new Array('com','.','mail','gn@g','desi','rowe').reverse().toString();
      dmn = dmn.replace(/\,/g,'').replace(/(x)/g,'le$1');
      var dest = dmn;
      dest = dest.split(blockString);
      dest = dest.join("@");
      window.open ('mailto:'+dest,'_blank');
	  return false;
   }

/*
   USAGE:
  <a href="javascript://" onClick="muddleAdr('!iTs-noTNIcE2ssSSsPpPaaMm!');return false">E-mail sales</a>
*/
