function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// valid form fieldboxs
function validFrm(str,doc) 
{
  	// General declare for messages.
  	var i,p,nm,counter,condition,errors='',args,title,val;
  	counter = 0;
  	args = str.split(",");
	// loop through all the fields
  	for (i=1; i<(args.length-1); i+=2) 
  	{  
    	if (counter == 0) 
		{
    		condition=args[i+1];
	 		nm=(findObj(args[i])); 
			title=nm.name;
			val=nm.value;
			// check for empty fields
			if (val !="") 
	    	{
				// verify number
            	if (condition.indexOf('N')!=-1) 
            	{
                	if (isNaN(val))
					{
						errors=title+' must be a number.\n';
						counter = i;
					}
	        	}
				// verify email
				else if (condition.indexOf('E')!=-1) 
				{ 
			    	p=val.indexOf('@');
					x=val.indexOf('.');
					myExp = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
				
               		// if (p<1 || p==(val.length-1)) 
			   		if(myExp.test(val) == false)
					{
						errors=title+' must be a valid e-mail address.\n';
						counter = i;
					}
				}
        	}
        	else if (condition.charAt(0) == 'V') 
			{
				errors =title+' is required.\n'; 
				counter = i;
			}
		}
  	} 
	// 	displays error message
  	if (counter != 0) 
  	{
  		alert(errors);
		nm.focus();
		return false;
  	}
  	else
  	{
	  	if (confirm("Confirm " + args[0] + "?") == 0)
	  	{
		  	(findObj(args[1])).focus();
		  	return false;
	  	}
		else
		{
			return doc.submit();
		}
  	}
}


function findObj(n, d) 
{
	var p,i,x;  
	if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) 
	{
    	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
	}
  	if(!(x=d[n])&&d.all) x=d.all[n]; 
	for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

//This and others free scripts you can find on a site: artdhtml.com

ns4=(navigator.appName.indexOf("Netscape")>=0 && !document.getElementById)? 1 : 0;
ie4=(document.all && !document.getElementById)? 1 : 0;
ie5=(document.getElementById && document.all)? 1 : 0;
ns6=(document.getElementById && navigator.appName.indexOf("Netscape")>=0 )? 1: 0;
w3c=(document.getElementById)? 1 : 0;

wid=(ie4||ie5)?window.document.body.clientWidth-20:window.innerWidth-36

if(ns4){document.write ('<layer name="di1"></layer>')}else{document.write ('<div id="di1" style="position:absolute;z-index:100" ></div>')}

outd=""

if(w3c)div1=document.getElementById('di1')
if(ie4)div1=document.all['di1']
if(ns4)div1=document.layers['di1']

function move_div(x,y){
	if (isNaN(x+y))return
	if(ns4){div1.moveTo(x,y)}else{div1.style.left=x+'px';div1.style.top=y+'px';}
}

function write_div(text){
	if(ns4){
		div1.document.open();
		div1.document.write(text);
		div1.document.close();
	}
	else {div1.innerHTML=text;}
}
 
function big(n){
ondiv=n
		write_div("<a href=javascript:void(0) onmouseout='big_hide()' onmouseover='ondiv=1'><img width=120 height=80  style='border-color:#999966;' border=2 name=ib src="+n+"></a>");
		move_div(x+10,y+10)
}

function big_hide(){
	ondiv=0;
	t3=window.setTimeout('big_hide2()',100)
}

function big_hide2(){
if (ondiv==0){
	write_div("");
	move_div(-1000,-1000)}
}

function showTitle(n){
ondiv=n
		write_div("<a href=javascript:void(0) onmouseout=big_hide() onmouseover='ondiv=1'><table bgcolor='#333333' class='cbcontent' width='40'><tr onclick=document.form.Title.value='Mr'><td><a href=#>Mr</a></td></tr><tr onclick=document.form.Title.value='Mrs'><td><a href=#>Mrs</td></tr><tr onclick=document.form.Title.value='Miss'><td><a href=#>Miss</td></tr><tr onclick=document.form.Title.value='Mdm'><td><a href=#>Mdm</td></tr></table></a>");
		move_div(x,y)
}

y=x=0
function dragIt(evt){if(ie4||ie5){x=window.event.clientX+document.body.scrollLeft; y=window.event.clientY+document.body.scrollTop}else {x=evt.pageX ; y=evt.pageY }}

document.onmousemove = dragIt
if(ns4){document.captureEvents( Event.MOUSEMOVE )}

function display_retailer(n)
{
	var temp = "";
	if (retailer[n] != "")
	{
		for(i=0;i<retailer[n].length;i++)
		{
			temp = temp + retailer[n][i] + "<br>";
		}
		document.getElementById('list').innerHTML = temp;
	}
}

function selected_item(dselected,total,type,selected)
{
	for (i=0;i<total;i++)
	{
		document.getElementById(type+i).style.background='#000000';
	}
	document.getElementById(type+selected).style.background='#333333';
}

function check_status(dselected,type,selected)
{
	if (dselected != selected)
	{
		document.getElementById(type+selected).style.background='#000000';
	}
}

function mailing_list(n,q,w){
ondiv=n
		write_div("<a href=javascript:void(0)><form name=mailingform method=post><table cellpadding=0 cellspacing=0 border=0 width=206 bgcolor=#000000>" + 
				    "<tr>" + 
					  "<td colspan=3><a href=# onclick='big_hide()'><img border=0 src=images/mailing01.gif alt='Click To Close This Window'></a></td>" + 
					"</tr>" +
					"<tr>" + 
					  "<td colspan=3><a href=# onclick='big_hide()'><img border=0 src=images/mailing02.gif alt='Click To Close This Window'></a></td>" + 
					"</tr>" +
					"<tr>" + 
					  "<td background=images/mailing03.gif width=9></td>" + 
					  "<td width=188 bgcolor=#1A1817>" +
					    "<table cellpadding=0 cellspacing=0 border=0>" +
						  "<tr>" +
					  		"<td><input alt=Name onClick=document.mailingform.Name.value='' name=Name class=bcontent size=31 value=Name></td>" + 
						  "</tr>" +
						  "<tr>" +
					  		"<td><input alt=Email onClick=document.mailingform.Email.value='' name=Email class=bcontent size=31 Value=Email></td>" + 
						  "</tr>" +
						  "<tr>" +
					  		"<td><input alt=Timepieces onClick=document.mailingform.Timepieces.value='' name=Timepieces class=bcontent size=31 Value=Timepieces></td>" + 
						  "</tr>" +
						  "<tr>" +
					  		"<td><input alt=Instruments onClick=document.mailingform.Instruments.value='' name=Instruments class=bcontent size=31 Value=Instruments></td>" + 
						  "</tr>" +
						  "<tr>" +
					  		"<td><input alt=Accessories onClick=document.mailingform.Accessories.value='' name=Accessories class=bcontent size=31 Value=Accessories></td>" + 
						  "</tr>" +
						 "</table>" + 
					  "</td>" +
					  "<td background=images/mailing04.gif width=9></td>" + 
					"</tr>" +
					"<tr>" + 
					  "<td colspan=3><a href=# onclick='big_hide()'><img border=0 src=images/mailing05.gif alt='Click To Close This Window'></a></td>" + 
					"</tr>" +
					"<tr>" + 
					  "<td colspan=3>" +
					    "<table cellpadding=0 cellspacing=0 border=0>" +
						  "<tr>" +
					  		"<td><img src=images/mailing06.gif border=0></td>" + 
					  		"<td></td>" +
					  		"<td><a href=# onClick=validFrm('Submit,Name,V,Email,VE',document.mailingform) onMouseOut=MM_swapImgRestore() onMouseOver=MM_swapImage('mailing07','','images/mailing07_over.gif',1)><img name=mailing07 border=0 src=images/mailing07.gif></a></td>" + 
					  		"<td><img src=images/mailing08.gif border=0></td>" + 
						  "</tr>" +
						 "</table>" +
					  "</td>" +
					"</tr>" +
					"<tr>" + 
					  "<td colspan=3><a href=# onclick='big_hide()'><img border=0 src=images/mailing09.gif alt='Click To Close This Window'></a></td>" + 
					"</tr>" +
				  "</table></form></a>");
		if (q != "")
		{
			move_div(q,w);
		}
		else
		{
			move_div(x,y);
		}
		//document.form.Name.focus();
}