function synlighet(div){
	if (document.all) {
		if(!this.document.all['MainArea']){return;}
		obj = document.all[div].style
		if(div=='AttachedFiles') {obj.top = document.all['MainArea'].offsetTop + 35;}
		if(div=='kontakt') {obj.top = document.all['MainArea'].offsetTop + 35;}
		if(obj.visibility=='visible' || obj.visibility=='show') {obj.visibility='hidden'}
		else {obj.visibility='visible'}
	}
	else {
		obj = document.layers[div]
		if(obj.visibility=='visible' || obj.visibility=='show') {obj.visibility='hidden'}
		else {obj.visibility='show'}
	}
}
function SetCombo() {
	if(document.combo){document.combo.choice.options.selectedIndex=0}
}

function mOvr(src)
{if (!src.contains(event.fromElement)) { src.style.cursor = 'hand'; src.bgColor = '#f4f4f4';}}
function mOut(src) 
{if (!src.contains(event.toElement)) { src.style.cursor = 'default'; src.bgColor = '#ffffff';}}
function mClk(src) 
{if(event.srcElement.tagName=='TD'){src.children.tags('A')[0].click();}}
function Vote(Poll_ID) {
	var checked=false; theForm=eval('document.Pollform'+Poll_ID)
	for (i = 0; i < theForm.Quest_ID.length; i++) {
		if(theForm.Quest_ID[i].checked==true){checked=true}
	}
	if(checked==true){theForm.submit();}
}
function setContactHeight() {
	if (document.all.kontakt) {document.all.kontakt.style.height=document.all['LeftMenuEnd'].offsetTop-70}
}
function OpenWin(url,width,height,x,y,scrollbars,resizable,toolbar,location,directories,status,menubar,name) {
	if(width==null){width=600}; if(height==null){height=400}
	if(scrollbars==null){scrollbars='yes'};
	if(resizable==null){resizable='yes'};
	if(x==null){x=(screen.width/2)-(width/2);if(x<0){x=0}}
	if(y==null){y=(screen.height/2)-(height/2)-80;if(y<0){y=0}}
	Win = window.open("",name,"width="+width+",height="+height+",screenX="+x+",screenY="+y+",resizable="+resizable+",scrollbars="+scrollbars+",toolbar="+toolbar+",location="+location+",directories="+directories+",status="+status+",menubar="+menubar+",left="+x+",top="+y);
	if(url!=null && url!=''){Win.location = url};
	Win.focus();
}
function CorrectEmail(email) {
	if(email.length>0){
		var email_len = email.length;
		var snabel = email.indexOf('@');
		var punkt =  email.lastIndexOf('.');
		if ( (snabel < 1) || (snabel > (email_len - 5)) ) {return false;}
		if ( ((punkt + 3) > email_len) || ((punkt + 5) < email_len) ) {return false;}
	}
	return true;
}

var otd=0,of1=0,of2=0,of3=0,of4=0,of5=0,or1=0,or2=0,or3=0
function ReadTextSize(ReadSize){
	if (!document.all) {return}
	var DivObj=document.getElementById('TextSizeCheck');
	var Multiplier = 1

	TheHeight=DivObj.offsetHeight;
	if(TheHeight>17){Multiplier=1.4}
	else if(TheHeight>14){Multiplier=1.2}
	else if(TheHeight<11){Multiplier=0.7}
	else if(TheHeight<13){Multiplier=0.9}

	for (i=0;i < document.styleSheets[0].rules.length;i++) {
		clsObj=document.styleSheets[0].rules[i]
		clsName=clsObj.selectorText
		newSize='';
		if(clsName=='TD'){if(otd==0){otd=GetTextSize(clsObj)};newSize=otd*Multiplier}
		if(clsName=='.f1'){if(of1==0){of1=GetTextSize(clsObj)};newSize=of1*Multiplier}
		if(clsName=='.f2'){if(of2==0){of2=GetTextSize(clsObj)};newSize=of2*Multiplier}
		if(clsName=='.f3'){if(of3==0){of3=GetTextSize(clsObj)};newSize=of3*Multiplier}
		if(clsName=='.f4'){if(of4==0){of4=GetTextSize(clsObj)};newSize=of4*Multiplier}
		if(clsName=='.f5'){if(of5==0){of5=GetTextSize(clsObj)};newSize=of5*Multiplier}
		if(clsName=='.r1'){if(or1==0){or1=GetTextSize(clsObj)};newSize=or1*Multiplier}
		if(clsName=='.r2'){if(or2==0){or2=GetTextSize(clsObj)};newSize=or2*Multiplier}
		if(clsName=='.r3'){if(or3==0){or3=GetTextSize(clsObj)};newSize=or3*Multiplier}
		if(newSize!=''){
			if(newSize<6.5){newSize=6.5}
			newSize=newSize + 'pt'
			document.styleSheets[0].rules[i].style.fontSize=newSize
		}
	}
}

function GetTextSize(clsObj) {
	var fontSize = clsObj.style.fontSize
	return (fontSize.substr(0,fontSize.length-2))
}

function ObjInfo(InfoObj) {
	var Txt=''
	for(Param in InfoObj) {Txt=Txt + Param + ' | '}
	alert(Txt)
}