function addbookmark() {
	url = "http://www.domain.com";
	title = "שם האתר";
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,""); 
		return false;  
		} else if (window.external) { // IE Favorite      
		window.external.AddFavorite( url, title);     
		return false;       
		} else if (window.opera && window.print) { // Opera Hotlist  
		var elem = document.createElement('a');    
		elem.setAttribute('href',url);            
		elem.setAttribute('title',title);           
		elem.setAttribute('rel','sidebar');     
		elem.click();         
		return false;    
		}
	}
	
function homePage(){
	document.body.style.behavior='url(#default#homepage)';
	document.body.setHomePage('http://www.domain.com');
	}
	
function gid(gelement) {
	return document.getElementById(gelement);
	}

function confirmation(txt,link) {
	UserConfirm=confirm(txt);
	if (UserConfirm==true) location.href = link;
	return (UserConfirm);
	}

function NewWin(location, name,w, h, scr) {
	window.open(location, name, 'width='+w+', height='+h+', scrollbars='+scr+', top='+((screen.height / 4)-(h / 2))+', left='+((screen.width / 4) - (w / 2)));
	}

function ShowDiv(stylefeild) {
	if (document.getElementById(stylefeild).style.display=='none')
		document.getElementById(stylefeild).style.display='block';
	else
		document.getElementById(stylefeild).style.display='none';
	}
	
function ShowField(stylefeild,chkfield,index) {
	var obj = document.getElementById(stylefeild);
	var objj = document.getElementById(chkfield);
	obj.style.display='none';
	if (objj.options[objj.selectedIndex].value == index) obj.style.display='block';
	}

function selectAll() {
	var arr = document.getElementsByTagName("input");
	for (i=0;i<arr.length;i++) arr[i].checked=true;
	}

function unselectAll() {
	var arr = document.getElementsByTagName("input");
	for (i=0;i<arr.length;i++) arr[i].checked=false;
	}
	
function ajax(url,target) {
	var xmlHttp;
	try {  // Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();  }
		catch (e) {  // Internet Explorer 
			try {
				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
					xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {
				alert("Your browser does not support AJAX!");
				return false;
				}
			}
		}

	xmlHttp.onreadystatechange=function() {
		if (xmlHttp.readyState == 4) {
			if (gid(target)) gid(target).innerHTML = xmlHttp.responseText;
			}
		}
	if (gid(target)) {
		xmlHttp.open("POST",url,true);
		} else {
		xmlHttp.open("POST",url,false);
		}
	xmlHttp.send(null); 
	if (!gid(target)) return xmlHttp.responseText;
	}

function RoundToNdp(X, N){
		var T = Number('1e'+N);
		return Math.round(X*T)/T;
	}
	
function numbersOnly() {
	//  onkeypress="return numbersOnly();" onpaste="return false"
	if (event.keyCode != 46 && (event.keyCode<48||event.keyCode>57))
	return false;
	}

function lettersOnly() {
	//  onkeypress="return lettersOnly();" onpaste="return false"
	if (event.keyCode<48||event.keyCode>57)
                      if (event.keyCode<97||event.keyCode>122)
                      if (event.keyCode<65||event.keyCode>90)
		return false;
	}
	
function openCats(catID,picID,cat_id,unCatID) {
	if (gid(catID).style.display=='none') {
		var getLastCat = gid('lastCatOpen').value;
		var getLastPic = gid('lastCatOpenPic').value;
		if (getLastCat && getLastPic) {
			gid(getLastCat).style.display='none';
			gid(getLastPic).src='images/menu_right.jpg';
			}
		gid(catID).style.display='block';
		gid(catID).innerHTML = '<div align="center"><img border="0" src="images/ajaxloader.gif" alt="" /></div>';
		ajax('catalog.php?act=getItems&id='+cat_id+"&unCatID="+unCatID,catID);
		gid(picID).src='images/menu_right_open.jpg';
		gid('lastCatOpen').value = catID;
		gid('lastCatOpenPic').value = picID;
		} else {
		gid(catID).style.display='none';
		gid(picID).src='images/menu_right.jpg';
		}
	}

function showTab(num) {
	for (i=1; i<=4; i++) {
		if (i == num) {
			gid('link'+i).style.color='#CA4600';
			gid('link'+i).style.fontWeight='bold';
			gid('info'+i).style.display='block';
			gid('tab'+i).style.background='url(images/tab_over.jpg)';
			} else {
			gid('link'+i).style.color='#000000';
			gid('link'+i).style.fontWeight='normal';
			gid('info'+i).style.display='none';
			gid('tab'+i).style.background='url(images/tab_out.jpg)';
			}
		}
	}

		// alert(document.catalogForm.size.length);
	// 

	
function checkValues() {
	alert('עליך לבחור אחת מהאפשרויות המוצעות');
	return false;
	}
