function flash_play(ad,ct,w,h) {
        document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+w+'" height="'+h+'">');
        document.write('<param name="movie" value="'+ad+'?clickTAG='+ct+'">');
        document.write('<param name="menu" value="false"><param name="quality" value="high">');
        document.write('<param name="wmode" value="transparent">');
        document.write('<embed src="'+ad+'?clickTAG='+ct+'" menu="false" quality="high" width="'+w+'" height="'+h+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>');
        document.write('</object>');
}

function flash_show(url,w,h) {
        document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+w+'" height="'+h+'">');
        document.write('<param name="movie" value="'+url+'">');
        document.write('<param name="menu" value="false"><param name="quality" value="high">');
        document.write('<param name="wmode" value="transparent">');
        document.write('<embed src="'+url+'" menu="false" quality="high" wmode="transparent" width="'+w+'" height="'+h+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>');
        document.write('</object>');
}

function popup() {
	window.open('/popup.htm','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=525,height=480,left=44,top=44');
}
function sbm_popup() {
	x=window.open('/img/Misc/sbm/index.html','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,width=555,height=500,left=44,top=44');
}

var col1; col1 = "#2891FA"; 
var col1off; col1off = "#FFFFFF";
function taust1(asi1) { asi1.bgColor = col1; }
function taust2(asi1) { asi1.bgColor = col1off; }
var col2; col2 = "#E8F2FB"; 
var col2off; col2off = "#FFFFFF";
function taust3(asi2) { asi2.bgColor = col2; }
function taust4(asi2) { asi2.bgColor = col2off; }
var col3; col3 = "#FEF1DA"; 
var col3off; col3off = "#FFFFFF";
function taust5(asi3) { asi3.bgColor = col3; }
function taust6(asi3) { asi3.bgColor = col3off; }
var col4; col4 = "#D8EBFC"; 
var col4off; col4off = "#E6F1FC";
function taust7(asi4) { asi4.bgColor = col4; }
function taust8(asi4) { asi4.bgColor = col4off; }
var col5; col5 = "#FCDCA4"; 
var col5off; col5off = "#FCE7BA";
function taust9(asi5) { asi5.bgColor = col5; }
function taust10(asi5) { asi5.bgColor = col5off; }
var col6; col6 = "#E2E57E"; 
var col6off; col6off = "#EAED94";
function taust11(asi6) { asi6.bgColor = col6; }
function taust12(asi6) { asi6.bgColor = col6off; }

function setpointer(com,asi,action) {
	v=document.email;
	if(action == 'over') {
		if(v.elements['MailID['+com+']'].checked == false) {
			asi.bgColor=col2;
		}
	}
	if(action == 'out') {
		if(v.elements['MailID['+com+']'].checked == false) {
			asi.bgColor=col2off;
		}
	}
}

function PageNumbers(a) {
	document.nav.start.value=a;
	document.nav.submit();
}

function doFilter() {
	document.nav.start.value=0;
	document.nav.submit();
}

function sort_order(a) {
	document.nav.sort.value=a;
	document.nav.submit();
}

function openwin(theURL,winName,features) {
	xaken=window.open(theURL,winName,features);
}

function ShowPicture(Image,Width,Height) {
	openwin('/photo.php?i='+Image,'Pilt','toolbar=0,status=0,menubars=0,scrollbars=0,resizable=0,location=0,directories=0,width='+Width+',height='+Height+',top=50,left=50');
}

function video_play(a,l) {
	var pressWin = window.open("http://www.turismiweb.ee/player.php?i="+a+'&l='+l, "Player","scrollbars=no,menubar=no,toolbar=no,status=no,width=363,height=495,resizable=no,top=100,left=100");
}

function video_play2(a) {
	var pressWin = window.open("http://www.turismiweb.ee/newplayer.php?v="+a, "Player","scrollbars=no,menubar=no,toolbar=no,status=no,width=320,height=280,resizable=no,top=100,left=100");
}

function check_otsi() {
	if(document.otsing.portal[1].checked==true) {
		document.otsing.target='_blank';
	}
	else {
		document.otsing.target='';
	}
}

function SendEmail() {
	var v=document.email;
	var ch=0;
	for(i=0; i < v.elements.length; i++){
		if(v.elements[i].checked) ch++;
	}
	if(!ch) alert('Midagi pole valitud');
	else v.submit();
}


function checkEmail(email)
{
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(email)) return true;
	else return false;
}

function cfsubmit(keel) {
	var v = document.forms['nav'];
	var inim=false;
	var ruum=false;
	if(!keel) keel='ee';
 	if(keel!='ee') keel='en';
	message=new Object();
	message['ee']='Vali saali stiil.';
	message['en']='Choose style.';
	for(i=0;i<v.inimesi.length;i++){
		if(v.inimesi[i].checked) inim=true;
	}
	if(inim==true) {
		for(i=0;i<v.room.length;i++){
			if(v.room[i].checked) ruum=true;
		}
	}
	if(inim==true && ruum!=true) alert(message[keel]);
	else v.submit();
}

function cfreset(keel) {
	document.location='/'+keel+'/conference/';
}

function form_register() {
	var v=document.rv;
	//if(v.elements['reg[Conditions]'].checked==true) {
		v.submit();
	//}
}

function show_more(a) {
    var tr = document.getElementById(a);
    if(tr.style.display) {
        tr.style.display='';
    }
    else {
        tr.style.display='none';
    }
}

function liisi_vorm()
{
	v=document.forms['liisi_saada'];
	if(!v.eesnimi.value || !v.perenimi.value || !v.isikukood.value || !v.elukoht.value || !v.epost.value || !v.telefon.value || !v.t88koht.value) {
		alert('Täida kohustuslikud väljad.');
	}
	else
	{
		box=confirm('Esitan taotluse ja kinnitan, et andmed minu kohta on korrektsed.');
		if(box==true)
		{
			v.submit();
		}
	}
}

// kaardifuktsioonid
function Kaart(a,l) {
	openwin('/map.php?i='+a+'&l='+l,'','toolbar=0,status=0,menubars=0,scrollbars=0,resizable=0,location=0,directories=0,width=555,height=350,top=50,left=50');
}

function Kaart2(a) {
	openwin('/kaart.php?ob_id='+a,'','toolbar=0,status=0,menubars=0,scrollbars=0,resizable=0,location=0,directories=0,width=555,height=483,top=50,left=50');
}

function Kaart3(a) {
	openwin('/gkaart.php?ob_id='+a,'','toolbar=0,status=0,menubars=0,scrollbars=0,resizable=0,location=0,directories=0,width=660,height=450,top=50,left=50');
}

function zoom(a) {
	document.map.noz.value=1;
	document.map.zoom_s.value=a;
	document.map.submit();
}

function move(a) {
	document.map.noz.value=1;
	document.map.nihe.value=a;
	document.map.submit();
}

function LgMap(SObj) {
	if(SObj.options[SObj.selectedIndex].value=="lg"){
		var a=document.map.fullscreen.value;
		openwin(a,'Fullscreen','width=800,height=600,menubar=1')
		document.map.mapsize.value="sm";
	}
}

function show_kaart(x,y,zoom,label) {
	document.map.bbox.value='';
	document.map.adr_x.value=x;
	document.map.adr_y.value=y;
	document.map.zoom_s.value=zoom;
	document.map.adlabel.value=label;
	document.map.submit();
}
