function open_big_pic(pic_str)
{
 a_win =  window.open ("big_pic_gen.asp?pic="+pic_str,"asd","toolbar=no,scrollbars=no,width=10,height=10");	
}


 function AddBookmark()	
		{

		if (document.all)
		window.external.AddFavorite("<%=WebRoot%>","אתר מור בייבי")

		}

function clear_file(file_inp)
		{
					filename=document.getElementById(file_inp);
					filename2=document.getElementById("dis"+file_inp);
					filename.value="0";
					filename2.value="";
		}
	function open_popup_file(file_inp)
		{
			fname=document.getElementById("dis"+file_inp);
				if (fname.value!="" && fname.value!="0")
					{
						alert('עלך להסיר את הקובץ הקיים!');
					}	
				else 
					{
						open('../includes/popupfiles.asp?file='+file_inp,'file','width=250,height=150,left=180,top=180');
					}	
		}	

function resetpic(x)
{

picv=document.getElementById (x);
picv2=document.getElementById ("dis"+x);		
picv.value="";
picv2.value="";
}


	function open_popup(x)
		{
			
				  pic=document.getElementById(x);	

					 
				 if (pic.value=="" || pic.value=="0")
					{
						open('../includes/popuppic.asp?id='+x+'&w=130&h=150','pics','width=250,height=160,top=150,left=180');
	      			}
	      			else
	      			{
	      			   alert("עלך להסיר את התמונה הקיימת!");
	      			}
		 }
		 
function open_popup_gallery(x)
		{
				  pic=document.getElementById("pic_2");	

				 if (pic.value=="")
					{
						open('../includes/popuppicgallery.asp?id='+x+'&w=130&h=150','pics','width=250,height=160,top=150,left=180');
	      			}
	      			else
	      			{
	      			   alert("עלך להסיר את התמונה הקיימת!");
	      			}
		 }		
		 
		 
	function open_popup_flash(x_str)
	{
	 window.open('../includes/popupflash.asp?id='+x_str+'&w=130&h=150','pics','width=250,height=160,top=150,left=180');
	}	 

	function show_hide_func(str_obj)
	{
		 all_to_hide = document.getElementsByTagName("DIV");
		 for(i=0;i<all_to_hide.length;i++)
			all_to_hide[i].style.display = "none";
		 if(document.getElementById(str_obj).style.display=="none")
		{
			  document.getElementById(str_obj).style.display = "";
		}
		else
		{
			 document.getElementById(str_obj).style.display = "none";
		}
	}

	function hide_func(str_obj)
	{
		 document.getElementById(str_obj).style.display = "none";
	}

function log_in(str_form_id)
{
 user = document.getElementById("username").value;
 pass = document.getElementById("passname").value;
 
if(user=="" || pass=="")
	{
		alert("Please enter your username and passwordl!");
	}
else
	{
			document.getElementById(str_form_id).submit();
	}
}


function open_win(str_url,str_name,str_para)
{
 res_win = window.open(str_url,str_name,str_para);
}


function check_valid_email(str_email)
{
	var  ret_val = true;
	func_email = str_email;
	if(func_email.indexOf("@") < 2)
	{
	 ret_val=false
	}
	if(func_email.indexOf(".") == 1 || func_email.indexOf(".") == func_email.length)
	{
	 ret_val=false
	}
	return ret_val;
}


function clear_form(s_form) 
{
	document.getElementById(s_form).reset();
}

function valid_account(strfrm)
{
fname = document.getElementById("fname").value;
lname = document.getElementById("lname").value;
email = document.getElementById("email").value;
pass = document.getElementById("pass").value;
pass2 = document.getElementById("pass2").value;

 if(fname=="" || lname=="" || email=="" || pass=="" || (pass != pass2)) 
	{
		alert("Please make sure all fields are correct Email(user) must be a valid email account");
	}
	else
	{
		document.getElementById(strfrm).submit();
	}
}
