var config="";
window.onload=function()
{
	for(i=0;i<document.getElementsByTagName('IFRAME').length;i++)
	{
		var name ="myFrame0"+i;
		
		document.getElementsByTagName('IFRAME')[i].style.height=document.frames[name].document.body.scrollHeight;

	}

}

function formCheck()
{
	for(i=0;i<document.getElementsByTagName('SELECT').length;i++){
		if(document.getElementsByTagName('SELECT')[i].value == "")
		{
			popup_show('popup', 'popup_exit_01', 'screen-center',0,0,1);
			return false;
		}
	}
	
	
	if(document.basket.amount.value=="" || isNaN(document.basket.amount.value)) 
	{
		popup_show('popup', 'popup_exit_01', 'screen-center',0,0,2);
	}
	
	else
	{
		submit();
	}

}

function post_to_url(objname, params, config) 
{
	
	
	for (var i in params) 
	{
		
		var input = document.createElement('input');
		input.type = 'hidden';
		input.name = i;
		input.value = params[i];
		document.forms[objname].appendChild(input);

	}
	if(config == 1)
	{
	
		document.forms[objname].submit();
	
	}
	else if(config == 2)
	{
		if(confirm("Vil du slette denne post?"))
		{
			document.forms[objname].submit();
		}
		else
		{
			return false;
		}
	}
	else
	{
		return false;
	}
}

//-----------------------------------------------------------------------//
function OpenSubscribeWindow(iWidth,iHeight){
    var iLeftPos = Math.round((screen.width-iWidth)/2);
    var iTopPos = Math.round((screen.height-iHeight)/2);
	NEW = window.open('http://www.newsmailservice.com/customized/subscription_from_okgruppen.asp', 'Subscribe', 'width='+iWidth+', height='+iHeight+', top='+iTopPos+',left='+iLeftPos+', toolbar=no,scrollbars=yes,resizable');
	if (NEW.opener == null) NEW.opener = self;
	NEW.focus();
	}

//-----------------------------------------------------------------------//

