// Common javascript functions for abu garcia

    var ns4 = (document.layers);
	var ie4 = (document.all && !document.getElementById);
	var ie5 = (document.all && document.getElementById);
	var ns6 = (!document.all && document.getElementById);

	function f_clearDefaultVal(ob, defaultVal)
	{
		if (ob.value == defaultVal)
		{
			ob.value = "";
		}
	}

    function simple_show(object_ref)
    {
    	if(ns4)
    	{
    		object_ref.visibility = "show";
    		object_ref.display = "";
    	}
    	else if(ie4)
    	{
    		object_ref.style.visibility = "visible";
    		object_ref.style.display = "";
    	}
    	else if(ie5 || ns6)
    	{
    		object_ref.style.visibility = "visible";
    		object_ref.style.display = "";
    	}
    }

    function simple_hide(object_ref)
    {
    	if(ns4)
    	{
    		object_ref.visibility = "hide";
    		object_ref.display = "none";
    	}
    	else if(ie4)
    	{
    		object_ref.style.visibility = "hidden";
    		object_ref.style.display = "none";
    	}
    	else if(ie5 || ns6)
    	{
    		object_ref.style.visibility = "hidden";
    		object_ref.style.display = "none";
    	}
    }

    function show(id)
    {
    	if(ns4)
    		simple_show(document.layers[id]);
    	else if(ie4)
    		simple_show(document.all[id]);
    	else if(ie5 || ns6)
    		simple_show(document.getElementById(id));
    }

    function hide(id)
    {
    	if(ns4)
    		simple_hide(document.layers[id]);
    	else if(ie4)
    		simple_hide(document.all[id]);
    	else if(ie5 || ns6)
    		simple_hide(document.getElementById(id));
    }

	function super_img_win(img_path, img_width, img_height, title, close_link)
	{
		w_width = img_width+10;
		if(close_link !== true)
			w_height = img_height+30;
		else
			w_height = img_height+90;

		sHtml = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><title>'+title+'</title></head><body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0"><div align="center">';

		if(close_link !== true)
			sHtml += '<a href="#" style="font-family:tahoma;font-size:11px;color:#2966FF;" onClick="window.close(); return false;"><img src="'+img_path+'" width="'+img_width+'" height="'+img_height+'" border="0"></a><br><br>';
		else
			sHtml += '<img src="'+img_path+'" width="'+img_width+'" height="'+img_height+'" border="0"><br><br><a href="#" style="font-family:tahoma;font-size:11px;color:#2966FF;" onClick="window.close(); return false;">Close Window</a>';

		sHtml += '</div><script language="JavaScript">window.resizeTo('+w_width+','+w_height+');'+'<'+'/script></body></html>';
		windowstring = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+w_width+',height='+w_height;
		oWindow = window.open("","picwin",windowstring);
		oWindow.document.open();
		oWindow.document.write(sHtml);
		oWindow.document.close();
		oWindow.document.title = title;
		oWindow.focus();

		return false;
	}
