/* JULEKALENDAR - NYTT VINDU */
function dag(d) { // (url)

	var p = "height=450,width=430,scrollbars=yes";
	var detect = navigator.userAgent.toLowerCase();
	ie = detect.indexOf('msie') + 1;
	opera = detect.indexOf('opera') + 1;

	if(opera) {
		var url = "startsia/kal.php?d=" + d;
                window.open(url,"",p);
	} else if(ie) {
		var url = "kal.php?d=" + d;
		window.open(url,"",p);	
	} else {
		var url = "startsia/kal.php?d=" + d;
		window.open(url,"",p);
	}
} 


/* VIS/SKJUL DIV-ID-ELEMENT */
function expandcollapsestart(thistag) {
                
	styleObj = document.getElementById(thistag).style;
      	if (styleObj.display=='none') {
		styleObj.display = '';
		document.getElementById('startsia').style.display = 'none';
        } 
	else {
		styleObj.display = 'none';
		document.getElementById('startsia').style.display = '';
	}
}

function expandcollapse(thistag) {

        styleObj = document.getElementById(thistag).style;
        if (styleObj.display=='none') {
                styleObj.display = '';
        }
        else {
                styleObj.display = 'none';
        }
}

function expand (thistag) {
	styleObj.display = '';
}

/* VIS DIV-ID-ELEMENT */
function expand(thistag) {
                
	styleObj = document.getElementById(thistag).style;
      	if (styleObj.display=='none') {styleObj.display = '';}
}
        
/* LEGG TIL IKON I SKRIV_MOTEPLASS */
        
function addicon(icon) {
    	document.nytt_innlegg.melding.value = document.nytt_innlegg.melding.value + " " + icon + " ";
}

function changecolor(color) {
	feil = 0;
	if(document.farge.valg[0].checked) {
		valg = "t_bg";
	} else if(document.farge.valg[1].checked) { 
		valg = "t_bg_main";
	} else if(document.farge.valg[2].checked) { 
		valg = "t_text";
	} else if(document.farge.valg[3].checked) { 
		valg = "t_link";
	} else {
		alert("Du må velja ein tå knappane før du vel farge, elles kan ein ikkje veta ka du ska endra på..");
		feil = 1;
	} 

	var detect = navigator.userAgent.toLowerCase();
	
	place = detect.indexOf('msie') + 1;

	if(feil < 1) {
		if(place) {
			location.href = "farga.php/?" + valg + "=" + color;
		} else {
			location.href = "personleg/farga.php/?" + valg + "=" + color;
		}
	}
}

