var lpPosY = 100;
var helpWin;

function flip(image,newSrc)
{
	document.getElementById(image).src = newSrc;
}

function jump(length, field)
{
	if (length == 3)
	{
		field.focus();
	}
}

function resetSearch(item, str)
{
	if (item.value == "")
	{
		item.value = str
	}
}

function clearSearch(item, str)
{
	if (item.value == str)
	{
		item.value = ""
	}
}

function WriteSWF(file, width, height)
{
   document.write('<object width="'+width+'" height="'+height+'" VIEWASTEXT>');
   document.write('<param name="movie" value="'+file+'">');
   document.write('<embed src="'+file+'" width="'+width+'" height="'+height+'" wmode="opaque">');
   document.write('</embed>');
   document.write('</object>');
}

function popUpScroll(file, width, height)
{
	if(helpWin != null && !helpWin.closed)
	{
		helpWin.focus()
	}	
	else
	{
		helpWin=window.open(file,"popup","height="+height+",width="+width+",screenx=0,screeny=0,dependent=yes,resizable=no,scrollbars=yes,menubar=no,status=no,titlebar=no");
	}
}

function popUp(file, width, height)
{
	helpWin=window.open(file,"popup","height="+height+",width="+width+",screenx=0,screeny=0,dependent=yes,resizable=no,scrollbars=no,menubar=no,status=no,titlebar=no");
}


function checkKW()
{
	var strSearch = search.kw.value.replace(/^\s+|\s+$/g,"");
	
	if (strSearch == "search" || strSearch == "")
	{
		alert("Please enter a search term");
		return false;
	}
	else
	{
		return true;
	}
}

function call_fc_flash(arg1, arg2) 
{ 
	if(typeof(fc_flash) == "function")
	{
		fc_flash(arg1, arg2);
	}
}

function findPosition() {
    var width = 0, position = 0;
    if (typeof (window.innerWidth) == 'number') {
        width = window.innerWidth;
    }
    else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
        width = document.documentElement.clientWidth;
    }
    else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
        width = document.body.clientWidth;
    }
    position = (Number(document.body.scrollLeft) + width / 2);
    if (position < 0) {
        position = 0
    }
    return position
}
