// JavaScript Document

function bookmarksite(url,title){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}

function setasHome(){
document.body.style.behavior='url(#default#homepag e)';
document.body.setHomePage('http://www.kafene.bg');
}
function checkForm(id){
 if (checkForEmptyRequired(id)) {
	if (EmailCheck(id)) {
		return true;
	 }
 }
	return false;
}

function checkForm(id){
 if (checkForEmptyRequired(id)) {
	if (EmailCheck(id)) {
		return true;
	 }
 }
	return false;
}

function EmailCheck(id){
myemail = new String(document.forms[id].email.value + "_");
 if (myemail.indexOf("@") == -1 | myemail.indexOf(".") == -1){
		alert("Моля, въведете коректен емейл!");
		return false;
	}
		return true;
 }

function checkForEmptyRequired(id){
 for(i = 0; i < (document.forms[id].elements.length);i++){
 	if ((document.forms[id].elements[i].value) == "" && (document.forms[id].elements[i].name.substring(0,2)) == "r_"){
		alert("Моля, попълнете нужните данни!");
		return false;
	}
 }
 return true;
 }
 
 function comment()
 {
  var com = document.getElementById('comment');
  var fr = document.getElementById('friend');
  com.style.display="block";
  fr.style.display="none";
  
  
  }
  
  
 function friend()
 {
  var com = document.getElementById('comment');
  var fr = document.getElementById('friend');
  fr.style.display="block";
  com.style.display="none";
  
  
  }  