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('<param name="wmode" value="transparent">');
    document.write('<embed src="' + file + '" width="' + width + '" height="' + height + '" wmode="transparent">');
    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
}

function showShippingDeadlines()
{
    var dv = document.getElementById("dvShippingDeadlines");
    dv.style.display = "block";
    dv.style.left = Number(findPosition() + 100) + "px";
}

function hideShippingDeadlines() {
    var dv = document.getElementById("dvShippingDeadlines");
    dv.style.display = "none";
}

function validEmail(str) {
    var pattern = /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
    return str.match(pattern);
}

//<![CDATA[
var tl_loc0 = (window.location.protocol == "https:") ? "https://secure.comodo.net/trustlogo/javascript/trustlogo.js" :
"http://www.trustlogo.com/trustlogo/javascript/trustlogo.js";
document.writeln('<scr' + 'ipt language="JavaScript" src="' + tl_loc0 + '" type="text\/javascript">' + '<\/scr' + 'ipt>');
//]]>
