//---------------------------------------------------------------------------------------------------------------------------
//document.onselectstart = new Function ("return false");
//document.oncontextmenu = new Function("return false");
//---------------------------------------------------------------------------------------------------------------------------
function SetCookie1(jName, jValue, jPath, jDomain, jSecure, jDayExpired){
	var jDate = new Date();
	jDate.setTime(jDate.getTime() + jDayExpired * 24 * 60 * 60 * 1);
	document.cookie = jName + "=" + escape(jValue) + ";expires=" + jDate.toGMTString() + ";path=" + jPath;
}	
//---------------------------------------------------------------------------------------------------------------------------
// функции визуального редактора

var jFieldEdit = "";
var jPageEdit = "";

function OpenWindow(jUrl, jNameWin, jHeight, jWidth, jStringView){
	aStringView = jStringView.split(";");
	
	jLeftPosition = (screen.width) ? (screen.width-jWidth)/2 : 0;
	jTopPosition = (screen.height) ? (screen.height-jHeight)/2 : 0;
	
	window.open(jUrl, jNameWin, 'scrollbars='+aStringView[0]+', status='+aStringView[1]+',resizable='+aStringView[2]+',titlebar='+aStringView[3]+',menubar='+aStringView[4]+',width=' + jWidth + ',height=' + jHeight + ',top=' + jTopPosition + ',left=' + jLeftPosition);
}


function onEditField(jField){
	jPageEdit = false;
	jFieldEdit = ((document.getElementById(jField.id + "Name")) ? document.getElementById(jField.id + "Name").innerHTML : false);
	OpenWindow('/visual_edit/index.php', jField.name, 470, 700, '0;0;1;0;0');
}

function onEditPage(jBody){
	jFieldEdit = false;
	jPageEdit = ((document.getElementById(jBody + "Name")) ? document.getElementById(jBody + "Name").innerHTML : false);
	OpenWindow('/visual_edit/index.php', jBody, 470, 700, '0;0;1;0;0');
}
//---------------------------------------------------------------------------------------------------------------------------
