function showEditWindow(src,wname,w,h,s,st,f)
{
	if (src=="#") return
	else
	{
		w = w ? w : 600;
		h = h ? h : 500;
		s = s ? s : "yes";
		st = st ? st : "yes";
		f = f ? f : "no";
		wname = wname ? wname : "newWin"+(Math.floor(Math.random()*100000));
		var winl = (screen.width - w) / 2;
		var wint = (screen.height / 2) - h;
		winprops = "Fullscreen="+f+",height="+h+",width="+w+",top="+wint+",left="+winl+
		           "toolbar=no,status="+st+",scrollbars="+s+",location=no,menubar=no,directories=no,resizable";
		window.open(src,wname,winprops);
	}
}

var allchecked;

function checkAll( theForm) {
  if (allchecked) { allchecked = false; }
    else { allchecked = true; }
  for (var i=0;i<theForm.elements.length;i++)
  {
    var e = theForm.elements[i];
      e.checked = allchecked;
  }

}

function setSc(v)
{
	if (v) document.body.scrollTop=v;
}
function writeSc(frm)
{
	obj=eval("document.forms."+frm);
	if (obj) obj.scroll_value.value=document.body.scrollTop;
}

function addImg(url) {
	if (document.images) {
		sendback = new Image();
		sendback.src = url;
		return sendback;
	}
}
if (document.images) {
	for (i=1; i<=9; i++){
		eval("m"+i+"on = addImg(\"/_i/menu"+i+"_o.gif\");");
		eval("m"+i+"off = addImg(\"/_i/menu"+i+".gif\");");
	mbg = addImg("/_i/link_bg.gif");
	mbgOn = addImg("/_i/link_bg_o.gif");
	mbgS = addImg("/_i/link_bg_s.gif");
	}
}
function swapImg(imgname,chwhere) {
	if (document.images) {
//document.body.style.backgroundImage
			eval("document.images."+imgname+".src = "+imgname+chwhere+".src;");
	}
}

function swpBg(obj,chwhere) {
//	eval("obj.style.backgroundImage = 'url("+eval("mbg"+chwhere+".src")+")';");
}


function SetCookie (name, value) {
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (argc > 2) ? argv[2] : null;
	var path = "/";
	var domain = (argc > 4) ? argv[4] : null;
	var secure = (argc > 5) ? argv[5] : false;
	document.cookie = name + "=" + escape (value) +
					((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
					((path == null) ? "" : ("; path=" + path)) +
					((domain == null) ? "" : ("; domain=" + domain)) +
					((secure == true) ? "; secure" : "");
}


function DeleteCookie (name) {
	var exp = new Date();
	exp.setTime (exp.getTime() - 1);
	var cval = GetCookie (name);
	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

function getCookieValue (offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
		endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
			return getCookieValue (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
	}
	return null;
}

function original() {

	fontSizeval = eSize;
	//alert (fontSizeval);
    if (document.getElementById("article_lead") != null) {
        var fontSize=parseInt(document.getElementById("article_lead").style.fontSize,10)+fontSizeval;

        document.getElementById("article_lead").style.fontSize = fontSize+"px";
    }

    if (document.getElementById("article_content") != null) {
        var fontSize=parseInt(document.getElementById("article_content").style.fontSize,10)+fontSizeval;
        document.getElementById("article_content").style.fontSize = fontSize+"px";
    }

    if (document.getElementById("article_title") != null) {
        var fontSize=parseInt(document.getElementById("article_title").style.fontSize,10)+fontSizeval;
        document.getElementById("article_title").style.fontSize = fontSize+"px";
    }
    if (document.getElementById("article_footer") != null) {
        var fontSize=parseInt(document.getElementById("article_footer").style.fontSize,10)+fontSizeval;
        document.getElementById("article_footer").style.fontSize = fontSize+"px";
    }

	if (fontSizeval > 0) {
		ms.innerHTML = "<a class=\"p12\" href=\"javascript:decsize()\">kisebb</a>";
	}
	else {
		ms.innerHTML = "kisebb";
	}

	if (fontSizeval < 6) {
		mb.innerHTML = "<a class=\"p12\" href=\"javascript:incsize()\">nagyobb</a>";
	}
	else {
		mb.innerHTML = "nagyobb";
	}

	DeleteCookie('instsprtl_FontSizeDiff', exp);
	SetCookie('instsprtl_FontSizeDiff', fontSizeval, exp);

}


function incsize() {
    fontSizeval = fontSizeval + 2;
    if (document.getElementById("article_lead") != null) {
        var fontSize=parseInt(document.getElementById("article_lead").style.fontSize,10)+2;
        document.getElementById("article_lead").style.fontSize = fontSize+"px";
    }

    if (document.getElementById("article_content") != null) {
        var fontSize=parseInt(document.getElementById("article_content").style.fontSize,10)+2;
        document.getElementById("article_content").style.fontSize = fontSize+"px";
    }

    if (document.getElementById("article_title") != null) {
        var fontSize=parseInt(document.getElementById("article_title").style.fontSize,10)+2;
        document.getElementById("article_title").style.fontSize = fontSize+"px";
    }
    if (document.getElementById("article_subtitle") != null) {
        var fontSize=parseInt(document.getElementById("article_subtitle").style.fontSize,10)+2;
        document.getElementById("article_subtitle").style.fontSize = fontSize+"px";
    }

    if (fontSizeval > 0) {
        ms.innerHTML = "<a class=\"p12\" href=\"javascript:decsize()\">kisebb</a>";
    }
    else {
        ms.innerHTML = "kisebb";
    }

    if (fontSizeval < 6) {
        mb.innerHTML = "<a class=\"p12\" href=\"javascript:incsize()\">nagyobb</a>";
    }
    else {
        mb.innerHTML = "nagyobb";
    }

    DeleteCookie('instsprtl_FontSizeDiff', exp);
    SetCookie('instsprtl_FontSizeDiff', fontSizeval, exp);

}

function decsize() {

	//fontSizeval = document.getElementById("article_content").style.fontSize;
    fontSizeval = fontSizeval - 2;
    if (document.getElementById("article_lead") != null) {
        var fontSize=parseInt(document.getElementById("article_lead").style.fontSize,10)-2;

        document.getElementById("article_lead").style.fontSize = fontSize+"px";
    }

    if (document.getElementById("article_content") != null) {
        var fontSize=parseInt(document.getElementById("article_content").style.fontSize,10)-2;
        document.getElementById("article_content").style.fontSize = fontSize+"px";
    }

    if (document.getElementById("article_title") != null) {
        var fontSize=parseInt(document.getElementById("article_title").style.fontSize,10)-2;
        document.getElementById("article_title").style.fontSize = fontSize+"px";
    }
    if (document.getElementById("article_subtitle") != null) {
        var fontSize=parseInt(document.getElementById("article_subtitle").style.fontSize,10)-2;
        document.getElementById("article_subtitle").style.fontSize = fontSize+"px";
    }

	if (fontSizeval > 0) {
		ms.innerHTML = "<a href=\"javascript:decsize()\">kisebb</a>";
	}
	else {
		ms.innerHTML = "kisebb";
	}

	if (fontSizeval < 6) {
		mb.innerHTML = "<a href=\"javascript:incsize()\">nagyobb</a>";
	}
	else {
		mb.innerHTML = "nagyobb";
	}

	DeleteCookie('instsprtl_FontSizeDiff', exp);
	SetCookie('instsprtl_FontSizeDiff', fontSizeval, exp);

}


