﻿ function CheckDetails()
   {
    var  x = $("*[id$='txtFullName']").val();
    x=jQuery.trim(x);
    if(x=="")
    {    
        alert("נא למלא שם ");
        return false;
    }
    
  
    
  
  
    x = $("*[id$='txtEmail']").val();
    x=jQuery.trim(x);
    if(x=="")
    {    
        alert('נא למלא דוא"ל');
        return false;
    }
    if(!ValidateEmail(x))
    {
        alert('כתובת דוא"ל אינה תקינה ');
        return false;
    }
   
    return true;
}     


function ValidateEmail(s)
{
    var filter = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
    if (!filter.test(s)) 
        return false;
    else
        return true;
}



function CheckDetailsNewsLetter()
{
    var  x = $("*[id$='txtFirstName']").val();
    x=jQuery.trim(x);
    if(x=="")
    {    
        alert("נא למלא שם פרטי");
        return false;
    }
    
   
  
   
    
   
    
  
  
    x = $("*[id$='txtEmail']").val();
    x=jQuery.trim(x);
    if(x=="")
    {    
        alert('נא למלא דוא"ל');
        return false;
    }
    if(!ValidateEmail(x))
    {
        alert('כתובת דוא"ל אינה תקינה ');
        return false;
    }
   
    return true;
}


function PrintIt(i)
{
    open("PrintProduct.aspx?Id="+ i);
}


function showChilds(i)
{
    $('li[rel]').css("display","none");
    var g = "C"+i;
    $('li[rel="' + g + '"]').css("display","block");

}



function InjectFlash(divName,banner,width,height)
{
    if($("#" + divName).length!=0)
    {
     FlashReplace.replace(divName, "http://kfar2.guru4rent.co.il/ItemPics/"+ banner, "flash-element-BannerHomePageMain", width, height, 7,
                    {
                        wmode : "transparent",
                        quality: "high",
                        bgcolor: "#ffffff"
                    })
    }
}
