function doAddBookmark() {
	var url = 'http://www.fabulous.co.il';
	var title = "פאבילאס - פתרונות אינטרנט ובניית אתרים";
	if (window.sidebar) // Mozilla Firefox Bookmark	
		window.sidebar.addPanel(title, url, "");
	else if (window.external) // IE Favorite
		window.external.AddFavorite( url, title);
}

function do_focus(){
	var reg=new RegExp(/#content$/);
	if(!document.URL.match(reg))
		window.location=document.URL+"#content";
}

function getElementsByClassName(element,asd){
	var array = [];
	var classname = new RegExp('\\b'+asd+'\\b');
	var divs=element.getElementsByTagName("*");
	for(i=0;i<divs.length;i++)
		if(divs[i].className.match(classname))
			array.push(divs[i]);
	return array;
}

function scroller(asd,now,px){
	var thediv=document.getElementById(asd);
	var divs=getElementsByClassName(thediv,"messege");
	var he=(divs[((now==0)?0:now-1)].offsetHeight);
	var time=0;
	if(px<he){
		thediv.scrollTop+=1;
		px++;
		if(now !=0)
			time=25;
			setTimeout("scroller('"+asd+"',"+now+",'"+px+"')",time);
		
	}else{
		if(now<divs.length-1 && now !=0){
			setTimeout("do_scroll('"+asd+"',"+now+")",3000);
		}else
			setTimeout("do_scroll('"+asd+"',"+now+")",0);
	}
}

function do_scroll(asd,now){
	var thediv=document.getElementById(asd);
	var divs=getElementsByClassName(thediv,"messege");
	now++;
	if(now>=divs.length){
		thediv.scrollTop=0;
		now=0;
		scroller(asd,0,divs[0].offsetHeight);
	}else{
		scroller(asd,now,0);
	}
}

function clear_form(){
	document.getElementById('form').reset();
	if(document.getElementById('domain_b').value)
		document.getElementById('domain_w').style.display='none';
	return false;
}

function domain_asd(){
	document.getElementById('domain_w').style.display=(document.getElementById('domain_w').style.display=='none'?'':'none');
}

function check_domain_chars(){
	var field=document.getElementById('domain_input').value;
	var reg=new RegExp(/^[a-zA-Z\-0-9]{3,}$/);
	if(field.match(reg))
		return true;
	else{
		alert('דומיין חייב להכין לפחות 3 תווים, התווים המורשים הם:אנגלית,מספרים ומקף');
		return false;
	}
}

function redirect(url,time){
	var times=time?time:0;
	setTimeout("window.location=('"+url+"');",times);
}

function blank(url){
	window.open(url);
	return false;
}

function switch_num_in_page(value){
	window.location="customer.html"+"?in_page="+value;
}

function change_action_send(form,value){
	document.getElementById(form).action="http://"+document.getElementById(value).value+"/admin.php";
	document.getElementById(form).submit();
	return false;
}