function addEvent(obj, evType, fn){ 
 if (obj.addEventListener){ 
   obj.addEventListener(evType, fn, false); 
   return true; 
 } else if (obj.attachEvent){ 
   var r = obj.attachEvent("on"+evType, fn); 
   return r; 
 } else { 
   return false; 
 } 
}

function org(domain, extension, anchor_text, classz)
{
	var site='';
	var address='';
	site = 'http://www.' + domain + '.' + extension;
	address = '<a href="' + site + '" class="' + classz + '">' + anchor_text + '</a>';
	document.write(address);
	return false;
}

function org3(domain, extension, classz)
{
	var site='';
	var address='';
	site = 'http://www.' + domain + '.' + extension;
	address = '<a href="' + site + '" class="' + classz + '">';
	document.write(address);
	return false;
}

function org3end()
{
	document.write('</a>');
}

function showSeal()
{
	var url = 'https://www.digicert.com/custsupport/sspopup.php?order_id=10000001&hostname=http%3A%2F%2Fwww.digicert.com%2Fwelcome%2Fssl-plus.htm';
	makePopup(url,'oo',480,525);
}

function HttpRequest(url){
var pageRequest = false //variable to hold ajax object
/*@cc_on
   @if (@_jscript_version >= 5)
      try {
      pageRequest = new ActiveXObject("Msxml2.XMLHTTP")
      }
      catch (e){
         try {
         pageRequest = new ActiveXObject("Microsoft.XMLHTTP")
         }
         catch (e2){
         pageRequest = false
         }
      }
   @end
@*/

if (!pageRequest && typeof XMLHttpRequest != 'undefined')
   pageRequest = new XMLHttpRequest()

if (pageRequest){ //if pageRequest is not false
   pageRequest.open('GET', url, false) //get page synchronously 
   pageRequest.send(null)
   embedpage(pageRequest)
   }
}

function embedpage(request){
//if viewing page offline or the document was successfully retrieved online (status code=2000)
if (window.location.href.indexOf("http")==-1 || request.status==200)
   document.write(request.responseText)
}

function makePopup(wurl,wname,width,height)
{
	var ww = screen.width;
	var hh = screen.height;
	var left = (ww - width) / 2;
	var top = (hh - height) / 2;
	var theWindow = window.open(wurl,wname,"dependent=1,height="+height+",width="+width+",left="+left+",top="+top+",location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0");
	theWindow.focus();
}

function makeFullPopup(wurl,wname,width,height)
{
	var ww = screen.width;
	var hh = screen.height;
	var left = (ww - width) / 2;
	var top = (hh - height) / 2;
	var theWindow = window.open(wurl,wname,"dependent=0,height="+height+",width="+width+",left="+left+",top="+top+",location=1,menubar=1,resizable=1,scrollbars=1,status=1,toolbar=1");
    theWindow.focus();
}

function currencyFormatted(amount)
{
	var q = new String(amount);
	//amount = amount.replace(/\D+/g, '');
	//amount = amount.replace(/\D*/g, '');
	q = q.replace(/[^0-9\.]*/g, '');
	q = q.replace(/[^0-9\.]+/g, '');
	var s = Math.round(q);
	return s;
}

function currencyFormattedNoRound(amount)
{
	var q = new String(amount);
	//amount = amount.replace(/\D+/g, '');
	//amount = amount.replace(/\D*/g, '');
	q = q.replace(/[^0-9\.]*/g, '');
	q = q.replace(/[^0-9\.]+/g, '');
	return q;
}

function currencyFormattedRound2(amount)
{
	var q = new String(amount);
	//amount = amount.replace(/\D+/g, '');
	//amount = amount.replace(/\D*/g, '');
	q = q.replace(/[^0-9\.]*/g, '');
	q = q.replace(/[^0-9\.]+/g, '');
	var s = Math.round(q * 100) / 100;
	return s;
}

function forgotPassword()
{
	makePopup('/custsupport/pass-forgot.php','forgotpass',500,500);
}

//Function to trim a string
String.prototype.trim = function()
{
	var retstr = this.replace(/^\s+/,"");
	retstr = retstr.replace(/\s+$/,"");
	return retstr;
}







