////////////////////
//BEGIN Status bar//
////////////////////

//Hide status bar msg II script- by javascriptkit.com

var mydate=new Date();
var month = mydate.getMonth();
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
var day = mydate.getDate();
var year=mydate.getYear();


function loadThis()
{
		document.getElementById("cornerDate").innerHTML = "<FONT COLOR='black'>" + montharray[month] + ' '+ day +', '+year + "</FONT>";
		browserInit();
		rotateText(1);
}

function hidestatus()
{
	window.status='Synergy Consulting International - '+year;
	return true
}


if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

	document.onmouseover=hidestatus
	document.onmouseout=hidestatus
	
//////////////////
//END Status bar//
//////////////////


//////////////////////
//BEGIN Browser Vars//
//////////////////////
var type = "IE";
//For Opera :
if (navigator.userAgent.indexOf("Opera")!=-1
    && document.getElementById) type="OP"; 


//Internet Explorer e.g. IE4 upwards :
if (document.all) type="IE"; 

//For Netscape version 4 :
if (document.layers) 
{
	type="NN"; 
	//alert("This site has special features that are not supported by this browser. \nInternet Explorer is recommended.");
}


//Mozila e.g. Netscape 6 upwards
if (!document.all && document.getElementById) 
{
	type="MO"; 
	//alert("This site has special features that are not supported by this browser. \nInternet Explorer is recommended.");
}

////////////////////
//END Browser Vars//
////////////////////

////////////////////////////////////////////
//BEGIN Checks all "Checkboxes" in a Form///
////////////////////////////////////////////
//uploadFiles.php
function checkAll(whatForm)
{
  with (eval("document."+whatForm)) {
    for (var i=0; i < elements.length; i++) 
	{
        if (elements[i].type == 'checkbox')
           elements[i].checked = true;
    }
  }
}
//////////////////////////////////////////
//END Checks all "Checkboxes" in a Form///
//////////////////////////////////////////

/////////////////////////////
//BEGIN Open Window Pop Up///
/////////////////////////////
function popUp(URL,w,h) 
{
	day = new Date();
	//id = day.getTime();// This is to open each hit in different windows
	id='SCI';// This is to open each hit in same window
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,resizable=0,width=0,height=0,left = 490,top = 362');");
}
// End -->
///////////////////////////
//END Open Window Pop Up///
///////////////////////////

//////////////////////////////////////
//begin Format Phone (123) 123-1234///
//////////////////////////////////////
function jsPhoneObject() {
	var defaultFormat = "(###) ###-####";
	var minimumFinalLength = "(###)###-####".length;
	
/**********************************
jsPhone.fixFormat(phone number to be formatted, optional format)
Usage: fixFormat formats a phone 
Example:
<input type="text" onkeyup="this.value=jsPhone.fixFormat(this.value);">
<input type="text" onblur="this.value=jsPhone.fixFormat(this.value,'###-###-####');">
**********************************/
	this.fixFormat = function (theValue,theFormat){ // this creates a method in the jsPhoneObject with a minimum of 1 argument
		if(event.keyCode==8) return theValue;
		argv = this.fixFormat.arguments;
		format = ((argv.length==2)?argv[1]:defaultFormat);
		theValue = theValue.replace(/[^0-9]/g,"");
		if(theValue=="") return theValue;
		tmp="";
		j=0;
		for (i=0;i<format.length;i++) {
			if(format.substr(i,1)=="#") {
				tmp+=theValue.substr(j,1);
				j++
				if(j==theValue.length) break;
			} else if(format.substr(i,1)=="%") {
				while (true) {
					tmp+=theValue.substr(j,1);
					j++
					if(j==theValue.length) break;
				}
				break;
			} else {
				tmp+=format.substr(i,1);
			}
		}
		return tmp;
	}
	
	this.checkFormat = function (theValue){
		if(this.checkFormat.arguments.length>1) {
			minimumLength = ((this.checkFormat.arguments.length>2)?this.checkFormat.arguments[2]:this.checkFormat.arguments[1].length);
			if(theValue.length < minimumLength) return false;
			if(theValue!=this.fixFormat(theValue,this.checkFormat.arguments[1])) return false;
		} else {
			if(theValue.length < minimumFinalLength) return false;
			if(theValue!=this.fixFormat(theValue)) return false;
		}
		return true;
	}
}

var jsPhone = new jsPhoneObject();
////////////////////////////////////
//END Format Phone (123) 123-1234///
////////////////////////////////////


