// FormChek.js
//
// SUMMARY
//
// This is a set of JavaScript functions for validating input on 
// an HTML form.  Functions are provided to validate:
// p is an abbreviation for "prompt"

var pEntryPrompt = "Please enter a "
var pStateCode = "2 character code (like CA)."
var pZIPCode = "5 or 9 digit U.S. ZIP Code (like 94043)."
var pUSPhone = "10 digit U.S. phone number (like 415 555 1212)."
var pWorldPhone = "international phone number."
var pSSN = "9 digit U.S. social security number (like 123 45 6789)."
var pEmail = "valid email address (like foo@bar.com)."
var pCreditCard = "valid credit card number."
var pDay = "day number between 1 and 31."
var pMonth = "month number between 1 and 12."
var pYear = "2 or 4 digit year number."



// Attempting to make this library run on Navigator 2.0,
// so I'm supplying this array creation routine as per
// JavaScript 1.0 documentation.  If you're using 
// Navigator 3.0 or later, you don't need to do this;
// you can use the Array constructor instead.

function popUPwin(url,width,height,id) {
	javascript:client_window=window.open(url ,'_blank',' width=' + width + ' ,height=' + height + ' ,left=0, top=0, location=no, menubar=no, resizable=yes, scrollbars=no');
	client_window.focus() 
}

function popUPwinParent(url,width,height,id) {
	javascript:client_window=parent.window.open(url ,'_blank',' width=' + width + ' ,height=' + height + ' ,left=0, top=0, location=no, menubar=no, resizable=yes, scrollbars=no');
	client_window.focus() 
}


function popUPwinScroll(url,width,height,id) {
	javascript:client_window=window.open(url ,'_blank',' width=' + width + ' ,height=' + height + ' ,left=0, top=0, location=no, menubar=no, resizable=yes, scrollbars=yes');
	client_window.focus() 
}


function ShowHideObj(objName)
{
	if (document.getElementById(objName).style.display=='none')
	{
		document.getElementById(objName).style.display='block';
	}
	else
	{
		document.getElementById(objName).style.display='none';
	}
}

function IsCardMatch (cardType, cardNumber)  {
  return isCardMatch (cardType, cardNumber);
}


var browserok=window.ActiveXObject
if (browserok)
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");


function loadXML(xmlFile)
{
	xmlDoc.async='false';
	xmlDoc.onreadystatechange=verify;
	xmlDoc.load(xmlFile);
	ticker=xmlDoc.documentElement;
}

function verify()
{ 
	if (xmlDoc.readyState != 4)
	{ 
		return false; 
	}
}

function activePage(strUrl)
{
	if (browserok){
		loadXML(strUrl);
		//alert(strUrl);
				}
}

function closeChat(CID)
{

activePage('action.aspx?action=removeChat&CID=' + CID )
}

// Preload and play audio files with event handler (MouseOver sound)
// designed by JavaScript Archive, (c)1999
// Get more free javascripts at http://jsarchive.8m.com

var aySound = new Array();
// Below: source for sound files to be preloaded
aySound[0] = "images/callBack.wma";

// DO NOT edit below this line
document.write('<BGSOUND ID="auIEContainer">')
IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
ver4 = IE||NS? 1:0;
onload=auPreload;

function auPreload() {
if (!ver4) return;
if (NS) auEmb = new Layer(0,window);
else {
Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
document.body.insertAdjacentHTML("BeforeEnd",Str);
}
var Str = '';
for (i=0;i<aySound.length;i++)
Str += "<EMBED SRC='"+aySound[i]+"' AUTOSTART='FALSE' HIDDEN='TRUE'>"
if (IE) auEmb.innerHTML = Str;
else {
auEmb.document.open();
auEmb.document.write(Str);
auEmb.document.close();
}
auCon = IE? document.all.auIEContainer:auEmb;
auCon.control = auCtrl;
}
function auCtrl(whSound,play) {
if (IE) this.src = play? aySound[whSound]:'';
else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"))
}
function playSound(whSound) { if (window.auCon) auCon.control(whSound,true); }
function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); }
//-->
