function checkmember(pleasefill,name,lname,send,city,school,phone)
{
	var err=pleasefill+":\n";
	if (document.all.Fname.value == "")
	{
		err=err+name+"\n";
	}
	
	if (document.all.Lname.value == "")
	{
		err=err+lname+"\n";
	}
	
	if (document.all.school1.value == "")
	{
		err=err+school+"\n";
	}else{
		if (document.all.school1.value == 37)
		{
			if (document.all.ather_school.value == "")
			{
				err=err+school+"\n";
			}
			if (document.all.ather_city.value == "")
			{
				err=err+city+" "+school+"\n";
			}
		}
	}
	
//	if (document.all.school_start1.value == "")
//	{
//		err=err+sstart+"\n";
//	}else{
//		stringLength=document.all.school_start1.value.length;
//		if ((stringLength!=4) || (isNaN(document.all.school_start1.value)))
//		{
//			err=err+sstart+"\n";
//		}
//	}
	if (document.all.school_end1.value == "")
	{
		err=err+send+"\n";
	}else{
		stringLength=document.all.school_end1.value.length;
		if ((stringLength!=4) || (isNaN(document.all.school_end1.value)))
		{
			err=err+send+"\n";
		}
	}
	
//	if (document.all.school_start2.value != "")
//	{
//		stringLength=document.all.school_start2.value.length;
//		if ((stringLength!=4) || (isNaN(document.all.school_start2.value)))
//		{
//			err=err+sstart+"\n";
//		}
//	}
//	if (document.all.school_end2.value != "")
//	{	
//		stringLength=document.all.school_end2.value.length;
//		if ((stringLength!=4) || (isNaN(document.all.school_end2.value)))
//		{
//			err=err+send+"\n";
//		}
//	}
	
	if (document.all.city.value == "")
	{
		err=err+city+"\n";
	}
	
	if (document.all.phone1 == "")
	{
		err=err+phone+"\n";
	}
	
	if (err!=pleasefill+":\n")
	{
		alert(err);
		return false;
	}else{
		return true
	}
}

function checkmemberfamily(pleasefill,name,lname,address,email,phone,or)
{
	
	var err=pleasefill+":\n";
	if (document.all.Fname.value == "")
	{
		err=err+name+"\n";
	}
	
	if (document.all.Lname.value == "")
	{
		err=err+lname+"\n";
	}	
	
	if (document.all.address.value == "" && document.all.email.value == "" && document.all.phone.value == "")
	{
		err=err+address+" "+or+" "+phone+" E-mail";
	}else{
		if (document.all.email.value!="")
		{
			if ((document.all.email.value.indexOf("@")==-1)||(document.all.email.value.indexOf(".")==-1))
			{
				err=err+email+"\n"
			}
		}
	}
	
	if (err!=pleasefill+":\n")
	{
		alert(err);
		return false;
	}else{
		return true
	}
}

function add_family()
{
	if(1!=1){
		alert ("        ");
	}else{
		open_win('modules/add_family.asp',275,200);
	}
}

function open_win(str,str2,str3)  //This function opens the window or focus on the window
{
	windowHandle=window.open( ""+str+"" , "Print" , "toolbar=no,status=no,scrollbars=no,dependent,resizable=yes,width="+str2+",height="+str3+",left=400,top=400" )
}

function MM_findObj(n, d) { //v4.01
  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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function getcity(qstring,where,target){
	qstring=qstring.replace(/ /g,"[sp]");
	var xmlhttp2 = new ActiveXObject("Microsoft.XMLHTTP");
	xmlhttp2.Open("POST","modules/city.asp?rand="+ Math.random() ,false);
	xmlhttp2.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xmlhttp2.send("qstring=" + qstring + "&target=" + target + "&where=" + where);
	document.getElementById(where).innerHTML=xmlhttp2.responseText;	
}

/////////// news /////////////////

function verifyCompatibleBrowser(){ 
this.ver=navigator.appVersion 
this.dom=document.getElementById?1:0 
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0; 
this.ie4=(document.all && !this.dom)?1:0; 
this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
this.ns4=(document.layers && !this.dom)?1:0; 
this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5) 
return this 
} 
bw=new verifyCompatibleBrowser() 
lstart=120 
loop=true 
speed=100 
pr_step=2 
function ConstructObject(obj,nest){ 
nest=(!nest) ? '':'document.'+nest+'.' 
this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0; 
this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0; 
this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight 
this.newsScroll=newsScroll; 
this.moveIt=b_moveIt; this.x; this.y; 
this.obj = obj + "Object" 
eval(this.obj + "=this") 
return this 
} 
function b_moveIt(x,y){ 
this.x=x;this.y=y 
this.css.left=this.x 
this.css.top=this.y 
} 
//Makes the object scroll up 
function newsScroll(speed){ 
if(this.y>-this.scrollHeight){ 
this.moveIt(0,this.y-pr_step) 
setTimeout(this.obj+".newsScroll("+speed+")",speed) 
}else if(loop) { 
this.moveIt(0,lstart) 
eval(this.obj+".newsScroll("+speed+")") 
} 
} 
//Makes the object 
function InitialiseAutoScrollArea(){ 
objContainer=new ConstructObject('divASContainer') 
objContent=new ConstructObject('divASContent','divASContainer') 
objContent.moveIt(0,lstart) 
objContainer.css.visibility='visible' 
objContent.newsScroll(speed) 
} 

////////////////------------------------------- corner ------------------------////////////////////////

//$(function(){
//	$.each($(".newbtn"),function(i){
//		$(this).wrap("<div class=\"btnBorder\" style=\"width:" + Number($(this).width()+14 )+ "\"><div>").wrap("<div class=\"btnArea\" style=\"width:" + Number($(this).width()+10) + "\"><div>").parent().corner("round 8px").parent().css('padding', '1px').corner("round 6px").parent().corner("round 7px").parent().corner("round 10px")
//	})
//})
//-----------
//$(function(){
//	$(".newbtn").corner("16px top");
//})
///---------
//$(function(){
//var width1=$("#a1").width();
//var left1=$("#a1").left();
//var top1=$("#a1").top();

//$("#rightCubeTopCorners").css('left',left1);
//});
///////////--------------------- imud ---------------------///////////////////////////
//	$(function(){
//		var height1=$("#a1").height();
//		var height2=$("#a2").height();
//		var height3=$("#a3").height();
//
//		$("#a1,#a2,#a3").height(Math.max(Math.max(height1,height2),Math.max(height2,height3)))
//	});
$(function(){
var height1=$("#a1").height()+25;
var height2=$("#a2").height()+25;
var width2 =$("#a2").width()+3;
var height3=$("#a3").height()+25;

//alert(height1 + ", " + height2 + ", " + height3)
var maxHeight=Math.max(Math.max(height1,height2),Math.max(height2,height3))
for(i=1;i<=3;i++){
//	alert("a" +i + ":" + $("#a" + i).height() + "/" + maxHeight); 
	if($("#a" + i).height()!=maxHeight){
		$("#a" + i).height(maxHeight).css({margin:"0px",padding:"0px"}).corner("bottom 16px");
	}
}
//alert($("#a1").height() + ", " + $("#a2").height() + ", " + $("#a3").height())
$("#rightCubeTopCorners2").width(width2);
});

/////////-------------------- open sub menu -----------------------////////////////////////////////
function showSub (n) {
	$("#sub"+n+"parent").click( function(e) {
		if ($("#sub"+n).css('display')=='none'){
			$("#sub"+n).css('display','block'); 
		}    
	});
}

/////////--------------- table width ------------------------////////////////////////
$(function(){
	
	Tw = $("#topTBL").width();
	if (Tw > 1135){
		Tw = '1135px';
	}
	$("#topTBL").css('width',Tw);
	
	
	$("#pageTBL").css('width','100%');
	Pw = $("#pageTBL").width();
	//alert(Pw);
	if (Pw > 1280){
		Pw = '1280px';
	}
	$("#pageTBL").css('width',Pw);
})

/////////////----- sub menu ---------////////////////////

function showSub (n) {
	var p = $("#sub"+n+"parent").offset();
	$("#sub"+n+"parent").mouseover( function(e) {
		if ($("#sub"+n).css('display')=='none'){
			$("#sub"+n).css({display:"block",left:p.left});
			for(i=2;i<=4;i++){
				if (i!=n){
					$("#sub"+i).css('display','none');
				}
			}
		}  
	});
}

/////////////////------ right click blocker --------/////////////////

function disableselect(e){
return false
}
function reEnable(){
return true
}
//if IE4+
document.onselectstart=new Function ("return false")
//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}

///////////////--------- ie fix flash ----------///////////////////////
theObjects = document.getElementsByTagName("object"); 
    for (var i = 0; i < theObjects.length; i++)   { 
            theObjects[i].outerHTML = theObjects[i].outerHTML; 
        }
