function MM_preloadImages() {
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
if (activeImage[0]!=null){if ((x=MM_findObj(activeImage[0]))!=null) x.src=activeImage[1];} //AK
}
function MM_swapImgRestore() {
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) {
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() {
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((a[i]!=activeImage[0])&&((x=MM_findObj(a[i]))!=null)){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} //AK
}
function copyRight(dt){ //AK
var dat=new Date();
var und;
dat=dat.getFullYear();
if (dat<1000) dat+=2000;
if ((dt==und)||(dt==dat)) document.write("&copy;"+dat);
else document.write("&copy;"+dt+"/"+dat);
}
function winop(url,w,h){
var obj=window.open(url,'PopUp','directories=0,fullscreen=0,width='+ w +',height='+ h +',toolbar=0,location=0,menubar=0,status=0,resizable=1,titlebar=1,scrollbars=0,top=100,left=150');
obj.focus();
}
function check_frm_login(){
var errors='';
errors+=checklength(document.frm_login.fld_user_login.value,"The username length should be eight characters!");
errors+=checklength(document.frm_login.fld_user_pass.value,"The password length should be eight characters!");
if (errors!='') alert('The following error(s) occurred:\n'+errors);
document.returnValue = (errors == '');
}
function check_frm_new_login(){
var errors='';
errors+=checklength(document.frm_new_login.fld_newuser_login.value,"The username length should be eight characters!");
errors+=checklength(document.frm_new_login.fld_newuser_pass.value,"The password length should be eight characters!");
errors+=checklength(document.frm_new_login.fld_newuser_pass2.value,"Second password should be eight characters!");
if (document.frm_new_login.fld_newuser_pass.value!=document.frm_new_login.fld_newuser_pass2.value) errors+="- Passwords do not match!\n";
if (errors!='') alert('The following error(s) occurred:\n'+errors);
document.returnValue = (errors == '');
}
function checklength(text,message){
var errors='';
if (text.length!=8) errors = '- ' + message + '\n';
return errors;
}
function setF(val){
var d1='',d2='',im='';
var go=!shityBrowser();
if (val==0) {
d1='shLogin';
d2='shRegister';
im='login1_r1_c4.gif';
} else {
d1='shRegister';
d2='shLogin';
im='register.gif';
}
if (go) {
	document.getElementById(d1).style.display='block';
	document.getElementById(d2).style.display='none';
	MM_swapImage('logreg','','assets/intro/'+im,1);
	if (val==0) document.frm_login.fld_user_login.focus();
	else document.frm_new_login.fld_newuser_login.focus();
} else if (val==0) {
	document.location='login.cfm?login=1';
} else {
	document.location='login.cfm?login=2';
}
}
function shityBrowser(){
var ret=false;
if (navigator.appVersion.indexOf("IE")>0) {
	if (navigator.appVersion.indexOf("Mac")>0) ret=true;
} else if (navigator.appName=="Opera") {
	if (navigator.appVersion.charAt(0)<7) ret=true;
}
if (!document.getElementById) ret=true;
return ret;
}
