if (top.location!=self.location){
	top.location=self.location;
}

function Evt(name) {
	document.cfn7.partext.value = name;
	document.cfn7.submit();
}

function DispMsg(m){
	if(m!=""){
		window.alert(m); 
	}
}

function OpenWin(url,name,w,h,l,t){
	if (url!=""){
		ParamText=""
		if (w!=""){
			ParamText="width="+ w
		}
		if (h!=""){
			if (ParamText!=""){ParamText=ParamText + ","}
			ParamText=ParamText+"height="+ h
		}
		if (l!=""){
			if (ParamText!=""){ParamText=ParamText + ","}
			ParamText=ParamText+"left="+ l
		}
		if (t!=""){
			if (ParamText!=""){ParamText=ParamText + ","}
			ParamText=ParamText+"top="+ t
		}
		
		window.open(url,name,ParamText);
		//window.open(url);
		//return false;
	}
}

function submitenter(myfield,e,action){
	var keycode;
	if (window.event) keycode = window.event.keyCode;
	else if (e) keycode = e.which;
	else return true;

	if (keycode == 13){
		document.cfn7.partext.value = action;
		document.cfn7.submit();
//		myfield.form.submit();
		return false;
	}else{
		return true;
	}
}

function textCounter(theField,theCharCounter,maxChars)
{
	var strCharCounter = 0;
	var str = document.forms[0].elements[theField].value;
	var len = str.length;
	var i;
	for(i = 0; i < len; i++){
		n = escape(str.charAt(i));
		if (n.length < 4) strCharCounter++; else strCharCounter+=2;
	}
	
	document.forms[0].elements[theCharCounter].value = strCharCounter;
	
	if (strCharCounter>maxChars ){
		document.forms[0].elements[theCharCounter].style.color="red";				
	}else{
		document.forms[0].elements[theCharCounter].style.color="black";
	}
}


function  OpenerReloadAndClose(s){
	if(s!=""){
		window.opener.focus();	
		window.opener.location.reload();
		window.close();
	}
}

function OnlyOne(a,b){
	if(document.forms[0].elements[a][b].checked==true){
		document.forms[0].elements[a][1-b].checked=false;
	}
}
