
// function that webstyle uses to pick up notifications
function XAR_MESSAGE(){}

function turn(imageName, newImage){
	if (document.images != null)
		document[imageName].src = newImage;
}
function submitform(formName, elName){
	var tform;
	setCurs();
	tform = document.forms[formName];
	tform[elName].value = '42';
	tform.submit();
}
function setCurs2()
{
	if (document.all)
	{
		document.body.style.cursor='wait';
		for (var obj in document.body.all)
		{
			if (document.body.all[obj] && typeof(document.body.all[obj].style)=='object')
			{
				document.body.all[obj].style.cursor='wait';
			}
		}
	}
}

function setCurs3()
{
	document.body.innerHTML = "<br><br><br><br><br><br><br><br><br><br><center><font face='Arial,Helvetica, Sans-serif' size='2'>Page loading...</font></center>";
    document.body.style.cursor='wait';
}

function setCurs()
{
	if (document.all)
	{
		if (document.all.length < 1000)
		{
			setCurs2()
		}
		else
		{
			setTimeout("setCurs3()", 1)
		}
	}
}

function back_button(ImgBase)
{
	if ((window.history.length>0 && document.all) || (document.layers && window.history.length>1))
	{		
		document.write("<A HREF=\"javascript:top.window.history.back();\" ONMOUSEOUT=\"turn('back','"+ImgBase+"preview_back.gif')\" ONMOUSEOVER=\"turn('back','"+ImgBase+"preview_backmouse.gif')\"><IMG SRC=\""+ImgBase+"preview_back.gif\" WIDTH=\"46\" HEIGHT=\"26\" BORDER=\"0\" NAME=\"back\"></A>");
	}
}

function openWindow(url,width,height)
{
		width -= 12;
		height -= 31;
    PopURL=url;
    if(!PopWin || PopWin.closed){
        PopWin=PopWinOpen(width,height);
    }
    else {
        PopWin.close();
        PopWin=null;
        PopWin=PopWinOpen(width,height);
    }
}
var PopURL="";
var PopWin=null;
var openpopwin=null;
function PopWinOpen(width,height){
    var x =(screen.availWidth-width)/2;
    var y =(screen.availHeight-height)/2;
	var winfeatures="width="+width+",height="+height+",top="+y+",left="+x+",resizable,scrollbars=0";
	openpopwin=null;
	openpopwin=window.open(PopURL,"xarawin",winfeatures);
	return openpopwin;
}

function convert(val)
{
	openWindow('http://www.xara.com/currency.asp?price='+val+'',500,550);	
}
