document.body.onkeypress = function () { return stateConfirm(this, event, true);}

function stateConfirm (field, evt, homepage) {
	var keyCode;
	if (self == top || self == parent){
		if (document.all){
			keyCode = event.keyCode;
		} else {
			if (evt.which){
				keyCode = evt.which;
			} else {
				if (evt.keyCode){
					keyCode = evt.keyCode
				} else {
					keyCode = evt.charcode;
				}
			}
		}
		
	//alert(keyCode);
		if (document.all) {
			if (keyCode == 5 ){
			
				if (!homepage){
				//homenow='edit'+location.pathname;
				//msgWindow=open('','FBCEditlogin','width=325,height=200,tollbar=no,scrollbar=yes,resizable=no');
				window.location.href ='edit'+location.pathname;
				//if (msgWindow.opener == null) msgWindow.opener = self;
					
					//window.open('editLogin.asp?homepage='+homenow, 'FBCEditlogin', 'width=325,height=200,tollbar=no,scrollbar=yes,resizable=no');
					//top.location.href='edit'+location.pathname;
				} else {
				homenow='edit'+location.pathname;
				msgWindow=open('','FBCEditlogin','width=250,height=160,tollbar=no,scrollbar=yes,resizable=no');
				msgWindow.location.href ='editor/editLogin.asp?homepage='+homenow;
				if (msgWindow.opener == null) msgWindow.opener = self;
					//homenow='edit'+location.pathname;
					//window.open('editLogin.asp?homepage='+homenow, 'FBCEditlogin', 'width=325,height=200,tollbar=no,scrollbar=yes,resizable=no');
					
				}
				//alert(keyCode);
				//homenow='edit'+location.pathname;
				//window.open('editLogin.asp?homepage='+homenow, 'FBCEditlogin', 'width=325,height=200,tollbar=no,scrollbar=yes,resizable=no');
				//msgWindow=open('',window,'resizable=no,width=200,height=200');
				//msgWindow.location.href ='apage.html';
				//if (msgWindow.opener == null) msgWindow.opener = self;

				//	if (msgWindow.opener == null) msgWindow.opener = self;
				//	homenow='edit'+location.pathname;
				//	msgWindow=open('', window, 'width=325,height=200,tollbar=no,scrollbar=yes,resizable=no');
				//	msgWindow.location.href='editLogin.asp?homepage='+homenow
				
			}
		} 
		if (!document.all) {
			if (keyCode == 66 && evt.shiftKey && evt.ctrlKey && parseInt(navigator.appVersion) >= 5){
				if (!homepage){
					homenow='edit'+location.pathname;
					window.open('editor/editLogin.asp?homepage='+homenow, 'FBCEditlogin', 'width=250,height=200,tollbar=no,scrollbar=yes,resizable=no');
					//top.location.href='edit'+location.pathname;
				} else {
					homenow='edit'+location.pathname;
					window.open('editor/editLogin.asp?homepage='+homenow, 'FBCEditlogin', 'width=250,height=200,tollbar=no,scrollbar=yes,resizable=no');
					
				}
			}
		} 
	}
}

function divide_string()
{
var where_is_mytool = window.location.href;
var mytool_array=where_is_mytool.split("/");
document.content.submit()
top.location.href( "../../"+mytool_array[6]);
}
function switchnow()
{
top.location.href='edit'+location.pathname;
}