﻿	function MM_goToURL() { //v3.0
	  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
	  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
	}
	function swich_s(myid)
        {
            if (document.getElementById(myid).style.display=="block") {
                document.getElementById(myid).style.display="none";
            }
			else {
                document.getElementById(myid).style.display="block";
            }
        }
	function swich_h(myid)
        {
            if (document.getElementById(myid).style.display=="none") {
                document.getElementById(myid).style.display="block";
            }
			else {
                document.getElementById(myid).style.display="none";
            }
        }
	function hide_loading()
        {
           swich_h('loading');
		   swich_s('pic_up');
        }
	function move_me(myid)
        {
             document.getElementById(myid).style.display="block";
			 
			 if (window.event.clientX>400)
				 document.getElementById(myid).style.left=400;
			 else
			 	document.getElementById(myid).style.left=(window.event.clientX)+document.documentElement.scrollLeft;
			 
			 document.getElementById(myid).style.top=(window.event.clientY)+document.documentElement.scrollTop;
        }
	function show_login(myid)
        {
			document.getElementById(myid).style.display="block";
			document.getElementById("black_"+myid).style.display="block";
			
			
			if (window.innerWidth) {
				var windows_height=window.innerHeight;
				var windows_width=window.innerWidth;
				var scroll_left=window.pageXOffset;
				var scroll_top=window.pageYOffset;
			}
			else if (document.all) {
				var windows_height=document.body.clientHeight;
				var windows_width=document.body.clientWidth;
				var scroll_left=document.documentElement.scrollLeft;
				var scroll_top=document.documentElement.scrollTop;
			}
			document.getElementById(myid).style.left=(windows_width/2)-(scroll_left)-200+'px';
			document.getElementById(myid).style.top=150+scroll_top+'px';
			
			document.getElementById("black_"+myid).style.width=windows_width;
			document.getElementById("black_"+myid).style.height=windows_height;
        }
	function close_div(myid)
        {
			document.getElementById(myid).style.display="none";
			document.getElementById("black_"+myid).style.display="none";
        }
	function startUpload(img_i){
		if (img_i == 1)
			swich_s('uploader_wait');
		else
			document.getElementById("pic_form"+img_i).submit();
		document.getElementById("server_update"+img_i).innerHTML="מעלה...";
		return true;
	}
	
	function stopUpload(success,no,img_i){
		  if (img_i == 10)
			swich_h('uploader_wait');
		  else
			startUpload(img_i+1);
		  
		 if (success == 1)
			 document.getElementById("server_update"+img_i).innerHTML="<img border='0' src='http://anattour.co.il/gd/articles_pic.php?id="+no+"&pic="+img_i+"&width=200&rand="+(Math.floor(Math.random()*100))+"' width='200' />";
		 else if (success == 3)
			 document.getElementById("server_update"+img_i).innerHTML="<img border='0' src='http://anattour.co.il/gd/articles_pic.php?id="+no+"&pic="+img_i+"&width=200' width='200' />";
		 else if (success == 2)
			 document.getElementById("server_update"+img_i).innerHTML="ריק";
		 else if (success == 0)
			 document.getElementById("server_update"+img_i).innerHTML= 'העלאת התמונה נכשלה, אנא נסה שנית';
		
		return true;
	
	}
		