// Open window
var newWin = null;
function popMeUp(strURL,strType,strWidth,strHeight) {
	if (newWin != null){
		if(!newWin.closed) newWin.close();
	}
	var left=((window.screen.width/2)-(strWidth/2))-12;
	var top=((window.screen.height/2)-(strHeight/2));
	var strOptions="";
	if (strType=="console") strOptions="resizable,scrollbars,height="+strHeight+",width="+strWidth+",left="+left+",top="+top;
	if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth+",left="+left+",top="+top;
	if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth+",left="+left+",top="+top;
	newWin = window.open(strURL, 'newWin', strOptions);
	newWin.focus();
}

// No spam e-mail address
function noSpam(a,b,c) {
	document.write('<a href="mai'+'lto:'+c+'@'+b+'.'+a+'">'+c+'@'+b+'.'+a+'</a>');
}

// Cloak password field v2
function cloakpass(a,b,c) {
	switch(a) {
		case 0:
			e = "<input name=" + b + " type=\"text\" value=\"Lösenord\" size=\"8\" class=\"fstyle2\" onfocus=\"cloakpass(1, this.name, this.form.name);\" />";
			cloakwrite(e);
		break;
		case 1:
			e = "<input name=" + b + " type=\"password\" size=\"8\" class=\"fstyle2\" onblur=\"if(this.value==''){cloakpass(0, this.name, this.form.name);}\" />";
			cloakwrite(e);
			document[c][b].focus();	// Browser comp workaround
			document[c][b].select();
			document[c][b].focus();
			document[c][b].select();
			document[c][b].focus();
			document[c][b].select();
		break;
	}
}
function cloakwrite(a) {
	if (check.b == "ie") {
		document.all.pwfield.innerHTML = a;
	} else {
		document.getElementById("pwfield").innerHTML = a;
	}
}
// Go to url
var gourl = "";
function go() {
	document.location.href = gourl;
}
function url(a) {
	gourl = a;
	b = "";
	if (a) {
		b = "http://www.grannar.se/";
	}
	window.status = b + a;
}
// Hide/Show divs
function xtoggle(a) {
	b = document.getElementById(a).style;
	if (b.display=="none") {
		b.display="block";
	} else {
		b.display="none";
	}
}
// Hide/Show 2 Divs
function xtoggle2(a) {
	b = document.getElementById(a).style;
	c = document.getElementById(a+"2").style;
	if (c.display=="none") {
		c.display="block";
		b.display="none";
	} else {
		b.display="block";
		c.display="none";
	}
}
// Flash maker v2
function prntFlash(a,b,c,d,e,f,g) {
	if (check.flash >= c) {
		var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+a+'" height="'+b+'" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
		+ '<param name="movie" value="'+d+'.swf" /><param name="FlashVars" value="'+e+'" /><param name="loop" value="true" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="scale" value="exactfit" /><param name="wmode" value="'+f+'" />'
		+ '<embed src="'+d+'.swf" flashvars="'+e+'" name="movie" loop="true" menu="false" quality="high" swLiveConnect="true" width="'+a+'" height="'+b+'" scale="exactfit" wmode="'+f+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>';
		document.write(oeTags);
	} else {
		document.write(g);
	}
}

