//left and right content check
window.onload = function start(){
	if(document.getElementById('leftcontent').offsetHeight > (document.getElementById('rightcontent').offsetHeight)){
	var height = document.getElementById('leftcontent').offsetHeight + 150;
	document.getElementById('rightcontent').style.height = height+"px";
	}
	else{
		//document.getElementById('rightcontent').style.height = height=document.getElementById('leftcontent').offsetHeight+"px";
		document.getElementById('rightcontent').style.height = '1200px';
	}
}

function showOptions(divid4){
	if(divid4=="question1"){
		if(document.getElementById('question1').style.display=='block'){
			document.getElementById('question1').style.display='none';
		}
		else{document.getElementById('question1').style.display='block';}
		if(document.getElementById('question2').style.display=='block'){
			document.getElementById('question2').style.display='none';
		}
	}
	else{
		if(document.getElementById('question2').style.display=='block'){
			document.getElementById('question2').style.display='none';
		}
		else{document.getElementById('question2').style.display='block';}
		if(document.getElementById('question1').style.display=='block'){
			document.getElementById('question1').style.display='none';
		}
	}
}

var block = false;
function toggleRssOptions(div){
	block = true;
	if(document.getElementById(div).style.display == 'none'){
		document.getElementById(div).style.display = 'block';
	}
	else{
		document.getElementById(div).style.display = 'none';
	}
}

function checkStatus(){
	if(block == false){
		var div = document.getElementById('rssoptions');
		if(div.style.display == 'block'){
			toggleRssOptions('rssoptions');
		}
	}
	else{
		block = false;
	}
}

//contact form action

function changeAction(){
	var form = document.getElementById('myform');
	//var myNewString = document.getElementById('question12').innerHTML.replace(/Ã¤/g, "a");
	//var myNewString = myNewString.replace("å", "a");
	//var myNewString = myNewString.replace("ö", "o");
	form.action = form.action + document.getElementById('inp1').value + "/" + document.getElementById('inp2').value;
}
var visible = 0;
function showLanguage(){
	if(visible==0){
		document.getElementById('languages').style.display = 'block';
		visible = 1;
	}
	else if(visible == 1){
		document.getElementById('languages').style.display = 'none';
		visible = 0;
	}
}

function showCountrySelectionBox() {
	var csb = document.getElementById('flashwrapper');	
	csb.innerHTML='<div style="width:949px; height:353px; border:0px solid red; z-index:999999; "><img src="http://www.speakersforum.fi/img/map_country.png" /><div style="position:relative; display:block; float:none; margin:-350px 0 0 0; padding:70px 0 0 700px;"><p><a href="http://www.speakersforum.fi/" target="_self" style="border: 0px solid red; text-decoration:none; font-family:Gerorgia, Times, Arial, Helvetica, sans-serif; font-weight:bold; font-size:14px; color: #FFFFFF;width:300px; height:35px;" title=""><img src="http://www.speakersforum.fi/img/flags/finland.jpg" alt="FINLAND" border="0" width="21" height="13" style="margin:0 30px 0 0; color:#FFFFFF;" />FINLAND</a></p><br><p><a href="http://www.talarforum.se/" target="_self" style="border: 0px solid red; text-decoration:none; font-family:Gerorgia, Times, Arial, Helvetica, sans-serif; font-weight:bold; font-size:14px; color: #FFFFFF; width:300px; height:35px;" title=""><img src="http://www.speakersforum.fi/img/flags/sweden.jpg" alt="SWEDEN" border="0" width="21" height="13" style="margin:0 30px 0 0; color:#FFFFFF;" />SWEDEN</a></p><br><p><a href="http://www.talerforum.no/" target="_self" style="border: 0px solid red; text-decoration:none; font-family:Gerorgia, Times, Arial, Helvetica, sans-serif; font-weight:bold; font-size:14px; color: #FFFFFF;width:300px; height:35px;" title=""><img src="http://www.speakersforum.fi/img/flags/norway.jpg" alt="NORWAY" border="0" width="21" height="13" style="margin:0 30px 0 0; color:#FFFFFF;" />NORWAY</a></p><br><p><a href="http://www.taleforum.dk/" target="_self" style="border: 0px solid red; text-decoration:none; font-family:Gerorgia, Times, Arial, Helvetica, sans-serif; font-weight:bold; font-size:14px; color: #FFFFFF;width:300px; height:35px;" title=""><img src="http://www.speakersforum.fi/img/flags/denmark.jpg" alt="DENMARK" border="0" width="21" height="13" style="margin:0 30px 0 0; color:#FFFFFF;" />DENMARK</a></p><br><p><a href="http://www.competenceforum.ee/" target="_self" style="border: 0px solid red; text-decoration:none; font-family:Gerorgia, Times, Arial, Helvetica, sans-serif; font-weight:bold; font-size:14px; color: #FFFFFF;width:300px; height:35px;" title=""><img src="http://www.speakersforum.fi/img/flags/estonia.jpg" alt="ESTONIA" border="0" width="21" height="13" style="margin:0 30px 0 0; color:#FFFFFF;" />ESTONIA</a></p><br><p><a href="http://www.talarforum.com/" target="_self" style="border: 0px solid red; text-decoration:none; font-family:Gerorgia, Times, Arial, Helvetica, sans-serif; font-weight:bold; font-size:14px; color: #FFFFFF;width:300px; height:35px;" title=""><img src="http://www.speakersforum.fi/img/flags/usa.jpg" alt="USA" border="0" width="21" height="13" style="margin:0 30px 0 0; color:#FFFFFF;" />USA</a></p></div></div>';
}

//<------end left nad right content height check
//rolldown and up
//var rollDivs = new Array();
//var up = false;
//var sinus = 2;
//function rollDown(divId,height){
		/*for(i in rollDivs)
		{
		   if(i == divId)
		   {*/
		     // if(rollDivs[divId] == 1) up=true; 
		   /*}
		}*/
		/*if(up==false)
		{
			var maxHeight = height;
			var div = document.getElementById(divId);
			div.style.visibility = "visible";
			if(div.offsetHeight < maxHeight){
				div.style.height = div.offsetHeight+3 + sinus + "px";
				if(sinus<10){sinus++;}
				setTimeout("rollDown('"+divId+"',"+maxHeight+");", 10);
			}
			else{
				div.style.height = maxHeight+6 + "px";
				sinus=0;
				rollDivs[divId] = 1;
			}
		}
		else{
			var div = document.getElementById(divId);
			div.style.visibility = "hidden";
			div.style.height = "1px";
			rollDivs[divId] = 0;
			
		}
		up=false;
		if(document.getElementById('rightcontent').offsetHeight < document.getElementById('leftcontent').offsetHeight){
		document.getElementById('rightcontent').style.height = document.getElementById('leftcontent').offsetHeight+"px";}
}*/
//rolldownup end
