/*	function: newOpener - loads URL on the parent window
			newURL: 
*/
function newOpener(newURL)
{
	opener.document.location = newURL;
}


/*	function: newWin - opens a new window
			newWin 			takes on 7 values:
			WinURL: 		the URL to be loaded into the new window
			WinNAME:		the NAME of the popup window
			WinWIDTH: 	the WIDTH of the popup window (currently set at 700px)
			WinHEIGHT:	the HEIGHT of the popup window (currently set at 480px)
			WinRESIZE:	the "yes" or "no" value for the resize window property
			WinSCROLL:	the "yes" or "no" value for the scrollbars window property
			WinTOOLBAR: the "yes" or "no" value for the toolbar property
*/

function newWin(WinURL, WinNAME, WinWIDTH, WinHEIGHT, WinRESIZE, WinSCROLL, WinTOOLBAR)
{	
	/*	variables passed by the link calling the function	*/
	var URL = WinURL;
	var WINDOW_NAME = WinNAME;
	var POPUP_WIDTH = WinWIDTH;
	var POPUP_HEIGHT = WinHEIGHT;
	var POPUP_RESIZE = WinRESIZE;
	var POPUP_SCROLL = WinSCROLL;
	var POPUP_TOOLBAR = WinTOOLBAR;

	/*	window properties that determine the window attributes depending on what values are passed by the link calling the function	*/
	var window_toolbar = POPUP_TOOLBAR;
	var window_resize = POPUP_RESIZE;
	var window_scroll = POPUP_SCROLL;
	var window_width = POPUP_WIDTH;
	var window_height = POPUP_HEIGHT;
	var screen_balance_w = ((screen.width)-(window_width))/2;
	var screen_balance_h = ((screen.height)-(window_height))/2;
	var set_top = screen_balance_h;
	var set_left = screen_balance_w;	

	win = window.open(URL,WINDOW_NAME,'resizable=' + window_resize + ',toolbar=' + window_toolbar + ',scrollbars=' + window_scroll + ',width=' + window_width + ',height=' + window_height + ',top=' +  set_top + ',left=' + set_left + '');
	win.focus();
}

function newWinAddress(WinURL, WinNAME, WinWIDTH, WinHEIGHT, WinRESIZE, WinSCROLL, WinTOOLBAR)
{	
	/*	variables passed by the link calling the function	*/
	var URL = WinURL;
	var WINDOW_NAME = WinNAME;
	var POPUP_WIDTH = WinWIDTH;
	var POPUP_HEIGHT = WinHEIGHT;
	var POPUP_RESIZE = WinRESIZE;
	var POPUP_SCROLL = WinSCROLL;
	var POPUP_TOOLBAR = WinTOOLBAR;

	/*	window properties that determine the window attributes depending on what values are passed by the link calling the function	*/
	var window_toolbar = POPUP_TOOLBAR;
	var window_resize = POPUP_RESIZE;
	var window_scroll = POPUP_SCROLL;
	var window_width = POPUP_WIDTH;
	var window_height = POPUP_HEIGHT;
	var screen_balance_w = ((screen.width)-(window_width))/2;
	var screen_balance_h = ((screen.height)-(window_height))/2;
	var set_top = screen_balance_h;
	var set_left = screen_balance_w;	

	win = window.open(URL,WINDOW_NAME,'resizable=' + window_resize + ',toolbar=' + window_toolbar + ',scrollbars=' + window_scroll + ',width=' + window_width + ',height=' + window_height + ',top=' +  set_top + ',left=' + set_left + ',location=yes');
	win.focus();
}


/*	function: closeWin - closes the child window	*/

function closeWin()
{
	top.window.close();
}


/*	
THIS JAVASCRIPT ALLOWS FOR AUTOMATIC FIELD TABBING FOR PHONE NUMBERS AND STUFF 
*/
var downStrokeField;
function autojump(fieldName,nextFieldName,fakeMaxLength)
{
var myForm=document.forms[document.forms.length - 1];
var myField=myForm.elements[fieldName];
myField.nextField=myForm.elements[nextFieldName];

if (myField.maxLength == null)
   myField.maxLength=fakeMaxLength;

myField.onkeydown=autojump_keyDown;
myField.onkeyup=autojump_keyUp;
}

function autojump_keyDown()
{
this.beforeLength=this.value.length;
downStrokeField=this;
}

function autojump_keyUp()
{
if (
   (this == downStrokeField) && 
   (this.value.length > this.beforeLength) && 
   (this.value.length >= this.maxLength)
   )
   this.nextField.focus();
downStrokeField=null;
}

function check_field(f){
illegal = /[^\w._\-]/
email = f.EMAILADDR.value;

if (email.length<6 || email.indexOf('@')==-1 || email.indexOf('.')==-1)
	email="";
else { 
	At = email.indexOf('@');
	Period = email.lastIndexOf('.');
	DNS1 = email.substring(0,At);
	if (DNS1.length<1 || DNS1.match(illegal)!=null) email="";
		DNS2 = email.substring(At+1,Period);
	if (DNS2.length<1 || DNS2.match(illegal)!=null) email="";
		DNS3 = email.substring(Period+1,email.length);
	if (DNS3.length<2 || DNS3.match(illegal)!=null) email="";}

if (email.length==0) {
	alert("The email address you have entered is not valid.\nPlease re-enter a valid  email address.");
	f.EMAILADDR.focus();
	return false;} 
	
if(f.FIRSTNAME.value == ''){
 alert("Please enter your first name");
	f.FIRSTNAME.focus();
 return false;}
if(f.LASTNAME.value == ''){
 alert("Please enter your last name");
	f.LASTNAME.focus();
 return false;} 

return true;
}

function newExitWin(WinURL, WinNewUrlParam, WinNewUrl, WinNAME, WinWIDTH, WinHEIGHT, WinRESIZE, 
WinSCROLL, WinTOOLBAR) 
	{       
	        /*      variables passed by the link calling the function       */ 
	        var newUrl = WinNewUrl; 
	        newUrl = newUrl.replace('?','%3F'); 
	        while (newUrl.indexOf('=') > -1){ 
	                newUrl = newUrl.replace('=','%3D'); 
	        } 
	        while (newUrl.indexOf('&') > -1){ 
	                newUrl = newUrl.replace('&','%26'); 
	        } 
	        
	        var URL = WinURL+'?'+WinNewUrlParam+'='+newUrl; 
	        var WINDOW_NAME = WinNAME; 
	        var POPUP_WIDTH = WinWIDTH; 
	        var POPUP_HEIGHT = WinHEIGHT; 
	        var POPUP_RESIZE = WinRESIZE; 
	        var POPUP_SCROLL = WinSCROLL; 
	        var POPUP_TOOLBAR = WinTOOLBAR; 

	        /*      window properties that determine the window attributes depending on what values 
are passed by the link calling the function     */

	        var window_toolbar = POPUP_TOOLBAR; 
	        var window_resize = POPUP_RESIZE; 
	        var window_scroll = POPUP_SCROLL; 
	        var window_width = POPUP_WIDTH; 
	        var window_height = POPUP_HEIGHT; 
	        var screen_balance_w = ((screen.width)-(window_width))/2; 
	        var screen_balance_h = ((screen.height)-(window_height))/2; 
	        var set_top = screen_balance_h; 
	        var set_left = screen_balance_w; 

	        win = window.open(URL,WINDOW_NAME,'resizable=' + window_resize + ',toolbar=' + 
window_toolbar + ',scrollbars=' + window_scroll + ',width=' + window_width + ',height=' + window_height + 
',top=' +  set_top + ',left=' + set_left + '');

	        win.focus(); 
	} 

function handleDropDown(sellist) {
	if ( sellist.selectedIndex != 0 )
		window.open(sellist.options[sellist.selectedIndex].value);
	sellist.selectedIndex = 0;
}// Gives required warning when an external link is accessedfunction OutsideLink(URL) {   var siteName = "Concerta360";   var writeURL = URL   if (URL.length > 60) {	   writeURL = URL.substr(0, 60) + "...";   }   if (confirm("\nThank you for visiting www." + siteName + ".com.\n\nBy clicking 'OK' you will be taken to: \n\n" + writeURL +"\n\nA Web site to which our Privacy Policy \ndoes not apply.\n\nYou are solely responsible for your \ninteractions with such Web sites.\n\n")) {	   window.open(URL,"_blank");   }}
//-->//*****************OnClick Function Codefunction MM_findObj(n, d) { //v3.0var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;}function MM_showHideLayers() { //v3.0var i,p,v,obj,args=MM_showHideLayers.arguments;for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }obj.visibility=v; }}//-->dd=document;NS=(dd.layers)?1:0;IE=(dd.all)?1:0;DOM=(dd.getElementById)?1:0 function showLayer(i){ if(NS)dd.layers[i].display='show'; else if (IE)obg=dd.all[i]; else obg=dd.getElementById(i); if(!NS)obg.style.display='block' }function hideLayer(i){ if(NS)dd.layers[i].display='hide'; else if (IE)obg=dd.all[i]; else obg=dd.getElementById(i); if(!NS)obg.style.display='none' }
function div_description(i){showLayer(i+'ped_ban')hideLayer(i+'adult_ban')}function div_actions(i){showLayer(i+'adult_ban')hideLayer(i+'ped_ban')}