
var gB = getBrowser();


function callHistory()
{
	document.FORMIX.SETCALLHISTORY.value	=	1;
	document.FORMIX.submit();
}
		
function saveInTable(fieldName, typeItem, dataTable, ID)
{
	document.FORMIX.SETFIELDNAME.value	=	fieldName;
	document.FORMIX.SETTYPEITEM.value	=	typeItem;
	document.FORMIX.SETDATATABLE.value	=	dataTable;
	document.FORMIX.SETIDUSER.value			=	ID;
	document.FORMIX.submit();
}
		
function controlRegText(minLength, fieldName, otherControl)
{
	eval("var VALUE = document.FORMIX." + fieldName + ".value;");
	if(VALUE.length < minLength)	{ok	=	false;}	else	{ok	=	true;}
			
	if(ok&&otherControl==1)
	{
		if(isComputeNonZero(VALUE))	{ok	=	true;}	else	{ok	=	false;}
	}
			
	if(ok&&otherControl==2)
	{
		if(isHexNonZero(VALUE))	{ok	=	true;}	else	{ok	=	false;}
	}
			
	if(ok&&otherControl==3)
	{
		if(mailSyntax(VALUE))	{ok	=	true;}	else	{ok	=	false;}
	}
			
	if(ok)
	{
		eval("document.FORMIX.SAVE_" + fieldName + ".disabled = false;");
	}
	else
	{
		eval("document.FORMIX.SAVE_" + fieldName + ".disabled = true;");
	}
			
}
		
function setEditInfo(ID)
{
	document.FORMIX.SETEDITINFO.value =	ID;
	document.FORMIX.submit();
}
		
function newRegistration()
{
	document.FORMIX.NEWREGISTRATION.value =	1;
	document.FORMIX.submit();
}
		
function loginOFF()
{
	document.FORMIX.LOGOFF.value =	1;
	document.FORMIX.submit();
}
		
function setValuation( param )
{
	document.FORMIX.SETVALUATION.value =	param;
	document.FORMIX.submit();		
}
		
function sendMail()
{
	document.FORMIX.SENDMAILADDRESS.value = 1;
	document.FORMIX.submit();
}
		
function isMailer()
{
	setMail	=	document.FORMIX.SETMAIL.value;
			
	if(mailSyntax(setMail))
		document.FORMIX.SENDMAIL.disabled = false;
	else
		document.FORMIX.SENDMAIL.disabled = true;
}

		
function openBigEditor(ID, table, back, font, advertising, paramX, paramY, paramZ, from)
{
	var path;	path = '_setup/_myHTMLEditor.php?ID=' + ID + '&table=' + table + '&back=' + back + '&font=' + font + '&advertising=' + advertising + '&paramX=' + paramX + '&paramY=' + paramY + '&paramZ=' + paramZ + '&from=' + from;
	parametre = "top=10,left=10,height=700,width=900,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no,resizable=yes";
	window.open(path,"MYEDITOR",parametre,true);
}		
		
function setPrintList()
{
	document.FORMIX.YESPRINT.value = 1;
	document.FORMIX.submit();
}
		
function clickListing()
{
	if(document.FORMIX.SETLISTING.checked)
		document.FORMIX.ISLISTING.value	=	1;
	else
		document.FORMIX.ISLISTING.value	=	0;
	document.FORMIX.submit();
}
		
function stepOver(x,stav)
{
	if(stav)
	{
		if(gB == 1 || gB == 3) {x.style.cursor = 'hand';}
		if(gB == 2 || gB == 4) {x.style.cursor = 'pointer';}
	}
	else
	{
		x.style.cursor = 'none';
	}		
}		
		
function oneStep(param)
{
	currStep = Math.abs(document.FORMIX.CURRSTEP.value);
	if(param == 0)
		{document.FORMIX.CURRSTEP.value = (currStep - 1);}
	else
		{document.FORMIX.CURRSTEP.value = (currStep + 1);}
	document.FORMIX.submit();
}
		
function listOver(x,stav, fontFamily, fontWeight, fontSize, fontColor, currFamily, currWeight, currSize, currColor)
{
	if(stav)
	{
		x.style.textDecoration = 'underline';
		if(gB == 1 || gB == 3) {x.style.cursor = 'hand';}
		if(gB == 2 || gB == 4) {x.style.cursor = 'pointer';}
				
		x.style.fontFamily	=	currFamily;
		x.style.fontWeight	=	currWeight;
		x.style.fontSize	=	currSize + 'pt';
		x.style.color		=	currColor;
				
	}
	else
	{
		x.style.textDecoration = 'none';
		x.style.cursor = 'none';
				
		x.style.fontFamily	=	fontFamily;
		x.style.fontWeight	=	fontWeight;
		x.style.fontSize	=	fontSize + 'px';
		x.style.color		=	fontColor;
	}
}
		
function openNumberSide(ID)
{
	document.forms("FORMIX").item("SIDES").value = ID;
	document.FORMIX.submit();
}
		
function openTheme(ID)
{
	if(document.getElementById("VIDEOCLIP_" + ID).style.display == 'inline')
		document.FORMIX.SETOPENTHEME.value = 0;
	else
		document.FORMIX.SETOPENTHEME.value = ID;
	document.FORMIX.submit();
}
		
function setPrint( x, y, z, fr, m, t, ida, sat, sides, normal )
{
	var gets	=	"?x=" + x + "&y=" + y + "&z=" + z + "&from=" + fr + "&m=" + m + "&t=" + t;
			
	if(sat.length > 0)
		if(normal == 0)
			gets	=	gets + "&ida=" + ida + "&sat=" + sat;
		else
			gets	=	gets + "&idn=" + ida + "&sat=" + sat;
					
	gets	=	gets + "&print=1&sides=" + sides;
			
	var path;	path = "noticePrint.php" + gets;
	parametre = "top=0,left=0,height=" + window.screen.height + ",width=600,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no,resizable=no";
	window.open(path,"NOTICEPRINT",parametre,true);
			
	//var path;	//path = "noticeView.php?isAnnotation=" + isAnnotation + "&type=" + type + "&mask=" + mask + "&annotationTable=" + annotationTable + "&annotationTitle" + annotationTitle + "&indexLink=" + indexLink + "&tableSet=" + tableSet;
	//parametre = "top=0,left=0,height=" + window.screen.height + ",width=" + window.screen.width + ",scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no,resizable=no";
	//window.open(path,"ADVERTISINGPRINT",parametre,true);			
}
		
function openMail(address)
{
	var path;	path = "mailto:" + address;
	window.open(path,"EMAIL","",true);
}
		
function openMailWithLink(address, getX, getY, getZ, getS, from, ID, pathRoot, tableSet, currentMask, currentType, IDA, setAnnotationTitle, normal)
{
	at		=	address.indexOf("@");			//strPos($paramTag,);;
	dot		=	address.indexOf(".");			//strRPos($paramTag,".");
				
	syntax	=	at > 0 && dot > 0 && dot > at && dot < address.length && at > 2;	
			
	var path;
	if(IDA.length > 0)	{		if(normal	==	1)		{			if(address	==	"ALL")
				var test = pathRoot + '/ABNet.php?x=' + getX + '\&y=' + getY + '&z=' + getZ + '&s=' + getS + '&from=' + from + "&m=" + currentMask + "&t=" + currentType + "&idn=" + IDA + "&sat=" + setAnnotationTitle; 
			else				var test = pathRoot + '/ABNet.php?x=' + getX + '\&y=' + getY + '&z=' + getZ + '&s=' + getS + '&from=' + from + '&filterID=' + ID + "&m=" + currentMask + "&t=" + currentType + "&idn=" + IDA + "&sat=" + setAnnotationTitle;						}		else		{			if(address	==	"ALL")
				var test = pathRoot + '/ABNet.php?x=' + getX + '\&y=' + getY + '&z=' + getZ + '&s=' + getS + '&from=' + from + "&m=" + currentMask + "&t=" + currentType + "&ida=" + IDA + "&sat=" + setAnnotationTitle; 
			else				var test = pathRoot + '/ABNet.php?x=' + getX + '\&y=' + getY + '&z=' + getZ + '&s=' + getS + '&from=' + from + '&filterID=' + ID + "&m=" + currentMask + "&t=" + currentType + "&ida=" + IDA + "&sat=" + setAnnotationTitle;						}
	}
	else
	{
		if(address	==	"ALL")
			var test = pathRoot + '/ABNet.php?x=' + getX + '\&y=' + getY + '&z=' + getZ + '&s=' + getS + '&from=' + from;
		else			var test = pathRoot + '/ABNet.php?x=' + getX + '\&y=' + getY + '&z=' + getZ + '&s=' + getS + '&from=' + from + '&filterID=' + ID;
	}
				var get = escape(test);	if(syntax)		path = "mailto:" + address + "?body="  + get;
	else	
		if(address != "ALL")
			path = "mailto:?subject=" + address + "&body="  + get;
		else
			path = "mailto:?body="  + get;
			
	window.open(path,"EMAIL","",true); 
}		
		
		
function openLink(root, filename )
{
	if(filename.length	>	0)
	{
		var path;		path = root + "/" + filename;
		parametre = "top=0,left=0,height=" + window.screen.height + ",width=" + window.screen.width + ",scrollbars=yes,status=yes,toolbar=yes,menubar=yes,location=yes,resizable=yes";
		window.open(path,"VIEWEXTERNAL",parametre,true);
	}
}
		
function openWeb(address)
{
			
	var path;	path = address;
	parametre = "top=0,left=0,height=" + window.screen.height + ",width=" + window.screen.width + ",scrollbars=yes,status=yes,toolbar=yes,menubar=yes,location=yes,resizable=yes";
	window.open(path,"EXTERNALCALL",parametre,true);			
}
		
function startVideo(ID)
{
	document.FORMIX.SIDES.value = 1;
	document.FORMIX.SETSTARTVIDEO.value = ID;
	document.FORMIX.submit();
}
		
function startForum(x, y, z, from, m, t, idan, sat, index, currentTable)
{
	//mask, annotation, annotationTitle
	//document.FORMIX.SETANNOCHANGE.value = 1;
	//document.FORMIX.SETANNOTATION.value = annotation;
	//document.FORMIX.SETANNOTATIONTITLE.value = annotationTitle;
	//document.FORMIX.SETFORUMCHANGE.value = mask;
	//document.FORMIX.submit();

	if(sat.length == 0)
		window.location.href = "ABNet.php?x=" + x + "&y=" + y + "&z=" + z + "&from=" + from + "&m=" + m + "&t=" + t + "&callForum=1&index=" + index;
	else
	{
		if(currentTable.substr(0,1) == "X")
			window.location.href = "ABNet.php?x=" + x + "&y=" + y + "&z=" + z + "&from=" + from + "&m=" + m + "&t=" + t + "&ida=" + idan + "&sat=" + sat + "&callForum=1&index=" + index;
		else
			window.location.href = "ABNet.php?x=" + x + "&y=" + y + "&z=" + z + "&from=" + from + "&m=" + m + "&t=" + t + "&idn=" + idan + "&sat=" + sat + "&callForum=1&index=" + index;
	}
}
		
function stdMouseOver(x,stav)
{
	if(stav)
	{
		//x.style.textDecoration = 'underline';
		if(gB == 1 || gB == 3) {x.style.cursor = 'hand';}
		if(gB == 2 || gB == 4) {x.style.cursor = 'pointer';}
	}
	else
	{
		x.style.cursor = 'none';
		//x.style.textDecoration = 'none';
	}	
}

		
function animationRight( leftMask, rightMask, numRows, right, ID)
{
	imageName	=	document.images["VIEWIMAGE_" + ID].src;
	pointerAt	=	imageName.indexOf("@");
	pointerDot	=	imageName.lastIndexOf(".");
			
	shotNo		=	imageName.substr(pointerAt + 1, (pointerDot - 1) - pointerAt)
			
	if(right)
	{
		++shotNo;
		if(shotNo > numRows) {shotNo = numRows;}
		if(shotNo == numRows) 
			document.getElementById("RIGHTARROW_" + ID).style.display = 'none';
		if(document.getElementById("LEFTARROW_" + ID).style.display == 'none')
			document.getElementById("LEFTARROW_" + ID).style.display = 'inline';
	}
	else
	{
		--shotNo;
		if(shotNo == 0) {shotNo = 1;}
		if(shotNo == 1) 
			document.getElementById("LEFTARROW_" + ID).style.display = 'none';
		if(document.getElementById("RIGHTARROW_" + ID).style.display == 'none')
			document.getElementById("RIGHTARROW_" + ID).style.display = 'inline';
	}
	document.images["VIEWIMAGE_" + ID].src = "/_PRESS/upload/" + leftMask + shotNo + rightMask;
}
		
function openAllNote( ID, column)
{
	if(document.getElementById("OFF_" + ID + "_" + column).style.display == 'inline')
		document.getElementById("OFF_" + ID + "_" + column).style.display = 'none';
	else
		document.getElementById("OFF_" + ID + "_" + column).style.display = 'inline';
				
	if(document.getElementById("ON_" + ID + "_" + column).style.display == 'inline')
		document.getElementById("ON_" + ID + "_" + column).style.display = 'none';
	else
		document.getElementById("ON_" + ID + "_" + column).style.display = 'inline';
}
		
function openLinkOnNew(param)
{
	if(param.substr(0,1) == "@")
	{
		var path;
					aParam	=	param.split("|");
		
		param	=	aParam[0];
		
		if(param.indexOf("^")>0)
		{
			buffer	=	"";
			for(i=0;i<param.length;++i)
			{
				ch	=	param.substr(i, 1);
				if(ch=="^")	{ch="&";}
				
				buffer	=	buffer+ch;
			}
			param	=	buffer;
		}

		window.location.href = param.substr(1,param.length);
	}
	else
	{
		var path;
					aParam	=	param.split("|");			
		if(aParam[1]==1)	{var scrollbars	=	"scrollbars=yes";}	else	{var scrollbars	=	"scrollbars=no";}		if(aParam[2]==1)	{var status		=	"status=yes";}		else	{var status		=	"status=no";}		if(aParam[3]==1)	{var toolbar	=	"toolbar=yes";}		else	{var toolbar	=	"toolbar=no";}		if(aParam[4]==1)	{var menubar	=	"menubar=yes";}		else	{var menubar	=	"menubar=no";}		if(aParam[5]==1)	{var location	=	"location=yes";}	else	{var location	=	"location=no";}		if(aParam[6]==1)	{var resizable	=	"resizable=yes";}	else	{var resizable	=	"resizable=no";}
					path = aParam[0];
		parametre = "top=0,left=0,height=" + (window.screen.height - 30) + ",width=" + (window.screen.width - 30) + ","+scrollbars+","+status+","+toolbar+","+menubar+","+location+","+resizable;
		window.open(path,"OPENONNEWWINDOW",parametre,true);		
	}
}
		
function comeBack(	getX, getY, getZ, getS, from)
{
	document.FORMIX.SETANNOCHANGE.value = 1;
	document.FORMIX.SETANNOTATION.value = '';
	document.FORMIX.SETANNOTATIONTITLE.value = '';
	document.FORMIX.submit();
			
	//window.history.back();
}
		
function overMouseGlobal(x, stav)
{
	if(stav)
	{
		x.style.textDecoration = 'underline';
		if(gB == 1 || gB == 3) {x.style.cursor = 'hand';}
		if(gB == 2 || gB == 4) {x.style.cursor = 'pointer';}
	}
	else
	{
		x.style.textDecoration = 'none';
		x.style.cursor = 'none';
	}	
}	
		
function overText(x, stav)
{
	if(stav)
	{
		if(gB == 1 || gB == 3) {x.style.cursor = 'hand';}
		if(gB == 2 || gB == 4) {x.style.cursor = 'pointer';}
	}
	else
	{
		x.style.cursor = 'none';
	}	
}
		
function callAnnotation(param, XANOT, annotationTitle, annotationName, x, y, z, s, from, m , t, ida, sat)
{
	//index.php?x=49&y=0&z=0&from=1&filterID=2&m=ensqodvzmc&t=LOGIN01&ida=4&sat=|2|10|6		
	//index.php?x=49&y=0&z=0&from=1&filterID=2&m=ensqodvzmc&t=LOGIN&ida=4&sat=|2|10|6
	if(XANOT)
	{
		window.location.href = "ABNet.php?x=" + x + "&y=" + y + "&z=" + z + "&s=" + s + "&from=" + from + "&filterID=2" + "&m=" + m + "&t=" + t + "&ida=" + ida + "&sat=" + sat;
	}
	else
	{
		window.location.href = "ABNet.php?x=" + x + "&y=" + y + "&z=" + z + "&s=" + s + "&from=" + from + "&filterID=2" + "&m=" + m + "&t=" + t + "&idn=" + ida + "&sat=" + sat;
	}
			
}
		
function _callAnnotation(annotationTitle, annotationName)
{
	document.FORMIX.SETANNOCHANGE.value = 1;
	document.FORMIX.SETANNOTATION.value = annotationName;
	document.FORMIX.SETANNOTATIONTITLE.value = annotationTitle;
	document.FORMIX.submit();
}

function openBigImage(mask, image, winName, ID, lineNo, imageNumber, noticeTable, galleryTable, setAnnotation, setAnnotationTitle, lineImg)
{
	if(image.indexOf(".gif") > 0 || image.indexOf(".jpg") > 0 || image.indexOf(".jpeg") > 0)
	{
		document.FORMIX.YESOPENGALLERY.value		=	mask;
		document.FORMIX.LINEID.value				=	ID;
		document.FORMIX.LINEIMG.value				=	lineImg;
		document.FORMIX.NOTICETABLE.value			=	noticeTable;
		document.FORMIX.GALLERYTABLE.value			=	galleryTable;
		document.FORMIX.LINENO.value				=	lineNo;
		document.FORMIX.GALLERYID.value				=	imageNumber;
		document.FORMIX.SETANNOTATION.value			=	setAnnotation;
		document.FORMIX.SETANNOTATIONTITLE.value	=	setAnnotationTitle;
		document.FORMIX.SETANNOCHANGE.value			=	1;
		document.FORMIX.submit();	
	}
	else
	{
		var path;		path = image;
		parametre = "top=20,left=20,height=" + (window.screen.height - 80) + ",width=" + (window.screen.width - 40) + ",scrollbars=no,status=no,toolbar=no,menubar=no,location=no,resizable=no";
		window.open(path,winName,parametre,true);
	}
}

function callOtherSite( param )
{
	aParam	=	param.split("^");
	
	param	=	"x=" + aParam[0] + "&y=" + aParam[1] + "&z=" + aParam[2] + "&s=" + aParam[3] + "&from=" + aParam[4];
	
	window.location.href = "ABNet.php?" + param;
}
	


