var ServerPath = "www.supsew.com";
//var ServerPath = "websrv2.supsew.com";

var newWin;

	
var b_url="http://www.superiorsew.com";
var b_title="[ Superior Sew - Sewing Machine and Supply LLC ]";
var b_text="Bookmark";
var b_nn="To bookmark:\n1.) Press Ctrl+D\nor\n1.) Go to Communicator >\n2.) Go to Bookmarks >\n3.) Add Bookmark.";
var b_nn6="To bookmark:\n1.) Press Ctrl+D\nor\n1.) Go to Bookmarks >\n2.) Add Bookmark.";
var b_op="To bookmark:\n1.) Press Ctrl+T\nor\n1.) Go to Bookmarks >\n2.) Add current document here...\n3.) Fill out form.";
var b_other="Unable to bookmark";
var xOmnisWin;
var xLoginStr;

//alert("Hello from plugin.js - xLoginStr = "+xLoginStr);

function bookmark() {
    if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)){
        window.external.addfavorite(b_url,b_title); 
    }else if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) <= 4)){
		alert(b_nn); 
    }else if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 5)){
		alert(b_nn6); 
    }else if (navigator.appName == "Opera"){
		alert(b_op); 
    }else{
		alert(b_other); 
    }
}
 

   function fSayHello() {
   alert("Hello from the plugin ...");
   }

  function f0(a) {return 'hdnProfileID='+a; }
  function f3(a,b,c) {return a+'|'+b+'|'+c; } // SID=<value>
  function f3_2(a,b,c) {return a+'|SID='+b+'|'+c; }  
  function f9(a,b) {return "  \<param name=\""+a+"\" value=\""+b+"\"\>"; }
  
  navigator.plugins.refresh(false);    
    
  function fx(x) { 
	var numPlugins, foundPlugin, plugin, browserTYPE;
	
	//alert("navigator.appName: "+navigator.appName+", navigator.appVersion: "+navigator.appVersion);
	if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4))
		{
			//foundPlugin = detectOmnis("downLoadPluginIE.html");
			//alert("foundPlugin IE :"+foundPlugin);		
		}
	else if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4))
		{
			//foundPlugin = detectOmnis("downLoadPluginNS.html");
			//alert("foundPlugin NS :"+foundPlugin);					
		}
	
	xLoginStr = f0(x);


if(xOmnisWin && typeof(xOmnisWin.closed)!='unknown' && !xOmnisWin.closed) 
{	
	xOmnisWin.focus();
} else {
	xOmnisWin = window.open("/universe/mainmenu.aspx","SupSewPlugIn","width=800,height=600, resizable=yes, scrollbars=yes");
}

//if (window.showModalDialog) {
//	window.showModalDialog("/universe/mainmenu.aspx","SupSewPlugIn","dialogWidth:800px;dialogHeight:600px");
//} else {
//	window.open('/universe/mainmenu.aspx','SupSewPlugIn','height=600,width=800,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes');
//}	
	
	
}

function writeObjectContent(xLoginStrParam) {
	xOmnisWin = window.open("/universe/mainmenu.aspx","SupSewPlugIn","width=740,height=430");
}

function OLDwriteObjectContent(xLoginStrParam){

	xOmnisWin = window.open("","SupSewPlugIn","width=740,height=430");
	xOmnisWin.document.open();
  xOmnisWin.document.writeln("<html>");	
  xOmnisWin.document.writeln("<"+"script language=\"javascript\">");
  xOmnisWin.document.writeln("var hrefArray = new Array\(6\);")
	xOmnisWin.document.writeln("hrefArray[0] = 'http://webdev.supsew.com/';")
  xOmnisWin.document.writeln("hrefArray[1] = 'http://webdev.supsew.com/index.asp';")
  xOmnisWin.document.writeln("hrefArray[2] = 'http://webdev.supsew.com/login.asp';")
  xOmnisWin.document.writeln("hrefArray[3] = 'http://webdev.supsew.com/esp/';")
  xOmnisWin.document.writeln("hrefArray[4] = 'http://webdev.supsew.com/esp/index.asp';")
  xOmnisWin.document.writeln("hrefArray[5] = 'http://webdev.supsew.com/esp/login.asp';")
  	
	xOmnisWin.document.writeln("function inHrefArray\(str\) \{");
  	xOmnisWin.document.writeln("for\(i=0;i<hrefArray.length;i++\) { if\(hrefArray[i] == str\) return true\; \}");
  	xOmnisWin.document.writeln("return false\;");
  xOmnisWin.document.writeln("\}");										
  	
//	xOmnisWin.document.writeln("function refreshLogin\(\) \{");
//	xOmnisWin.document.writeln("alert\(\"In...\");");	
//	xOmnisWin.document.writeln("if(!window.parent.opener.closed && window.parent.opener != null)\{");
////	xOmnisWin.document.writeln("alert\(window.parent.opener.reloadMain()\)\;");
//	xOmnisWin.document.writeln("if(window.parent.opener.ParentExists != undefined)\{");
//	xOmnisWin.document.writeln("var winParent = this.opener\;");
//	xOmnisWin.document.writeln("winParent.reloadMain();\}\;");
//	xOmnisWin.document.writeln("\}");
//	xOmnisWin.document.writeln("\}");	 
	
//	xOmnisWin.document.writeln("window.onunload = function closeWindow\(\) \{");	
//	xOmnisWin.document.writeln("alert\(\"Unloading...\");");
//	xOmnisWin.document.writeln("window.open\(\"OmnisLogout.asp\",\"SupSewLogOut\",\"width=740,height=430\"\);");
//	xOmnisWin.document.writeln("if(!window.parent.opener.closed && window.parent.opener != null)\{");
//	xOmnisWin.document.writeln("this.opener.reloadMain();\}\;");
//	xOmnisWin.document.writeln("\}");
		 
//  	xOmnisWin.document.writeln("function fSayHello\(\) \{");
// 	xOmnisWin.document.writeln("alert\(\"This window was opened by \" + window.opener.location.href\)\;");
//  	xOmnisWin.document.writeln("\}");
  	
//	xOmnisWin.document.writeln("function fWipeLogin\(\) \{");
//  	xOmnisWin.document.writeln("alert\(\"We need to write a cookie or something here ...\"\)\;");
//  	xOmnisWin.document.writeln("\}");
	

	xOmnisWin.document.writeln("<\/script>");
    
	if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)){
  		xOmnisWin.document.writeln("<!-- Use for Microsoft -->");
  		xOmnisWin.document.writeln("<!-- ActiveX object START -->");
  		xOmnisWin.document.writeln("<object classid=\"clsid:13510606-30FA-11D2-B383-444553540000\" width=\"721\" height=\"401\">");
  		xOmnisWin.document.writeln(f9("_Version","65536"));
  		xOmnisWin.document.writeln(f9("_ExtentX","7161"));
  		xOmnisWin.document.writeln(f9("_ExtentY","7373"));
  		xOmnisWin.document.writeln(f9("_StockProps","0"));
  		xOmnisWin.document.writeln(f9("OmnisServer","5912"));
  		xOmnisWin.document.writeln(f9("OmnisLibrary","SUPERIOR"));
  		xOmnisWin.document.writeln(f9("OmnisClass","rfEntrance"));
  		xOmnisWin.document.writeln(f9("WebServerURL",ServerPath));
  		xOmnisWin.document.writeln(f9("WebServerScript","scripts/omnisapi.dll"));
  		xOmnisWin.document.writeln(f9("param1",xLoginStrParam));
  		xOmnisWin.document.writeln("</object>");
  		xOmnisWin.document.writeln("<!-- ActiveX object END-->");		
    }else if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4)){
  		xOmnisWin.document.write("<!-- Use for Netscape-->");
  		xOmnisWin.document.write("<!-- Plugin START -->");
	 	  xOmnisWin.document.write('<embed pluginurl="http://www.omnis-software.com/downloads/webeval.html" type="application\/OMNIS-RCC-plugin" name="rcc1" width="721" height="401" OmnisServer="5912" OmnisLibrary="SUPERIOR" OmnisClass="rfEntrance" WebServerUrl="'+ServerPath+'" WebServerScript="\/scripts\/nph-omniscgi.exe" param1='+xLoginStr+'>');
  		xOmnisWin.document.write("<!-- Plugin END-->");		
    }else{
		alert("We are lost !");
	}
 	
	xOmnisWin.document.write("<\/body>");
 	xOmnisWin.document.write("<\/html>");
	xOmnisWin.document.close();
}

