﻿// This function returns the appropriate reference,
// depending on the browser.
function getFlexApp(appName) {
	if (navigator.appName.indexOf ("Microsoft") !=-1) {
		return window[appName];
	} else {
		return document[appName];
	}
}

function query(ji) {
	hu = window.location.search.substring(1);
	gy = hu.split("&");
	for (i=0;i<gy.length;i++) 
	{
		ft = gy[i].split("=");
		if (ft[0] == ji) {
			return ft[1];
		}
	}
}

function callApp(){
	getFlexApp('diplom').food( query("n"), query("c"), query("t"), query("h") );
}

function debug(e){
	alert(e)
}

/* Skriver til popup'en ik'å */
function popupWithText( text ) 
{
	newwindow2=window.open('?id=lol','name','height=800,width=600');
	var tmp = newwindow2.document;
	tmp.write( text );
	tmp.close();
	
	
	
}
		
function popup( url, height, width ) 
{
	newwindow2=window.open( url ,'name','height='+height+',width='+width+',scrollbars=1,resizable=1');
}
