﻿
/*
	MODULE: forum_header
	 This will be printed inside <head>-tag.
*/
// PRINT OUT IN HEAD TAG FOR THE PAGES. DONT WHEN ACTION IS SENT (THEN IT IS IN ETREWEB)
 		
			
				

				function showNewTopic() {										  
					if (pageaccess!="1") { 
						document.getElementById("forumpost").style.height = "445px";					
					} else {
						document.getElementById("forumpost").style.height = "365px";					
					}
				}				
				function showNewReply() {									
	
					if (pageaccess!="1") {	
						document.getElementById("forumpostreply").style.height = "415px";					
					} else {
						document.getElementById("forumpostreply").style.height = "355px";					
					}
				}								
				
				function validatetopic(f) {								
					var txt = "";
					if (f.name.value=="") { 	txt = txt +"Namn\n";	}	
					if ((pageaccess!="1") && (!emailcheck(f.email.value))) {txt = txt +"E-post\n";	}
					if (f.title.value=="") {txt = txt +"Rubrik\n";	}										
					if ((pageaccess!="1") && (f.security_code.value=="")) { 	txt = txt +"Kod\n";	}						
					if ((pageaccess!="1") && (f.security_code.value=="[Ange koden ovan]")) { 	txt = txt +"Kod\n";	}						
					if (txt == "") { 					
						return true;	
					} else {
						alert("Obligatoriskt:\n\n"+txt);
						return false;		
					}						
				}
				function validatereply(f) {								
					var txt = "";
					if (f.name.value=="") { 	txt = txt +"Namn\n";	}	
					if ((pageaccess!="1") && (!emailcheck(f.email.value))) {txt = txt +"E-post\n";	}
					if (f.message.value=="") {txt = txt +"Svar\n";	}					
					if ((pageaccess!="1") && (f.security_code.value=="")) { 	txt = txt +"Kod\n";	}		
					if ((pageaccess!="1") && (f.security_code.value=="[Ange koden ovan]")) { 	txt = txt +"Kod\n";	}										
					if (txt == "") { 					
						return true;	
					} else {
						alert("Obligatoriskt:\n\n"+txt);
						return false;		
					}						
				}			
				
				function forumline_hover(line) {					
					document.getElementById(line).style.background="#d9e6f7";					
					document.getElementById(line).style.cursor="pointer";										
				}	
				function forumline_out(line) {					
					document.getElementById(line).style.background="#fff";					
					document.getElementById(line).style.cursor="pointer";					
				}	
				
				function toggleModeratorAdmin() {																
					if ((document.getElementById("forumAdminPanelBg").style.display=="") || (document.getElementById("forumAdminPanelBg").style.display=="none")) {					
						document.getElementById("forumAdminPanelBg").style.display="block";
						document.getElementById("forumAdminPanel").style.display="block";
					} else {
						document.getElementById("forumAdminPanelBg").style.display="none";
						document.getElementById("forumAdminPanel").style.display="none";						
					}										
				}
				
		
