animatedcollapse.addDiv('jason', 'fade=1,height=199px')
animatedcollapse.ontoggle=function($, divobj, state){ 
}
animatedcollapse.init()

function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });
    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });
    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};
jQuery(document).ready(function() {
    jQuery('#ecards').jcarousel({
        auto: 4,
		rtl: true,
        wrap: 'last',
        initCallback: mycarousel_initCallback
    });
    jQuery('#mycarousel').jcarousel({
        auto: 4,
		rtl: true,
        wrap: 'last',
        initCallback: mycarousel_initCallback
    });
});

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("כתובת דואר לא תקינה")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("כתובת דואר לא תקינה")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("כתובת דואר לא תקינה")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("כתובת דואר לא תקינה")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("כתובת דואר לא תקינה")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("כתובת דואר לא תקינה")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("כתובת דואר לא תקינה")
		    return false
		 }

 		 return true					
	}
	
function Validate_Login_Form(){
	var emailID=document.loginfrm.txtEmail
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("הזינו כתובת דואר")
		emailID.focus()
		return false
	} 
	else if(document.loginfrm.txtPassword.value=="")
	{
		alert("הזינו סיסמא")
		document.loginfrm.txtPassword.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }
 
function validate_receive_form ( )
{
	valid = true;
	error_msg = "";
        if ( document.add_form.txtFirstName.value == "" )
        {
                error_msg = "הזינו שם פרטי";
				alert (error_msg);
				document.add_form.txtFirstName.focus();
                valid = false;
				
        }
		else if ( document.add_form.txtLastName.value == "" )
        {
                error_msg = "הזינו שם משפחה";
				alert (error_msg);
				document.add_form.txtLastName.focus();
                valid = false;
        } 
		else if ( document.add_form.ddlGender.value == "" )
        {
                error_msg = "בחרו את מינכם";
				alert (error_msg);
				document.add_form.ddlGender.focus();
                valid = false;
        }
		else if ( document.add_form.ddlBirthDateDay.value == "" )
        {
                error_msg = "הזינו את יום הלידה";
				alert (error_msg);
				document.add_form.ddlBirthDateDay.focus();
                valid = false;
        }
		else if ( document.add_form.ddlBirthDateMonth.value == "" )
        {
                error_msg = "הזינו את חודש הלידה";
				alert (error_msg);
				document.add_form.ddlBirthDateMonth.focus();
                valid = false;
        }
		else if ( document.add_form.ddlBirthDateYear.value == "" )
        {
                error_msg = "הזינו את שנת הלידה";
				alert (error_msg);
				document.add_form.ddlBirthDateYear.focus();
                valid = false;
        }
		
        return valid;
}

function validate_form ( )
{
	valid = true;
	error_msg = "";

        if ( document.reg_form.txtFirstName.value == "" )
        {
                error_msg = "הזינו שם פרטי";
				alert (error_msg);
				document.reg_form.txtFirstName.focus();
                valid = false;
				
        }
		else if ( document.reg_form.txtLastName.value == "" )
        {
                error_msg = "הזינו שם משפחה";
				alert (error_msg);
				document.reg_form.txtLastName.focus();
                valid = false;
        } 
		else if ( document.reg_form.ddlGender.value == "" )
        {
                error_msg = "בחרו זכר או נקבה";
				alert (error_msg);
				document.reg_form.ddlGender.focus();
                valid = false;
        }
		else if ( document.reg_form.ddlBirthDateDay.value == "" )
        {
                error_msg = "הזינו את יום הלידה";
				alert (error_msg);
				document.reg_form.ddlBirthDateDay.focus();
                valid = false;
        }
		else if ( document.reg_form.ddlBirthDateMonth.value == "" )
        {
                error_msg = "הזינו את חודש הלידה";
				alert (error_msg);
				document.reg_form.ddlBirthDateMonth.focus();
                valid = false;
        }
		else if ( document.reg_form.ddlBirthDateYear.value == "" )
        {
                error_msg = "הזינו את שנת הלידה";
				alert (error_msg);
				document.reg_form.ddlBirthDateYear.focus();
                valid = false;
        }
		else if ( document.reg_form.txtEmail.value == "" )
        {
                error_msg = "הזינו כתובת דואר";
				alert (error_msg);
				document.reg_form.txtEmail.focus();
                valid = false;
        }
		else if (echeck(document.reg_form.txtEmail.value)==false){
			document.reg_form.txtEmail.value=""
			document.reg_form.txtEmail.focus();
			valid = false;
		}
		
		else if(document.reg_form.chkAgreeToTerms.checked == false)
		{
			error_msg = "אשרו שקראתם את תקנון האתר";
			alert(error_msg);
			valid = false;
		}
		
        return valid;
}

 function Validate_Greeting_Form ( )
{
	valid = true;
	error_msg = "";

        if ( document.greeting_form.cat.value == "0" )
        {
                error_msg = "אנא בחרו קטגוריה";
				alert (error_msg);
				document.greeting_form.cat.focus();
                valid = false;
				
        }
		else if ( document.greeting_form.authorName.value == "" )
        {
                error_msg = "הזינו את שם השולח";
				alert (error_msg);
				document.greeting_form.authorName.focus();
                valid = false;
        } 
		else if ( document.greeting_form.txtEmail.value == "" )
        {
                error_msg = "הזינו כתובת דואר";
				alert (error_msg);
				document.greeting_form.txtEmail.focus();
                valid = false;
        }
		else if ( document.greeting_form.title.value == "" )
        {
                error_msg = "הזינו כותרת לברכה";
				alert (error_msg);
				document.greeting_form.title.focus();
                valid = false;
        }
		else if ( document.greeting_form.txtContent.value == "" )
        {
                error_msg = "לא הוזן טקסט הברכה";
				alert (error_msg);
				document.greeting_form.txtContent.focus();
                valid = false;
        }
		else if ( document.greeting_form.captcha.value != "xprus" )
        {
                error_msg = "לא הוזנו האותיות מהתמונה נכונה";
				alert (error_msg);
				document.greeting_form.captcha.focus();
                valid = false;
        }		
        return valid;
}

function del(record, form)
{
	if(confirm('?לא ניתן לשחזר פעולה זו! למחוק'))
	{
		window.location='del_friend.php?id='+record;
		return true;
	}
	else
		return false;
}

function Validate_Login_Form(){
	var emailID=document.loginfrm.txtEmail
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("הזינו כתובת דואר אלקטרוני")
		emailID.focus()
		return false
	} 
	else if(document.loginfrm.txtPassword.value=="")
	{
		alert("הזינו סיסמא")
		document.loginfrm.txtPassword.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }

function Pro_Contact_Form(url, wname, width, height,form_id,email) {
   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   var address = document.forms[form_id].elements[email].value;
   if(reg.test(address) == false) {
      alert('כתובת דואר אלקטרוני לא תקינה');
      return false;
   }
var winl = (screen.width - width) / 2;
var wint = (screen.height - height) / 2;
window.open(url, wname, "height=" + height + ",width=" + width + ",left=" + winl + ", top=" + wint + "location = 0, status = 1, resizable = 0, scrollbars=1, toolbar = 0");
return true;
}


function openWindow(url, wname, width, height) {
}
