var isNS4 = (navigator.appName=="Netscape")?1:0;

function open_big_pic(pic_str)
{
 a_win =  window.open ("big_pic_gen.asp?pic="+pic_str,"asd","toolbar=no,scrollbars=yes,width=400,height=400,status=no");	
}
function open_big_pic_print(pic_str)
{
 a_win =  window.open ("big_pic_gen_print.asp?pic="+pic_str,"asd","toolbar=no,scrollbars=no,width=10,height=10");	
}


function resetpic(x)
{

picv=document.getElementById (x);
picv2=document.getElementById ("dis"+x);		
picv.value="0";
picv2.value="";
}


function open_popup_side_menu(x,ty)
{
	
		open('../includes/popuppic.asp?id='+x+'&type='+ty,'pics','width=650,height=450,left=100,top=100');
			
 }

function open_popup(x,ty)
{
	
		  pic=document.getElementById(x);	

			 
		 if (pic.value=="" || pic.value=="0")
			{
				open('../includes/popuppic.asp?id='+x+'&type='+ty,'pics','width=650,height=450,left=100,top=100');
			}
			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 display_pic(str_pic)
{
 pics = document.getElementById("dis"+str_pic) ;
 if(pics.value!="")
 {
 window.open ("../../pic/"+pics.value,"big_pic","width=400,height=400,toolbar=no,scrollbars=yes,resizable=yes,status=no");
 }
 else
 {
  alert("לא קיים קובץ להצגה")
 }
}

function rev_stat()
{
 if(document.getElementById("Add_New").style.display=="none")
 {
  document.getElementById("Add_New").style.display='';
 }
 else
 {
  document.getElementById("Add_New").style.display='none';
 }
}

function ClearField(F_id)
{
 In_id = document.getElementById(F_id) ;
 In_id.value="";
}

function display_file(str_inp_name)
{
 var obj_file = document.getElementById(str_inp_name);
 window.open("../../files/"+obj_file.value,"file","status=false")  
}

function get_color(color_id)
{
	In_color = document.getElementById(color_id) 
	In_color.value =  showModalDialog('../includes/colors2.asp', 'as', 'dialogLeft:150px;dialogTop:300px;dialogWidth:380px;dialogHeight:260px;help:no;status:no;scrollbars:no;')
}

function alertandred(url,msg)
{
var ans;
ans = confirm(msg);
if(ans==true) location.href = url;
}

function open_win(str_url,str_name,str_para)
{
 res_win = window.open(str_url,str_name,str_para);
}



function clear_form(s_form) 
{
	document.getElementById(s_form).reset();
}