function openwin(url, width, height,tit)
{
win1 = open("", "_blank", "toolbar=0,status=0,location=0,menubar=0,directories=0,scrollbars=0,resizeable=0,width="+width+",height="+height);
win1.document.open();
win1.document.write("<html><head><title>"+tit+"</title></head><body bgcolor=#ffffff leftmargin=0 topmargin=0 marginwidth=0 marginheight=0><img src="+url+" border=0></body></html>");
win1.document.close();
}

function suggestion_openwindow(url)
{

link = window.open(url,"Link","toolbar=0,location=no,directories=0,status=0,menubar=0,scrollbars=yes,resizable=1,width=758,height=700");
link.focus()
}

function openwindow(url, width, height)
{

newWindow = window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width="+width+",height="+height);
newWindow.opener = self;
newWindow.focus()
}


function user_guide_window(url, width, height)
{

link = window.open(url,"Guide","toolbar=0,location=0,directories=0,fullscreen=1,status=0,menubar=0,scrollbars=auto,resizable=1,width="+width+",height="+height);
link.focus()
}

function open_bundle_win(url)
{
link = window.open(url,"BundleLink","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=auto,resizable=1,width=520,height=230, left=120,top=190");
link.focus()
}

function open_bundle_specwin(url, width, height)
{
link = window.open(url,"BundleLink","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=auto,resizable=1,width="+width+",height="+height+", left=120,top=190");
link.focus()
}

function download_select(url, width, height)
{
link = window.open(url,"BundleLink","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width="+width+",height="+height+", left=120,top=190");
link.focus()
}
function Compatib(url) {
link = window.open(url,"CompatibLink","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=auto,resizable=1,width=400,height=400,left=100,top=80");
link.focus()
}


var popwin = null;
function SendLink(page)
{
	var left, top, winWidth, winHeight;
	var wConfig, url;
	winWidth = 400;
	winHeight = 500;
	url = "/js/"+page;
	wConfig="status=0,resizable=1,location=0,scrollbars=auto,toolbar=0,width="+winWidth+",height="+winHeight+",top=0,left=50";
	
	if ((popwin == null) || (popwin.closed)){
		popwin=window.open(url, "popwin", wConfig);
	}
	else {
		popwin.focus();
		popwin.location.href=url;
	}
	return false;
}


var win=null;
function SpxPromo(mypage,myname,w,h,pos,infocus){
//if(GetCookie("sid") == "999"){return;}
//document.cookie="sid=999; Path=/; Expires= " + getFuture(1);
if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
else if (pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
else if (pos=="custom"){myleft=(screen.width)?(screen.width-w)-23:100;mytop=20;}
else if((pos!='center' && pos!="random" && pos !="custom") || pos==null){myleft=(screen.width)?(screen.width-w)-23:100;mytop=(screen.height)?(screen.height-h)-80:100;}
settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=auto,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";win=window.open(mypage,myname,settings);
if(win != null) win.focus();}

function getFuture(f){
var d = new Date();
d.setTime(d.getTime() + (86400000 * f));
return d;
}

function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
  var j = i + alen;
  if (document.cookie.substring(i, j) == arg)
  return getCookieVal (j);
  i = document.cookie.indexOf(" ", i) + 1;
  if (i == 0) break; 
  }
  return null;
  }

function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
  endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}



function product_win(url)
{
link = window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=400,height=400,left=100,top=80");
link.focus()
}


function text() {
};

text = new text();
number = 0;

// textArray
text[number++] = "http://www.medicalspellchecker.com/home.htm"
text[number++] = "http://www.medispell.com/home.htm"
text[number++] = "http://www.spelling-software.com/home.htm"
text[number++] = "http://spellex.co.uk/home.htm"

increment = Math.floor(Math.random() * number);

//document.write(text[increment]);
 
var win=null;
function Link()
{
w = 485;
h = 115;
myname = link;
myleft=(screen.width)?(screen.width-w)-23:100;
mytop=20;

settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";
win=window.open(text[increment],myname,settings);
win.focus();
}



//Start of Tooltips
var ie = document.all ? 1 : 0
var ns = document.layers ? 1 : 0

if(ns)
{
 doc = "document."; sty = ""
}

if(ie)
{
 doc = "document.all."; sty = ".style"
}

var initialize = 0
var Ex, Ey, topColor, subColor, ContentInfo

if(ie)
{
	Ex = "event.x"
	Ey = "event.y"
	topColor = "#808080"
	subColor = "#DDDDDD"
}

if(ns)
{
	Ex = "e.pageX"
	Ey = "e.pageY"
	window.captureEvents(Event.MOUSEMOVE)
	window.onmousemove=overhere
	topColor = "#808080"
	subColor = "#DDDDDD"
}

function MoveToolTip(layerName, FromTop, FromLeft, e)
{
	if(ie)
	{
		eval(doc + layerName + sty + ".top = "  + (eval(FromTop) + document.body.scrollTop))
	}
	
	if(ns)
	{
		eval(doc + layerName + sty + ".top = "  +  eval(FromTop))
	}
	eval(doc + layerName + sty + ".left = " + (eval(FromLeft) + 15))
}

function ReplaceContent(layerName)
{
	if(ie)
	{
		document.all[layerName].innerHTML = ContentInfo
	}

	if(ns)
	{
		with(document.layers[layerName].document) 
		{ 
		   open(); 
		   write(ContentInfo); 
		   close(); 
		}
	}
}

function Activate(){initialize=1}
function deActivate(){initialize=0}

function overhere(e)
{
	if(initialize)
	{
		MoveToolTip("ToolTip", Ey, Ex, e)
		eval(doc + "ToolTip" + sty + ".visibility = 'visible'")
	}
	else
	{
		MoveToolTip("ToolTip", 0, 0)
		eval(doc + "ToolTip" + sty + ".visibility = 'hidden'")
	}
}

function EnterContent(layerName, TTitle, TContent)
{
ContentInfo = '<table border="0" width="150" cellspacing="0" cellpadding="0">'+
'<tr><td width="100%" bgcolor="#000000">'+
'<table border="0" width="100%" cellspacing="1" cellpadding="0">'+
'<tr><td width="100%" bgcolor='+topColor+'>'+
'<table border="0" width="90%" cellspacing="0" cellpadding="0" align="center">'+
'<tr><td width="100%">'+
'<font class="tooltiptitle">&nbsp;'+TTitle+'</font>'+
'</td></tr>'+
'</table>'+
'</td></tr>'+
'<tr><td width="100%" bgcolor='+subColor+'>'+
'<table border="0" width="90%" cellpadding="0" cellspacing="1" align="center">'+
'<tr><td width="100%">'+
'<font class="tooltipcontent">'+TContent+'</font>'+
'</td></tr>'+
'</table>'+
'</td></tr>'+
'</table>'+
'</td></tr>'+
'</table>';

ReplaceContent(layerName)
}
// end of tooltips


// Start of scroller
var scrollerPos = screen.height * -1.5;
var scrollLimit;

function startScrolling(layerID)
{
	document.getElementById('AFrame').style.top=+scrollerPos;
	scrollerPos+=15;
	timer=setTimeout("startScrolling('"+layerID+"')",5);
	if (scrollerPos >= scrollLimit)
	{
		clearTimeout(timer);
	}
}

function closeScroller(layerID)
{
	scrollLayer = document.getElementById(layerID)
	scrollLayer.innerHTML = "";
	scrollLayer.style.visibility = "hidden";
}

function scrollOn(layerID, imgFileName, vertLimit)
{
	//set the default for the vertical limit if not specified in parameters
	if (vertLimit == null) vertLimit = 130;
	
	scrollLayer = document.getElementById(layerID);

	//Set the content of the scroller
	var scrollerContent
	scrollerContent = '<table width="100%"><tr><td align="center">';
	scrollerContent += '<table cellpadding="0" cellspacing="0" border="0">\n';
	scrollerContent +='	<tr>\n';
	scrollerContent +='		<td colspan="2"><img id="scrollImg" src=\"'+imgFileName+'\" border="0"></td>\n';
	scrollerContent +='	</tr>\n';
	scrollerContent +='	<tr>\n';
	scrollerContent +='		<td align="right"><a onClick=\"closeScroller(\''+layerID+'\')\" href="javascript:closeScroller(\''+layerID+'\')"><img src=\"/images/DHTML/closeButton.gif\" border="0"></a></td>\n'
	scrollerContent +='	</tr>\n';
	scrollerContent +='</table>';
	scrollerContent +='</td></tr></table>';
	scrollLayer.innerHTML = scrollerContent;
	
	//Move the scroller to the starting position and make visible
	scrollLayer.style.top = 5;
	scrollLimit = vertLimit;
	scrollLayer.style.left = 0; //((screen.width-739)/2) + 7
	scrollLayer.style.visibility = "visible";
	startScrolling(layerID);
}
//end of scroller


// Start of Chat Visitor monitoring code
window.onload = function(){
	var ciGqR2=document.createElement("div");
	ciGqR2.id = "ciGqR2";
	//ciGqR2.style = "z-index:100;position:absolute";
	ciGqR2.style.zIndex = "100";
	ciGqR2.style.position= "absolute";
	document.body.insertBefore(ciGqR2, document.body.firstChild);
	
	var sdGqR2=document.createElement("div");
	sdGqR2.id = "sdGqR2";
	//sdGqR2.style = "display:none";
	sdGqR2.style.display = "none";
	document.body.insertBefore(sdGqR2, document.body.firstChild);

	var seGqR2=document.createElement("script");
	seGqR2.type="text/javascript";
	seGqR2.defer=true;
	seGqR2.src=(location.protocol.indexOf("https")==0?"https://secure.providesupport.com/image":"http://image.providesupport.com")+"/js/spellex/safe-monitor.js?ps_h=GqR2\u0026ps_t="+new Date().getTime();
	document.getElementById("sdGqR2").appendChild(seGqR2);
}
// End of Chat Visitor monitoring code



function JSInclude (filepath){
	document.write('<script language="JavaScript" type="text/javascript" src="' + filepath + '"></script>');
}
function JSIncludeExternal (siteFilePath){
	pageurl = document.location.href;
	protocolIndex = pageurl.indexOf('://')
	if (protocolIndex != -1)
	{
		pageprotocol = pageurl.substring(0,protocolIndex + 3);
	}
	else
	{
		pageprotocol = "http://";
	}
	JSInclude(pageprotocol + siteFilePath);
}
