﻿// 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 AddToFavorite()
      {
        bookmarkurl="http://lovetodance.interproltd.com/";
        bookmarkTitle="LoveToDance הבית של הרקדנים";
        if (document.all)
        window.external.AddFavorite(bookmarkurl,bookmarkTitle);
      }
      
      
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 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 popUpEffect(website,width,height) {
    var heightspeed = 7; 
    var widthspeed = 7; 
    var leftdist = 200;    // distance to left edge of window
    var topdist = 200;     // distance to top edge of window
    if (document.all) {
        var winwidth = width;
        var winheight = height;
        var sizer = window.open("","","left=" + leftdist + ",top=" + topdist + ",width=1,height=1,scrollbars=no,resizable=1, location=no");
        for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed) {
            sizer.resizeTo("1", sizeheight);
        }
        for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed) {
            sizer.resizeTo(sizewidth, sizeheight);
        }
        sizer.location = website;
        sizer.name="";
    }
    else
    window.location = website;
}





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 )
}