
//-------------------------------
function test(){
	alert('TEST JAVA')
}
//-------------------------------
function co(db, co, ex){
	document.cookie = db + '=' + co + '; expires=' + ex + '; path=/';
}
//-------------------------------
function PopWindow(name,h,w,center){
	var PopUp = window.open ('/perl/co.pl?win='+name, name, config='height='+h+', width='+w);
	PopUp.moveBy(0,0); 
	PopUp.name='caller';

	if (center == 1){
		var y = parseInt(screen.height/2)-parseInt(h/2);
		var x = parseInt(screen.width/2)-parseInt(w/2)
		PopUp.moveTo(x,y);
	}
}
//-------------------------------
function PopZoom(label,part,h,w,center){
	var PopUp = window.open ('http://'+Site+'/perl/site.pl/zoo::'+label+'/,'+part+'.htm', 'part', config='height='+h+', width='+w);
	PopUp.moveBy(0,0); 
	PopUp.name='caller';

	if (center == 1){
		var y = parseInt(screen.height/2)-parseInt(h/2);
		var x = parseInt(screen.width/2)-parseInt(w/2)
		PopUp.moveTo(x,y);
	}
}
//-------------------------------
var a = 0;
function buttonCheck(val){
	a = val;
}
function submitCheck(e, na){

	if (a != 0){return(true);}
	if(e == 0){
		if (document.form.Title.value.length == 0) {
			alert(na+" title is required!");
			return(false);
		}
		if (document.form.Text.value.length == 0) {
			alert(na+" text is required!");
			return(false);
		}
		if (document.form.Re.checked){
			if (!emna()){return(false);}
		}
	}else{
		if (!emna()){return(false);}
		setTimeout('window.close()',1000);
	}
	return(true);
}
//-------------------------------
function emna(val){

	if (document.form.Author.value.length == 0){
	     	alert("Your name is required!");
		return(false);
	}
	if (document.form.Email.value.length > 0) {
		regEx = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9_-]+(.[a-zA-Z0-9_-]+)+$/;
		if (!regEx.test(document.form.Email.value)) {
			alert("Bad e-mail format!");
			return(false);
		}
	}else{
	   	alert("Your e-mail is required!");
		return(false);
	}
	return(true);
}
//-------------------------------
function setcookie(val, id, ex){

	if (ex){
		co('order', id, ex);				//set cookie
		index = -1;
		if(document.cookie){index = document.cookie.indexOf('order');}
		if (index == -1){
			alert('You must allow cookies');
			return false;
   		}
		if (!emna()){return(false);}
	}
//
	if (val == 'q'){
		document.form.qt.value = 'q';
	}else{
		if (document.form.qt.value == 'q'){
			document.form.qt.value = '1';
		}else if ((document.form.qt.value.length == 0)||(document.form.qt.value == 0)){
	     		alert("The quantity is required!");
			return(false);
		}
	}
}
//-------------------------------


//<script language="JavaScript">
// Note: browser flags are needed by multiple modules -- don't remove
var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && !ie);

function showObject(e,id) {
tleft = e.clientX + document.body.scrollLeft + 10;
ttop = e.clientY + document.body.scrollTop + 10;
if (ie) {
document.all[id].style.visibility = "visible";
document.all[id].style.left = tleft;
document.all[id].style.top = ttop;
}
else if (w3) {
document.getElementById(id).style.visibility = "visible";
document.getElementById(id).style.left = tleft;
document.getElementById(id).style.top = ttop;
}
}

function hideObject(id) {
if (ie) {
document.all[id].style.visibility = "hidden";
}
else if (w3) {
document.getElementById(id).style.visibility = "hidden";
}
}
function isdef( vname)
{
return ( typeof( window[ vname]) == "undefined") ? false : true;
}
//</script>















	
