//-----------------------------------------------------------------------------------------------------------------------------

//-----------------------------------------------------------------------------------------------------------------------------
function valid_email()
{
	var input_val = arguments[0];
	if( "string" != typeof input_val ){ return false; }
	var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
	var regex = new RegExp(emailReg);
	return regex.test(input_val);
}
//-----------------------------------------------------------------------------------------------------------------------------
function OpenJSWin(JsWinW,JsWinH,JsWinS){
		var NewJSWindow;
		if(arguments[3]){
		NewJSWindow = window.open(JsWinS,null,"width="+JsWinW+",height="+JsWinH+",status=no,toolbar=no,menubar=no,location=no,scrollbars=yes");
		}
		else
	{NewJSWindow = window.open(JsWinS,null,"width="+JsWinW+",height="+JsWinH+",status=no,toolbar=no,menubar=no,location=no");}
		if(NewJSWindow){
			var MidX = Math.round((window.screen.availWidth-JsWinW)/2);
			var MidY = Math.round((window.screen.availHeight-JsWinH)/2);
			NewJSWindow.moveTo(MidX,MidY);
			NewJSWindow.focus();}
		}

//-----------------------------------------------------------------------------------------------------------------------------
function Refresher(){
	window.navigate(arguments[0]);
}
//-----------------------------------------------------------------------------------------------------------------------------
function quicknavigator(){
if(arguments[0].length!=0){window.navigate(arguments[0]);}
}
//-----------------------------------------------------------------------------------------------------------------------------
function disable(disableIt)
{
	document.edit.about_note.disabled = disableIt;
}
// =======================================================================================================================================
function vbGO(){window.location.href=arguments[0];}
// =======================================================================================================================================


	var ico_plus		=	new Image();
	ico_plus.src		=	"/images/ico_plus.gif";

	var ico_minus		=	new Image();
	ico_minus.src		=	"/images/ico_minus.gif";


function vSwitcher(){
	attribName			=	arguments[0].toLowerCase();
	tableAmount			=	parseFloat(arguments[1]);
	deepLevel			=	parseFloat(arguments[2]);

	iValue				=	parseFloat(arguments[3]);
	
	iconImg				=	document.getElementById("ico"+iValue);
	if(iconImg.src.indexOf("plus")>-1){iconImg.src=ico_minus.src;}
	else{iconImg.src=ico_plus.src;}

	for(i=0;i<tableAmount;i++){
		tableObj		=	document.getElementById("tbl"+i);
		tableObj_SWNAME	=	tableObj.attributes.getNamedItem("SWNAME");
		tableObj_DEEP	=	tableObj.attributes.getNamedItem("DEEP");
		if(tableObj_SWNAME){
			if(tableObj_SWNAME.value.indexOf(attribName)>-1){
				if(tableObj_DEEP.value>deepLevel){
					tableObj_display	=	tableObj.style.display;
					if((tableObj_display=="none")&&(tableObj_DEEP.value-deepLevel==1)){
						tableObj.style.display="block";
						}
					else{
						tableObj.style.display="none";
						try {document.getElementById("ico"+i).src=ico_plus.src;}
						catch(e){
						}
						
						}


				}

			}
		}
	}

}
// =======================================================================================================================================
function vbOWiN(sURL,pW,pH,iSCROLL_BAR,isWinName){
	if(sURL.length>0){
		pX = Math.round((window.screen.width-pW)/2);
		pY = Math.round((window.screen.height-pH)/2);
		sFea = "height="+pH+",width="+pW;
		sFea+= "status=no,toolbar=no,menubar=no,location=no,resizable=no,left="+pX+",top="+pY;
	if(iSCROLL_BAR=="yes"){sFea+=",scrollbars=yes";}
	if(isWinName){oNewWindow = window.open(sURL,isWinName,sFea);}
	else{oNewWindow = window.open(sURL,null,sFea);}
	oNewWindow.focus();
	}
}
