			
hayom=new Date();theDD=hayom.getDate();theMM=hayom.getMonth();theYY=hayom.getYear(); 
theDay=hayom.getDay(); 
hodashim = new Array(12); 
hodashim[0]='ינואר'; 
hodashim[1]='פברואר'; 
hodashim[2]='מרץ'; 
hodashim[3]='אפריל'; 
hodashim[4]='מאי'; 
hodashim[5]='יוני'; 
hodashim[6]='יולי'; 
hodashim[7]='אוגוסט'; 
hodashim[8]='ספטמבר'; 
hodashim[9]='אוקטובר'; 
hodashim[10]='נובמבר'; 
hodashim[11]='דצמבר'; 
yamim=new Array(7); 
yamim[0]='ראשון'; 
yamim[1]='שני'; 
yamim[2]='שלישי'; 
yamim[3]='רביעי'; 
yamim[4]='חמישי'; 
yamim[5]='שישי'; 
yamim[6]='שבת'; 
document.write('  '+yamim[theDay]+"' , ");document.write(theDD);document.write('   '+hodashim[theMM]) ;document.write(" ");document.write(theYY); 

function clock() {
time = new Date();
hours = time.getHours();
seconds = time.getSeconds();
minutes = time.getMinutes();
document.body.innerHTML=hours+':'+minutes+':'+seconds;
setTimeout('clock()',1000)
}

function addTofav() {
	if (document.all) {
		window.external.AddFavorite
		("http://www.siz.co.il","Siz")
	}
}

function toggle(id){
	var obj = "";
	if(document.getElementById)
		obj = document.getElementById(id);
	else if(document.all)
		obj = document.all[id];
	else if(document.layers)
		obj = document.layers[id];
	else
		return 1;
	if (!obj){
		return 1;
	} else if (obj.style) {
		obj.style.display = ( obj.style.display != "none" ) ? "none" : "";
	} else { 
		obj.visibility = "show"; 
	}
}

function checkGalForm(){
	var valid = true;
	var errors = '';
	if(document.newForm.title.value == ''){
		valid = false;
		errors = '- יש להכניס כותרת לגלריה<br />';
	}
	if(document.newForm.pass.value == ''){
		valid = false;
		errors += '- יש להכניס סיסמא לגלריה<br />';
	}
	full = 0;
	for (i=1;i<=11;i++){
		if(document.newForm['image'+i].value!=''){
			full = 1;
		}
	}
	if(full == 0){
		errors += '- יש להעלות לפחות תמונה אחת בשביל לפתוח גלריה<br />';
		valid = false;
	}
	document.getElementById('errorDiv').innerHTML = errors + '<br />';
	if(valid == true){
		toogleLoad();
	}
	return valid;
}

var showNow = 'image';

function toogleGal(displayGal){
	if(displayGal == ''){
		if(showNow == 'image'){
			document.getElementById('galOption').checked = true;
			toggle('galleryTab');
			toggle('imageTab');
			toggle('text1');
			toggle('text2');
			document.getElementById('pageTitle').innerHTML = 'פתיחת גלריה';
			showNow = 'gal';
		}
	} else {
		if(showNow == 'gal'){
			document.getElementById('imageOption').checked = true;
			toggle('galleryTab');
			toggle('imageTab');
			toggle('text1');
			toggle('text2');
			document.getElementById('pageTitle').innerHTML = 'העלאת תמונות';
			showNow = 'image';
		}
	}
}

function toogleLoad(){
	toggle('loadingDiv');
	toggle('mainUploadDiv');
}

function CopyToClipboard(e) {
	e.focus();
	e.select();
	tr = e.createTextRange();
	tr.execCommand("Copy");
	window.status = "!הטקסט הועתק בהצלחה";
	setTimeout("window.status=''",3000);
}

function CreateBookmarkLink() {
	    title = "סיז";
	    url = "http://www.siz.co.il/";
	    if (window.sidebar) {
	        // Mozilla Firefox Bookmark
	        window.sidebar.addPanel(title, url,"");
	    } else if( window.external ) {
	        // IE Favorite
	        window.external.AddFavorite( url, title);
	    }
	    else if(window.opera && window.print) {
	        // Opera Hotlist
	        return true; }
}

num = 7;
maxNum = 12;

function dispMoreFiles() {
	if (num<maxNum) {
		var filelocal = document.getElementById('morefiles');
		var fileName = "image"+num;
		filelocal.innerHTML += '<input name="' + fileName + '" type="file" /><br />';
		num++;
	} else {
		alert('ניתן להוסיף רק 5 תיבות העלאה בלבד, לעוד תיבות לחץ על "הוסף חמש"');
	}
}