// JScript File
function popUpBuilder(_tittle,_strHtml)
{
    // Hvordan sender man en properties collection
    // med i stædet for denne røvfuld parameter.
    
    this.width = "300";   			//300 - Use this to define the width of the new window. 
    this.height = "300"; 			//200  - Use this to define the height of the new window. 
    this.resizable = "no"; 			//yes or no - Use this to control whether or not you want the user to be able to resize the window. 
    this.scrollbars = "no";			//yes or no - This lets you decide whether or not to have scrollbars on the window. 
    this.toolbar = "no";			//yes or no - Whether or not the new window should have the browser navigation bar at the top (The back, foward, stop buttons..etc.). 
    this.location = "no";			//yes or no - Whether or not you wish to show the location box with the current url (The place to type http://address). 
    this.directories = "no";		//yes or no - Whether or not the window should show the extra buttons. (what's cool, personal buttons, etc...). 
    this.status = "no"; 			//yes or no - Whether or not to show the window status bar at the bottom of the window. 
    this.menubar = "no";			//yes or no - Whether or not to show the menus at the top of the window (File, Edit, etc...). 
    this.copyhistory = "no"; 		// yes or no
    
    this.userUrl = false;			//Skal der bruges en url.
    this.url = "";					//Url til den fil der skal åbnes.
    this.tittle = _tittle;
    this.strHtml = _strHtml;
    
   //Methods
   this.Build = openNewWindow;
   this.Test = checkValues;
}
function openNewWindow()
  {
  
      if (this.userUrl == true)
    {
	//Åben en eksisterende side i popUp.
	OpenWindow=window.open(this.url, "newwin", "width="+ this.width +", height="+ this.height +", resizable="+ this.resizable +", scrollbars="+ this.scrollbars +", toolbar="+ this.toolbar +", location="+ this.location +", directories="+ this.directories +", status="+ this.status +", menubar="+ this.menubar +", copyhistory="+ this.copyhistory +"");
    }
    else
    {
	//Genererer en htmlSide.
	OpenWindow=window.open("", "newwin", "width="+ this.width +", height="+ this.height +", resizable="+ this.resizable +", scrollbars="+ this.scrollbars +", toolbar="+ this.toolbar +", location="+ this.location +", directories="+ this.directories +", status="+ this.status +", menubar="+ this.menubar +", copyhistory="+ this.copyhistory +"");
	OpenWindow.document.write("<head><title>"+this.tittle+"</title>")
	OpenWindow.document.write("<link href='layOutStyle.css' rel='stylesheet' type='text/css' /></head")
	OpenWindow.document.write("<body>")
	OpenWindow.document.write(this.strHtml)
	OpenWindow.document.write("</body>")
	OpenWindow.document.write("</html>")
    }
    OpenWindow.document.close()
    self.name="main"
 }
 
 function checkValues()
 {
	var strValues = ""
	strValues += " -----------------------\n"
	strValues += " Default Settings:\n"
	strValues += " -----------------------\n"
	strValues += " - userUrl : " + this.userUrl + "\n"
	strValues += " - Url : " + this.url + "\n"
	strValues += " - tittle : " + this.tittle + "\n"
	strValues += " - strHtml : " + this.url + "\n"
	strValues += " - width : " + this.width + "\n"
	strValues += " - height : " + this.height +"\n"
	strValues += " - resizable : " + this.resizable +"\n"
	strValues += " - scrollbars : " + this.scrollbars + "\n"
	strValues += " - toolbar : " + this.toolbar + "\n"
	strValues += " - location : " + this.location +"\n"
	strValues += " - directories : " + this.directories + "\n"
	strValues += " - status : " + this.status + "\n"
	strValues += " - menubar : " + this.menubar +"\n"
	strValues += " - copyhistory : " + this.copyhistory + "\n"
	alert(strValues)
 }      
