var strPageName

function relocateMe(strPageName) {
	self.location = strPageName;
}

function relocateMeWithConfirm(strPageName,strQuestion) {
	var x = window.confirm(strQuestion)
	
	if (x) 
		self.location = strPageName;
}

function myOpenWindow() {
    window.open('blank.asp','myWindowName','width=300,height=200');
}

function showpic(strUrl,intWindowWidth,intWindowHeight){
	var strOptions = 'toolbar=0,location=0,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=' + intWindowWidth + ',height=' + intWindowHeight;
	PicWin = window.open(strUrl,'Myndir',strOptions);
}
	
function closePopup() {
    window.close();
    return true;
}

function openPopupWin(strURL,strWindowName) {
window.open(strURL,strWindowName,'height=400,width=400,resizable=no,location=no,menubar=no,scrollbars=yes,status=no,titlebar=yes');
}

function openSenda() {
window.open('http://www.skirnir.is/senda/senda.asp?strURL=' + escape(document.URL),'Send','height=400,width=400,resizable=no,location=no,menubar=no,scrollbars=no,status=no,titlebar=yes');
}


window.onerror = null;

var winp=null;var win=null;
var isHTMLMode=false
var colour;

function cmdExec(cmd,opt)
	{
  	if (isHTMLMode){alert("xxx");return;}
	frmPublication.focus();
  	frmPublication.document.execCommand(cmd,"",opt);
	frmPublication.focus();
	}
function setMode(bMode)
	{
	var sTmp;
  	isHTMLMode = bMode;
  	if (isHTMLMode)
	{
		sTmp=frmPublication.innerHTML;
		frmPublication.innerText=sTmp;
	}
	else
	{
			sTmp=frmPublication.innerText;
			frmPublication.innerHTML=sTmp;
	}
  	frmPublication.focus();
	}

function foreColor()

       {

       var arr = showModalDialog("files/selcolor.htm","","font-family:Verdana; font-size:12; dialogWidth:30em; dialogHeight:34em: status=no" );

       if (arr != null) cmdExec("ForeColor",arr);

       }
       
 function help()
 
        {
 
        var arr = showModalDialog("files/hjalp.htm","","font-family:Verdana; font-size:12; dialogWidth:60em; dialogHeight:50em: status=no" );
 
        if (arr != null) cmdExec("help",arr);
 
        }
        
  function files()
  
    	{
    window.open('http://www.skirnir.is/files/uploadTester.asp?strURL=' + escape(document.URL),'Send','height=550,width=450,resizable=no,location=no,menubar=no,scrollbars=no,status=no,titlebar=yes');
    	}
    	
   function viewfiles()
   
     	{
     window.open('http://www.skirnir.is/files/dirlisttile.asp?strURL=' + escape(document.URL),'Send','height=500,width=600,resizable=yes,location=no,menubar=no,scrollbars=yes,status=no,titlebar=yes');
     	}

   function deletefiles()
   
     	{
     window.open('http://www.skirnir.is/files/deletefiles.asp?strURL=' + escape(document.URL),'Send','height=300,width=400,resizable=no,location=no,menubar=no,scrollbars=no,status=no,titlebar=yes');
     	}  
    	
    	
  function insertSmileys()
   	{
	var cursor = editableStrPublMaintext.document.selection.createRange();
	var myTitle = "";
   	var myText  = showModalDialog("files/smiley_select.asp",
    	myTitle, "target is new Window: status=no");
	if (myText) { cursor.pasteHTML(unescape( myText) ); }
 
	}
	
function insertChar()
	{
	
	var cursor = editableStrPublMaintext.document.selection.createRange();
	var myText = showModalDialog("files/insert_char.html", '', "dialogWidth:500px; dialogHeight: 155px; resizable: no; help: no; status: no; scroll: no;");
	if (myText) { cursor.pasteHTML(unescape( myText) ); }
  }
                  
  function insertImage()
  
     
        {
        var cursor = editableStrPublMaintext.document.selection.createRange();
	var myText = showModalDialog("files/insert_image.html", '', "dialogWidth:500px; dialogHeight: 655px; resizable: no; help: no; status: no; scroll: no;");
	if (myText) { cursor.pasteHTML(unescape( myText) ); }
     
          }

  function about()
  
         {
  
         var arr = showModalDialog("files/about.htm","","font-family:Verdana; font-size:12; dialogWidth:35em; dialogHeight:20em; status=no" );
  
         if (arr != null) cmdExec("about",arr);
  
         }
         

function createlink() 

	{
	var cursor = editableStrPublMaintext.document.selection.createRange();
	var myTitle = "";
	var myText = showModalDialog("files/tenglar.asp",
	myTitle, "target is new Window: status=no");
	if (myText) { cursor.pasteHTML(unescape( myText) ); }
	
 }

function tableDialog()
{
//----- Creates A Table Dialog And Passes Values To createTable() -----
var rtNumRows = null;
var rtNumCols = null;
var rtTblAlign = null;
var rtTblWidth = null;
var rtBorder = null;
var rtPadding = null;
var rtSpacing = null;
var rtTblID = null;
var rtTblPixel = null;
showModalDialog("files/tafla.htm",window,"status:false;dialogWidth:20em;dialogHeight:17em");
}
function createTable()
{
editableStrPublMaintext.focus();
//----- Creates User Defined Tables -----
var cursor = editableStrPublMaintext.document.selection.createRange(); // This places the table where your
// cursor was last positioned
if (rtNumRows == "" || rtNumRows == "0")
{
rtNumRows = "1";
}
if (rtNumCols == "" || rtNumCols == "0")
{
rtNumCols = "1";
}
var rttrnum=1
var rttdnum=1
var rtNewTable = "<table"
if(rtBorder != ""){
rtNewTable += " border='"+ rtBorder +"'"
}

if(rtTblAlign != ""){
rtNewTable += " align='" + rtTblAlign + "'"
}
if(rtPadding != ""){
rtNewTable += " cellpadding=" + rtPadding
}

if(rtSpacing != ""){
rtNewTable += " cellspacing=" + rtSpacing
}

if(rtTblID != ""){
rtNewTable += " ID=" + rtTblID + " name=" + rtTblID
}

rtNewTable += " width='" + rtTblWidth + rtTblPixel + "'>"
while (rttrnum <= rtNumRows)
{
rttrnum=rttrnum+1
rtNewTable = rtNewTable + "<tr>"
while (rttdnum <= rtNumCols)
{
rtNewTable = rtNewTable + "<td>&nbsp;</td>"
rttdnum=rttdnum+1
}
rttdnum=1
rtNewTable = rtNewTable + "</tr>"
}
rtNewTable = rtNewTable + "</table>"
cursor.pasteHTML(rtNewTable);
editableStrPublMaintext.focus();
}


