//Entry Rules
var dcTelephone = "()+- 0123456789.";
var dcUserName  = "._0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
var dcInt       = "0123456789";
var dcNum       = ".0123456789";
var dclink		= "._0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz<>/";

sfHover = function()
{
	if(document.getElementById("nav"))
	{
		var sfEls = document.getElementById("nav").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++)
		{
			sfEls[i].onmouseover=function()
			{
				this.className += ' sfhover';
			}
			sfEls[i].onmouseout=function()
			{
				this.className = this.className.replace(' sfhover','');
			}
		}
	}
}
var theBrowser = new BrowserDetect();
if (window.attachEvent) window.attachEvent("onload", sfHover);
//if (window.attachEvent && !theBrowser.isIE7up) window.attachEvent("onload", sfHover);

function forgotPassword()
{
	makePopup('/custsupport/pass-forgot.php','forgotpass',500,500);
}

function loadDBX(sessionId,containerId)
{
	//initialise the docking boxes manager
	var manager = new dbxManager(sessionId);
	
	//onstatechange fires when any group state changes
	manager.onstatechange = function()
	{
		return true;
	};
	
	//onboxdrag fires while the mouse drags a box,
	//or when the keyboard initiates a move
	manager.onboxdrag = function()
	{
		return true;
	};
	
	//onboxopen fires when a box is opened
	manager.onboxopen = function()
	{
		return true;
	};
	
	//onboxclose fires when a box is closed
	manager.onboxclose = function()
	{
		return true;
	};
	//create new docking boxes group
	var purple = new dbxGroup(
		containerId,       // container ID [/-_a-zA-Z0-9/] 
		'vertical',     // orientation ['vertical'|'horizontal']
		'7',            // drag threshold ['n' pixels]
		'yes',           // restrict drag movement to container axis ['yes'|'no']
		'10',           // animate re-ordering ['n' frames per transition]
		'yes',          // include open/close toggle buttons ['yes'|'no']
		'open',         // default state ['open'|'closed']
		
		'open',         // word for "open", as in "open this box"
		'close',        // word for "close", as in "close this box"
		'Click and drag to move this box', // sentence for "move this box" by mouse
		'Click to %toggle% this box', // pattern-match sentence for "(open|close) this box" by mouse
		'Use the arrow keys to move this box', // sentence for "move this box" by keyboard
		', or press the enter key to %toggle% it', // pattern-match sentence-fragment for "(open|close) this box" by keyboard
		'%mytitle%  [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts
		);
}

function generateResellerSealCode(frm,acct_id,HOST_ADDRESS,valid_till,site_seal_link)
{
	var full_type = "type=acct&amp;acct_id=" + acct_id;
	var min_type = acct_id;
	var seal_size = 'large';
	if(frm.seal_size[1].checked)
	{
		seal_size = 'small';
	}
	var seal_type = 'a';
	if(frm.rColor[1].checked)
	{
		seal_type = 'b';
	}
	else if(frm.rColor[2].checked)
	{
		seal_type = 'c';
	}

	var align = 'left';
	if(frm.rAlign[1].checked)
	{
		align = 'center';
	}
	else if(frm.rAlign[2].checked)
	{
		align = 'right';
	}

	var margin = frm.sMargin[frm.sMargin.selectedIndex].value + ' ' + (align == 'left' || align == 'center' ? 'auto' : frm.sMargin[frm.sMargin.selectedIndex].value) + ' ' + frm.sMargin[frm.sMargin.selectedIndex].value + ' ' + (align == 'right' || align == 'center' ? 'auto' : frm.sMargin[frm.sMargin.selectedIndex].value);

	var ssCode = '<' + '!-- BEGIN DigiCert Reseller Seal Code -->';
	//ssCode += '<' + 'div id="digicertsitesealcode" style="width: ' + (seal_size == 'small' ? '65px' : '81px') + '; margin: ' + margin + ';" align="center">';
	ssCode += '<' + 'script language="javascript" type="text/javascript" src="' + HOST_ADDRESS + 'custsupport/sealtable.php?' + full_type + '&amp;seal_type=' + seal_type + '&amp;seal_size=' + seal_size +'&amp;align=' + align + '&amp;margin=' + margin + '">';
	ssCode += '<' + '/script>';
	if(seal_size == 'small')
	{
		//ssCode += '<' + 'a href="http://www.digicert.com">SSL</a> Reseller';
		ssCode += site_seal_link;
	}
	else
	{
		ssCode += site_seal_link;
	}
	ssCode += '<' + 'script language="javascript" type="text/javascript">coderz();';
	ssCode += '<' + '/script>';
	//ssCode += '<' + '/div>';
	ssCode += '<' + '!-- END DigiCert Reseller Seal Code -->';
	
	frm.taSSCode.value = ssCode;
}

function generateSSCode(frm,order_id,HOST_ADDRESS,valid_till,site_seal_link,site_seal_link_url)
{
	var full_type = "order_id=" + order_id;
	var min_type = order_id;
	var seal_size = 'large';
	if(frm.seal_size[1].checked)
	{
		seal_size = 'small';
	}
	var seal_type = 'a';
	if(frm.rColor[1].checked)
	{
		seal_type = 'b';
	}
	else if(frm.rColor[2].checked)
	{
		seal_type = 'c';
	}
	
	var seal_color = 'blue';
	if(frm.sealColor && frm.sealColor[1].checked)
	{
		seal_color = 'green';	
	}

	var align = 'left';
	if(frm.rAlign[1].checked)
	{
		align = 'center';
	}
	else if(frm.rAlign[2].checked)
	{
		align = 'right';
	}

	var margin = frm.sMargin[frm.sMargin.selectedIndex].value + ' ' + (align == 'left' || align == 'center' ? 'auto' : frm.sMargin[frm.sMargin.selectedIndex].value) + ' ' + frm.sMargin[frm.sMargin.selectedIndex].value + ' ' + (align == 'right' || align == 'center' ? 'auto' : frm.sMargin[frm.sMargin.selectedIndex].value);

	var ssCode = '<' + '!-- BEGIN DigiCert Site Seal Code -->';
	ssCode += '<' + 'div id="digicertsitesealcode" style="width: ' + (seal_size == 'small' ? '65px' : '81px') + '; margin: ' + margin + ';" align="center">';
	ssCode += '<' + 'script language="javascript" type="text/javascript" src="' + HOST_ADDRESS + 'custsupport/sealtable.php?' + full_type + '&amp;seal_type=' + seal_type + '&amp;seal_size=' + seal_size + '&amp;seal_color=' + seal_color + '&amp;new=1';
	if(seal_size == 'small')
	{
		ssCode += '&amp;newsmall=1';	
	}
	ssCode += '">';
	ssCode += '<' + '/script>';
	if(seal_size == 'small')
	{
		//ssCode += '<' + 'a href="' + site_seal_link_url + '">SSL</a>';
		ssCode += site_seal_link;
	}
	else
	{
		ssCode += site_seal_link;
	}
	ssCode += '<' + 'script language="javascript" type="text/javascript">coderz();';
	ssCode += '<' + '/script>';
	ssCode += '<' + '/div>';
	ssCode += '<' + '!-- END DigiCert Site Seal Code -->';
	
	frm.taSSCode.value = ssCode;
}

function oldcurrencyFormatted(amount)
{
	var i = parseFloat(amount);
	if(isNaN(i)) { i = 0.00; }
	var minus = '';
	if(i < 0) { minus = '-'; }
	i = Math.abs(i);
	i = parseInt((i + .005) * 100);
	i = i / 100;
	s = new String(i);
	if(s.indexOf('.') < 0) { s += '.00'; }
	if(s.indexOf('.') == (s.length - 2)) { s += '0'; }
	s = minus + s;
	return s;
}

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 isRule(oComp, sRule, nLength, fdecimal)
{
	if(fdecimal == "" || typeof(fdecimal) == "undefined")
	{
		fdecimal = false;
	}

	//If the object is not specified return false
	if (typeof(oComp) == 'undefined' || oComp == null || oComp == '')
	{
		alert('Error: Input object not specified.');
		return false;
	}
	//If neither rule nor max length is specified, return false
	else if (typeof(sRule) == 'undefined' && typeof(nLength) == 'undefined')
	{
		alert('Error: No rule/maximum length for input object specified.');
		return false;
	}

	var noErrorFlg = true;

	//If object is specified and either of rule is specified,
	if(typeof(sRule) != 'undefined' && sRule != null)
	{
		var temp;
		sRule = sRule + "";
		var discardChars = false;
		if(sRule.length > 0 && sRule.charAt(0) == "~")
		{
			sRule = sRule.substring(1);
			discardChars = true;
		}

		if(typeof(oComp) == "undefined" || typeof(sRule) == "undefined")
			return false;

		for (var i = 0;i < oComp.value.length;i++)
		{
			temp = oComp.value.charAt(i);

			if((!discardChars && sRule.indexOf(temp) == -1) || (discardChars && sRule.indexOf(temp) >= 0))
			{
//				alert("Field disobeys entry rule.  Following are the valid characters:\n" + sRule);
				alert("Invalid Character!");
				oComp.value = oComp.value.substring(0,i);// + (oComp.value.length > i ? oComp.value.substring(i+1):"");
				noErrorFlg = false;
				break;
			}
		}
	}
	if(nLength)
	{
		if(fdecimal)
		{
			nLength -= fdecimal;
			var dp = oComp.value.indexOf(".");
			var p1;
			var p2 = "";;
			if(dp >= 0)
			{
				p1 = oComp.value.substring(0,dp);
				p2 = oComp.value.substring(dp+1);
			}
			else
			{
				p1 = oComp.value;
			}
			if(p1.length > nLength)
			{
				oComp.value = oComp.value.substring(0,nLength);
				return noErrorFlg;
			}
			for(var i = 0;i < p2.length;i++)
			{
				var ch = p2.charAt(i);
				if(ch < '0' || ch > '9')
				{
					oComp.value = p1 + "." + p2.substring(0,i);
					return noErrorFlg;
				}
			}
			if(p2.length > fdecimal)
			{
				oComp.value = p1 + "." + p2.substring(0,fdecimal);
			}
		}
		else if(oComp.value.length > nLength)
		{
			oComp.value = oComp.value.substring(0,nLength);
		}
	}
	return noErrorFlg;
}

//Function to trim a string
String.prototype.trim = function()
{
	var retstr = this.replace(/^\s+/,"");
	retstr = retstr.replace(/\s+$/,"");
	return retstr;
}

function helpRouting(rp)
{
	makePopup(rp + "routing.html","routhlp",500,400);
}

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 clearAll(frm)
{
	frm.tOrgAddr1.value = "";
	frm.tOrgZip.value = "";
	frm.tOrgCity.value = "";
	frm.tOrgState.value = "";
	frm.sOrgCountry.selectedIndex = 0;
	frm.tCpTelephone.value = "";
	frm.tCpEmail.value = "";

	frm.tOrgAddr1.focus();
}

function validateEMail(str)
{
	//var emailexp = /^[a-z][a-z_0-9\-\.]*@[a-z_0-9\-\.]+\.[a-z]{2,4}$/i
	var emailexp = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,5})$/i

	//Check that the email entry is valid
	if (!emailexp.test(str) || str.indexOf("..") >= 0)
	{
		return false;
	}
	return true;
}

function validatePassword(str)
{
	var allowed = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_=+)(*&^%$#@!;:/.,<>?';
	var tmp;
	
	//Check that the email entry is valid
	for(var i=0; i<str.length; i++)
	{
		tmp = '' + str.charAt(i);
		if(allowed.indexOf(tmp) == -1)
		{
			return false;
		}
	}
	return true;
}

function validateDomain(str)
{
	if(str.indexOf("//") >= 0 || str.indexOf("..") >= 0) return false;
	if(str.indexOf("*.") == 0)
	{
		str = "www" + str.substring(1);
	}
	if(str.indexOf("/*") == str.length-2)
	{
		str = str.substring(0,str.length-2);
	}
	var pos = str.indexOf("/");
	if(pos >= 0)
	{
		var compname = str.substring(pos+1);
		var compnamexp = /^[a-z_0-9\-]+$/i
		if(!compnamexp.test(compname)) return false;
		str = str.substring(0,pos);
	}
	var isIP = false;
	var ary = str.split(".");
	if(ary.length == 4)
	{
		var i = 0;
		for(;i < 4;i++)
		{
			if(isNaN(ary[i]) || Math.floor(ary[i]) != Math.ceil(ary[i]) || ary[i] < 1 || ary[i] > 255) break;
		}
		if(i >= 4) isIP = true;
	}

	if(!isIP)
	{
		var domainexp = /^[a-z0-9][a-z_0-9\-\.]+\.[a-z]{2,4}$/i

		if(!domainexp.test(str))
		{
			return false;
		}
	}
	return true;
}

/**
 * This function validates the date in any format
 * @author Ishan
 * @param datestr String representing the Date to be checked
 * @param delim String representing the delimiter that separates, date, month and year
 * date string
 * @param dd Integer value (0 to 2) indicating the position of the date field in the date String
 * @param mm Integer value (0 to 2) indicating the position of the month field in the date String
 * @param yy Integer value (0 to 2) indicating the position of the year field in the date String
 * @return Returns the boolean value true if the date is valid, false otherwise
 */
function dateCheck(datestr,delim,dd,mm,yy)
{
	if(dd < 0 || dd > 2 || mm < 0 || mm > 2 || yy < 0 || yy > 2 || dd == mm || mm == yy || dd == yy) return false;
	datestr = datestr.trim();
	delim = delim.trim();
	if(datestr.length <= 0 || delim.length <= 0) return false;
	var dt = datestr.split(delim);
	if(dt.length != 3) return false;
	if(isNaN(dt[dd]) || isNaN(dt[mm]) || isNaN(dt[yy])) return false;
	if(Math.floor(dt[dd]) != Math.ceil(dt[dd]) || Math.floor(dt[mm]) != Math.ceil(dt[mm]) || Math.floor(dt[yy]) != Math.ceil(dt[yy])) return false;
	if(dt[mm] < 1 || dt[mm] > 12 || dt[dd] < 1 || dt[dd] > 31 || dt[yy] < 1) return false;

	if(dt[mm] == 2)
	{

		if(dt[dd] > 29) return false;
		//	Check for leap year.
		if(dt[yy] % 100 == 0 && dt[yy] % 400 != 0 && dt[dd] > 28) return false;
		if(dt[yy] % 4 != 0 && dt[dd] > 28) return false;
	}

	if((dt[mm] == 4 || dt[mm] == 6 || dt[mm] == 9 || dt[mm] == 11) && dt[dd] > 30) return false;
	return true;
}

/**
 * This function validates the date in dd/mm/yyyy format
 * @author Ishan
 * @param datestr String representing the Date to be checked
 * @return Returns the boolean value true if the date is valid, false otherwise
 */
function dateCheckMain(datestr)
{
	return dateCheck(datestr,"-",2,1,0);
}

function confirmDelete(msg){

	return confirm("Do you really want to Delete "+ msg);
}

function BrowserDetect() {
   var ua = navigator.userAgent.toLowerCase(); 

   // browser engine name
   this.isGecko       = (ua.indexOf('gecko') != -1 && ua.indexOf('safari') == -1);
   this.isAppleWebKit = (ua.indexOf('applewebkit') != -1);

   // browser name
   this.isKonqueror   = (ua.indexOf('konqueror') != -1); 
   this.isSafari      = (ua.indexOf('safari') != - 1);
   this.isOmniweb     = (ua.indexOf('omniweb') != - 1);
   this.isOpera       = (ua.indexOf('opera') != -1); 
   this.isIcab        = (ua.indexOf('icab') != -1); 
   this.isAol         = (ua.indexOf('aol') != -1); 
   this.isIE          = (ua.indexOf('msie') != -1 && !this.isOpera && (ua.indexOf('webtv') == -1) ); 
   this.isMozilla     = (this.isGecko && ua.indexOf('gecko/') + 14 == ua.length);
   this.isFirebird    = (ua.indexOf('firebird/') != -1);
   this.isNS          = ( (this.isGecko) ? (ua.indexOf('netscape') != -1) : ( (ua.indexOf('mozilla') != -1) && !this.isOpera && !this.isSafari && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) ) );
   
   // spoofing and compatible browsers
   this.isIECompatible = ( (ua.indexOf('msie') != -1) && !this.isIE);
   this.isNSCompatible = ( (ua.indexOf('mozilla') != -1) && !this.isNS && !this.isMozilla);
   
   // rendering engine versions
   this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 );
   this.equivalentMozilla = ( (this.isGecko) ? parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) ) : -1 );
   this.appleWebKitVersion = ( (this.isAppleWebKit) ? parseFloat( ua.substring( ua.indexOf('applewebkit/') + 12) ) : -1 );
   
   // browser version
   this.versionMinor = parseFloat(navigator.appVersion); 
   
   // correct version number
   if (this.isGecko && !this.isMozilla) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('/', ua.indexOf('gecko/') + 6) + 1 ) );
   }
   else if (this.isMozilla) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) );
   }
   else if (this.isIE && this.versionMinor >= 4) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );
   }
   else if (this.isKonqueror) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('konqueror/') + 10 ) );
   }
   else if (this.isSafari) {
      this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('safari/') + 7 ) );
   }
   else if (this.isOmniweb) {
      this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('omniweb/') + 8 ) );
   }
   else if (this.isOpera) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera') + 6 ) );
   }
   else if (this.isIcab) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab') + 5 ) );
   }
   
   this.versionMajor = parseInt(this.versionMinor); 
   
   // dom support
   this.isDOM1 = (document.getElementById);
   this.isDOM2Event = (document.addEventListener && document.removeEventListener);
   
   // css compatibility mode
   this.mode = document.compatMode ? document.compatMode : 'BackCompat';

   // platform
   this.isWin    = (ua.indexOf('win') != -1);
   this.isWin32  = (this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1 || ua.indexOf('xp') != -1) );
   this.isMac    = (ua.indexOf('mac') != -1);
   this.isUnix   = (ua.indexOf('unix') != -1 || ua.indexOf('sunos') != -1 || ua.indexOf('bsd') != -1 || ua.indexOf('x11') != -1)
   this.isLinux  = (ua.indexOf('linux') != -1);
   
   // specific browser shortcuts
   this.isNS4x = (this.isNS && this.versionMajor == 4);
   this.isNS40x = (this.isNS4x && this.versionMinor < 4.5);
   this.isNS47x = (this.isNS4x && this.versionMinor >= 4.7);
   this.isNS4up = (this.isNS && this.versionMinor >= 4);
   this.isNS6x = (this.isNS && this.versionMajor == 6);
   this.isNS6up = (this.isNS && this.versionMajor >= 6);
   this.isNS7x = (this.isNS && this.versionMajor == 7);
   this.isNS7up = (this.isNS && this.versionMajor >= 7);
   
   this.isIE4x = (this.isIE && this.versionMajor == 4);
   this.isIE4up = (this.isIE && this.versionMajor >= 4);
   this.isIE5x = (this.isIE && this.versionMajor == 5);
   this.isIE55 = (this.isIE && this.versionMinor == 5.5);
   this.isIE5up = (this.isIE && this.versionMajor >= 5);
   this.isIE6x = (this.isIE && this.versionMajor == 6);
   this.isIE6up = (this.isIE && this.versionMajor >= 6);
   this.isIE7up = (this.isIE && this.versionMajor >= 7);
   
   this.isIE4xMac = (this.isIE4x && this.isMac);
}

function placeOrderError()
{
	if(document.getElementById('orderErrorDiv'))
	{
		var div = document.getElementById('orderErrorDiv');
		div.style.width = '400px';
		div.style.top = '300px';
		var winW = document.getElementById('mainBody');
		div.style.left = winW > 600 ? '170px' : '50px';
		div.style.position = 'absolute';
		div.style.zIndex = '500000';
		
		var closeButt = document.getElementById('orderErrorCloseButton');
		closeButt.style.display = 'block';
		
		var divMid = document.getElementById('orderErrorMid');
		divMid.style.background = 'transparent url(/images/error-mid.gif) repeat-y top left';
		divMid.style.padding = '0 20px 0 10px';
		divMid.style.zIndex = '500000';
		
		var divTop = document.getElementById('orderErrorTop');
		divTop.style.display = 'block';
		divTop.style.zIndex = '500000';
		
		var divBot = document.getElementById('orderErrorBot');
		divBot.style.display = 'block';
	}
}

function closeOrderError()
{
	if(document.getElementById('orderErrorDiv'))
	{
		var div = document.getElementById('orderErrorDiv');
		div.style.zIndex = '-500';
	}
}

function popDays(monthField,dayField,yearField)
{
	var mm = monthField.options[monthField.selectedIndex].value;
	if(mm.length > 0)
	{
		dayField.options.length = 29;
		var mm31 = new Array('1','3','5','7','8','10','12');
		var mm30 = new Array('4','6','9','11');
		if(mm31.indexOf(mm) != -1)
		{
			for(var i=29; i<=31; i++)
			{
				dayField.options[dayField.options.length] = new Option(i,i);
			}
		}
		else if(mm30.indexOf(mm) != -1)
		{
			for(var i=29; i<=30; i++)
			{
				dayField.options[dayField.options.length] = new Option(i,i);
			}
		}
		else if(yearField.options[yearField.selectedIndex].value > 0 && yearField.options[yearField.selectedIndex].value % 4 == 0)
		{
			for(var i=29; i<=29; i++)
			{
				dayField.options[dayField.options.length] = new Option(i,i);
			}
		}
	}
}

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;
}

//Initialize AJAX Functionality
function createRequestObject(){
	var request_o;
	var browser = navigator.appName;
	if(browser == "Microsoft Internet Explorer"){
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		request_o = new XMLHttpRequest();
	}
	return request_o;
}



