function checkEmpty(i,m)
{
var nn=document.forms[0].elements[i].value;
if(nn=="")
{
alert(m);
document.forms[0].elements[i].focus();
document.forms[0].elements[i].select();
return false;
}
return true;
}
///////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
function checkMail(i,m)
{
var nn=document.forms[0].elements[i].value;
if(nn.indexOf("@")==-1||nn.indexOf(".")==-1)
{
alert(m);
document.forms[0].elements[i].focus();
document.forms[0].elements[i].select();
return false;
}
return true;
}
function checkNum(j,m)
{
var nn=document.forms[0].elements[j].value;
var num="0123456789";
len=nn.length;
for(i=0;i<len;i++)
{
ch=nn.charAt(i);
//alert(num.indexOf(ch));
if(num.indexOf(ch)==-1)
{
alert(m);
document.forms[0].elements[j].focus();
document.forms[0].elements[j].select();
return false;
}
}
return true;
}
///
function checkConfirm(i,j,m)
{
var nn1=document.forms[0].elements[i].value;
var nn2=document.forms[0].elements[j].value;
if(nn1!=nn2)
{
alert(m);
document.forms[0].elements[j].focus();
document.forms[0].elements[j].select();
return false;
}
return true;

}


///
function checkSel(i,m)
{
var ind=document.forms[0].elements[i].selectedIndex;
var val=document.forms[0].elements[i].options[ind].value;
if(val=="")
{
alert(m);
document.forms[0].elements[i].focus();

return false;

}
return true;

}
//////////////////////////////////////
function checkPic(i,m)
{

var nn=document.forms[0].elements[i].value;
var in1=nn.indexOf(".");
var in2=nn.length;
ext=nn.substring(in1,in2);
if(ext!=".jpeg" && ext!=".jpg" &&ext!=".png" && ext!=".gif" )
{
alert(m);
document.forms[0].elements[i].focus();
return false;
}
return true;

}
//////////////////////////////////////
function checkFlash(i,m)
{

var nn=document.forms[0].elements[i].value;
var in1=nn.indexOf(".");
var in2=nn.length;
ext=nn.substring(in1,in2);
if(ext!=".swf" )
{
alert(m);
document.forms[0].elements[i].focus();
return false;
}
return true;

}
//////////////////////////////////
function ShowLayer(szDivID, iState) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
    }
}
