function check_email(e) {
ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
for(i=0; i < e.length ;i++){
if(ok.indexOf(e.charAt(i))<0){ 
return (false);
}
} 
if (document.images) {
re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
if (!e.match(re) && e.match(re_two)) {
return (-1);
} 
}
}

function check_form(f) { // f is the form (passed using the this keyword)
if(f.name.value.length < 1 || f.name.value == "" ){
alert("You entered less than one character in the name field.");
f.name.focus(); // put the prompt in the name field 
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.name.style.background = "#FF5321";
}
// make sure the form is not submitted
return false;
}

// check the first email address ( the exclamation means "not" )
else if(!check_email(f.email.value)){
alert("Invalid email detected.");
f.email.focus(); 
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.email.style.background = "#FF5321";
}
// make sure the form is not submitted
return false;
}
else if(f.query.value.length < 1 || f.query.value == "" ){
alert("Please enter your querie.");
f.query.focus(); // put the prompt in the name field 
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.query.style.background = "#FF5321";
}
// make sure the form is not submitted
return false;
}

}

function Submit(action,red,rom,posoka,I,re,req) {
var action;
var red;
var rom;
var posoka;
var I;
var re;
var req;

document.formata.count.value = action;
document.formata.criterij.value = red;
document.formata.room.value = rom;
document.formata.action = posoka;
document.formata.ID.value = I;
document.formata.remove.value = re;
document.formata.request.value = req;






document.formata.submit();

}
function Search()
{
document.write("<INPUT TYPE='text' name='q' size='10' maxlength='200' style='background: #FFFEF0'>"); 
document.write("&nbsp;<INPUT type='submit' name='sa' VALUE='Search'>"); 
document.write("<INPUT type='hidden' name='cof' VALUE='S:http://www.furnishing-house.com/;GL:0;AH:left;BGC:#FFFEF0;LH:55;L:http://www.furnishing-house.com/pics/logo3.jpg;LW:588;AWFID:f6e45326bfa74b81;'>"); 
document.write("<input type='hidden' name='domains' value='http://www.furnishing-house.com/'><br>"); 
document.write("&nbsp;<input type='radio' name='sitesearch' value=''> Web");  
document.write("&nbsp;<input type='radio' name='sitesearch' value='http://www.furnishing-house.com/' checked> Site Search<br>"); 
}
