/* author: designer */
/* Creation date: 07.7.2003 . */
//--------------------------------- Currency rates and Weather information------------------------------------------------------
var dollar="1.431480";
var pound="2.901820";
var frank="1.183990";
var euro="1.955830";

var d="d";
var p="d";
var f="d";

var allobj="1119";

//-----------------------------------------------------------------------------------------------------------
function goodDay(){
var dt = new Date(); 
if (dt.getHours() <11) document.write('<font color="green" size="+1">Good Morning!!!</font>'); 
else if (dt.getHours() < 17) document.write('<font color="green" size="+1">Good Afternoon!!!</font>'); 
else if (dt.getHours() < 23) document.write('<font color="green" size="+1">Good Evening!!!</font>');
else document.write('<font color="green">Good Night!!!</font>');
}
function dollarWrite(){
	document.write("&nbsp;&nbsp;<img src='../../icons/summary/usd.gif' stylle='border:none' width='18' height='12' align='middle' alt='Properties in Bulgaria' /><strong>&nbsp USD: "+dollar+"</strong>&nbsp;<img src='../../icons/summary/"+d+".gif' border='0' width='9' height='9' align='middle' alt='American Dollar' />"); 
}
function euroWrite(){
	document.write("&nbsp;&nbsp;<img src='../../icons/summary/eur.gif' stylle='border:none' width='18' height='12' align='middle' alt='European Euro' /><strong>&nbsp EUR: "+euro+"</strong>&nbsp;<img src='../../icons/summary/e.gif' border='0' width='9' height='9' align='middle' alt='European Euro' />");

}
function poundWrite(){
	document.write("&nbsp;&nbsp;<img src='../../icons/summary/gbp.gif' border='0' width='18' height='12' align='middle' alt='Real Estate in Bulgaria for Sale' /><strong>&nbsp GBP: "+pound+"</strong>&nbsp;<img src='../../icons/summary/"+p+".gif' border='0' width='9' height='9' align='middle' alt='Great Britain Pound' />"); 
}
function frankWrite(){
	document.write("&nbsp;&nbsp;<img src='../../icons/summary/chf.gif' border='0' width='18' height='12' align='middle' alt='Property for sale in Bulgaria' /><b>&nbsp CHF: "+frank+"</b>&nbsp;<img src='../../icons/summary/"+f+".gif' border='0' width='9' height='9' align='middle' alt='frank'>"); 
}
function show(w){
	var o=document.getElementById(w);
	o.style.visibility='visible';
}
function hide(w){
	var o=document.getElementById(w);
	o.style.visibility='hidden';
}
function over(n){
	n.style.backgroundColor='#008ACE';
}
function out(n){
	n.style.backgroundColor='';
}
function loc(str){
	location.href=str;
}

function load(directory){
curTime()
    if(document.images){
        names=load.arguments
        pictures=new Array;
        for (z=1;z<names.length;z++){
            pictures[z]=new Image;
            pictures[z].src=directory+names[z];
        }
    }    
}
function replace1(image){
	document.home.src = image;
}
function replace2(image){
	document.search.src = image;
}
function replace3(image){
	document.contact.src = image;
}
function replace4(image){
	document.forum.src = image;
}
function replace5(image){
	document.news.src = image;
}
function replace6(image){
	document.offers.src = image;
}
function openWindowru(price){
	var price;
  calcwindow=window.open('http://www.daoreal.com/r/calc.php?c3='+price+'','calc','width=300,height=150,toolbar=0,menubar=0,scrollbars=0,status=0,resizable=0,screenx=225,screeny=230');
}
function openWindow(price){
	var price;
	calcwindow=window.open('http://www.daoreal.com/calc.php?c3='+price+'','calc','width=300,height=150,toolbar=0,menubar=0,scrollbars=0,status=0,resizable=0,screenx=225,screeny=230');
}
function openWindownew(){
	calcwindow=window.open('http://www.daoreal.com/r/index.html');
}
function Markit(){
	calcwindow=window.open('http://daoreal-com.local/icons/watermark.php','MarkIt','width=400,height=400,toolbar=0,menubar=0,scrollbars=0,status=0,resizable=0,screenx=225,screeny=230');
}
function openDelWindow(){
	calcwindow=window.open('http://daoreal-com.local/dele.php','Delite','width=400,height=500,toolbar=0,menubar=0,scrollbars=0,status=0,resizable=0,screenx=225,screeny=230');
}
function Submit(action,criterij,red) {
	var action;
	var criterij;
	var red;
	document.as.count.value = action;
	document.as.criterij.value = criterij;
	document.as.red.value = red;
	document.as.submit();
}
function prepare(flag){
	var flag;
	document.form.flag.value = flag;
}
function arrange(criterij) {
	var flag;
	document.form.flag.value = flag;
}
function check_email(e) {
	if(e=="your@mail.com")return (false);
	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 == "" ) && f.language.value=="e"){
	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 = "#ED2F00";
	}
// make sure the form is not submitted
return false;
}else if((f.name.value.length < 1 || f.name.value == "" ) && form.language.value=="r" ){
	alert("            .");
	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 = "#ED2F00";
	}
// make sure the form is not submitted
return false;
}else if((f.name.value.length < 1 || f.name.value == "" ) && form.language.value=="d" ){
	alert("Sie sollen min. 1 Symbol fur Name einschreiben.");
	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 = "#ED2F00";
	}
// make sure the form is not submitted
return false;
}
// check the first email address ( the exclamation means "not" )
if(!check_email(f.email.value)&&(f.language.value=="e")){
	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 = "#ED2F00";
}
// make sure the form is not submitted
return false;
}else if(!check_email(f.email.value)&&(form.language.value=="r")){
	alert("Email          ");
	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 = "#ED2F00";
	}
// make sure the form is not submitted
return false;
}
if(!check_email(f.email.value)&&(form.language.value=="d")){
alert("Invalid email.");
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 = "#ED2F00";
}
// make sure the form is not submitted
return false;
}
// check the second email address

}

function copyright(){
	alert("COPYRIGHT  WWW.DAOREAL.COM");
	return false;
}

//document.oncontextmenu=copyright;

/*
function curTime()
{


var time = new Date()
   var gmtMS = time.getTime() + (time.getTimezoneOffset() * 60000)
   var gmtTime =  new Date(gmtMS)
   var hrs = gmtTime.getHours() + 3
   var min = gmtTime.getMinutes()
   var sec = gmtTime.getSeconds()
var don="AM"
if (hrs>=12){ don="PM" }
if (hrs>12) { hrs-=12 }
if (hrs==0) { hrs=12 }
if (hrs<10) { hrs="0"+hrs }
if (min<10) { min="0"+min }
clock.innerHTML=hrs+":"+min+" "+don
setTimeout("curTime()",1000)
}


function blinkIt() {
 if (!document.all) return;
 else {
   for(i=0;i<document.all.tags('blink').length;i++){
      s=document.all.tags('blink')[i];
      s.style.visibility=(s.style.visibility=='visible')?'hidden':'visible';
   }
 }
}
document.onload=setInterval('blinkIt()',500);*/
function emoticon(text) {
	var txtarea = document.form.question;
	text = ' ' + text + ' ';
	txtarea.value  += text;
	txtarea.focus();
}

function ClearPriceRanges() {
	document.as.price_m2_lowest.value = "";
	document.as.price_m2_highest.value = "";
}